/** * API client — thin fetch wrapper around the CareerVivid API. * * All functions throw on network errors; on HTTP errors they return * a structured ApiError for clean CLI error messages. */ export type PostType = "article" | "whiteboard"; export type DataFormat = "markdown" | "mermaid"; export interface PublishPayload { type: PostType; dataFormat: DataFormat; title: string; content: string; tags?: string[]; coverImage?: string; isOfficialPost?: boolean; isPublic?: boolean; } export interface PublishResult { success: boolean; postId: string; url: string; message: string; title?: string; } export interface VerifyResult { userId: string; name: string; email: string | null; avatar: string; role: string; isAdmin: boolean; } export interface ApiError { isError: true; statusCode: number; message: string; fields?: { field: string; message: string; }[]; } export declare function publishPost(payload: PublishPayload, dryRun?: boolean): Promise; export declare function getPost(postId: string): Promise; export declare function updatePost(postId: string, payload: Partial): Promise; /** * Verify an API key against the /verifyAuth endpoint. * Optionally accepts a specific key (for set-key validation). */ export declare function verifyKey(key?: string): Promise; /** * @deprecated Use verifyKey() instead for richer identity information. */ export declare function pingAuth(): Promise<{ ok: boolean; error?: string; }>; export declare function initPortfolio(title?: string, templateId?: string): Promise<{ success: boolean; portfolioId: string; url: string; } | ApiError>; export declare function portfolioList(): Promise<{ portfolios: { id: string; title: string; url: string; updatedAt: string | null; }[]; } | ApiError>; export declare function updatePortfolioProjects(portfolioId: string, projects: any[], techStack?: string[]): Promise<{ success: boolean; message: string; } | ApiError>; export declare function updatePortfolioHero(portfolioId: string, hero?: any, theme?: any, seoMetadata?: any): Promise<{ success: boolean; message: string; } | ApiError>; export declare function uploadPortfolioAsset(image: string, path: string, mimeType: string): Promise<{ success: boolean; downloadUrl: string; } | ApiError>; export declare function isApiError(v: unknown): v is ApiError; export type ApplicationStatus = "To Apply" | "Applied" | "Interviewing" | "Offered" | "Rejected"; export interface ScoredJob { id: string; title: string; company: string; location: string; description: string; url: string; salary?: string; score: number; scoreLabel: "Excellent" | "Good" | "Fair" | "Low"; aiSummary: string; missingSkills: string[]; } export interface JobTrackerItem { id: string; jobTitle: string; companyName: string; location: string; applicationStatus: ApplicationStatus; aiScore: number | null; jobPostURL: string; updatedAt: string | null; notes: string; } export interface ResumeResult { resumeId: string; title: string; cvMarkdown: string; updatedAt: string | null; } export interface ResumesListResult { resumes: { id: string; title: string; updatedAt: string | null; }[]; total: number; } /** Fetch the user's latest resume from CareerVivid via API key */ export declare function resumeGet(resumeId?: string): Promise; /** Fetch a lightweight list of the user's resumes */ export declare function resumesList(): Promise; export declare function resumeUpdate(payload: { resumeId: string; action: "refine" | "tailor"; jobDescription?: string; instruction?: string; newTitle?: string; copy?: boolean; }): Promise<{ success: boolean; resumeId: string; message: string; } | ApiError>; /** Parse raw text into a structured Resume and save it */ export declare function resumeCreate(payload: { title?: string; baseContent: string; }): Promise<{ success: boolean; title: string; resumeId: string; } | ApiError>; export declare function resumeDelete(payload: { resumeId: string; }): Promise<{ success: boolean; message: string; } | ApiError>; /** Run an agentic job search scored against the resume */ export declare function jobsHunt(payload: { resumeContent?: string; role: string; location?: string; count?: number; minScore?: number; targetOrgs?: string[]; }): Promise<{ jobs: ScoredJob[]; total: number; } | ApiError>; /** Add a job to the user's Kanban tracker */ export declare function jobsCreate(payload: { jobTitle: string; companyName: string; location?: string; jobPostURL?: string; jobDescription?: string; aiScore?: number; aiSummary?: string; notes?: string; }): Promise<{ success: boolean; id: string; message: string; } | ApiError>; /** Move a job to a new status on the Kanban board */ export declare function jobsUpdate(payload: { jobId: string; status: ApplicationStatus; notes?: string; }): Promise<{ success: boolean; jobId: string; newStatus: string; message: string; } | ApiError>; /** List jobs currently in the user's tracker */ export declare function jobsList(status?: ApplicationStatus): Promise<{ jobs: JobTrackerItem[]; total: number; } | ApiError>; export interface ApplyFormField { label: string; type: string; required: boolean; options?: string[]; placeholder?: string; } export interface ApplyAnswerResult { answers: Record; coverLetter?: string; meta: { resumeId: string; jobUrl: string; platform: string; }; } /** * Call the generateApplyAnswers Cloud Function to get AI-tailored answers * for all form fields in a job application. */ export declare function getApplyAnswers(payload: { jobUrl: string; jobTitle: string; companyName: string; jobDescription?: string; resumeId?: string; platform: string; fields: ApplyFormField[]; generateCoverLetter?: boolean; }): Promise; export interface CoverLetter { id: string; jobTitle: string; companyName: string; createdAt?: string; content?: string; } /** Generate and save a new cover letter natively */ export declare function generateCoverLetter(payload: { resumeId: string; jobTitle: string; companyName: string; jobDescription: string; }): Promise<{ success: boolean; coverLetter: CoverLetter; } | ApiError>; /** List previously generated cover letters */ export declare function listCoverLetters(jobId?: string): Promise<{ coverLetters: CoverLetter[]; total: number; } | ApiError>; export interface ReferredUser { uid: string; email: string; signupDate: string | null; } export interface ReferralStatsResult { code: string; totalReferred: number; maxReferrals: number; referredUsers: ReferredUser[]; } /** Fetch user's referral code and stats */ export declare function getReferralStats(): Promise; //# sourceMappingURL=api.d.ts.map