export const providers = [ 'github', 'gitlab', 'credly', 'fiverr', 'kaggle', 'google_scholar', 'stackoverflow', 'linkedin', 'toptal', 'coursera', 'udemy', ] export type ProviderNames = typeof providers; export type Provider = { id: string; name: string; authUrl?: string; connectionType?: 'oauth' | 'url' | 'link'; iconColor?: string; colors: { bg: string; hoverBg: string; text: string; }; endpoint?: string; placeholder?: string; copy?: string; beta?: boolean; }; export interface PublicBadgeData { status: string; badgeId: string; developerName?: string; assessmentResult: AssessmentResult; updatedAt: string; badgeImageUrl?: string; connectedAccounts?: ConnectedAccount[]; optOutScreening?: boolean; isPublic: boolean; companyName?: string; providersToReconnect?: string[]; } export interface AppInstallationInfo { installationId: string; setupAction: string; stateOpaque: string; verifiedAt: string; } export interface ConnectedAccount { id?: string; // only passed in by recruiter name: string; url?: string; handle?: string; observedAt?: string; app_installation_info?: AppInstallationInfo; } export type User = { userId: string; name: string; email: string; fullName:string; profilePictureUrl?: string; assessmentStatus: 'idle' | 'in-progress' | 'completed' | 'failed' | 'pending_payment'; assessmentResult?: AssessmentResult; assessmentError?: string; assessmentUpdatedAt?: string; latestBadgeId?: string; latestBadgeImageUrl?: string; assessments: PublicBadgeData[]; connectedAccounts?: ConnectedAccount[]; userPendingRetryBadgeId?: string; createdAt?: string; }; export interface SummaryScore { score?: number; description?: string; descriptor?: string; letter_grade?: string; } // Deprecated in favor of TopContributingRule mapped view export interface DataPoint { label: string; value: string; significance: string; } export interface ProviderInsight { data_points: DataPoint[]; summary: string; } export interface TopContributingRule { provider: string; rule_label: string; why: string; } export interface DomainCSVRow { Country?: string; 'Entity Type'?: string; 'Entity Name'?: string; URL: string; } export interface IpRiskAnalysisFinding { label: string; details: string; implication: string; } export type IpRiskPhase = 'NO_MATCH' | 'POSSIBLE_MATCH' | 'POSITIVE_MATCH'; export interface IpRiskSectionItem { label: string; text: string; } export interface IpRiskSection { title: string; items: IpRiskSectionItem[]; } export interface IpRiskSections { general: IpRiskSection; location: IpRiskSection; reputational: IpRiskSection; } export interface IpRiskAnalysis { checked: boolean; findings: IpRiskAnalysisFinding[]; raw_data: { vpn_ips?: string[]; countries?: string[]; blocklisted_ips?: { ip: string; lists: string[] }[]; abusive_ips?: string[]; impossible_travel_events?: string[]; anomalous_geo_logins?: string[]; }; phase?: IpRiskPhase; sections?: IpRiskSections; countries?: string[]; } export interface CSLDetails { name: string; description: string; url: string; } export interface FBIWantedDetails { name: string; description: string; url: string; } export interface FBIWantedMatch { uid: string; title: string; url: string; justification: string; // eslint-disable-next-line @typescript-eslint/no-explicit-any raw_result: any; } export interface EnterpriseCoachingItem { headline: string; rationale: string; action?: string; type: 'support' | 'coaching'; } export interface EnterpriseCoaching { items: EnterpriseCoachingItem[]; summary?: string; } export interface EnterpriseMatch { role: { name: string; description: string; categoryTargets?: Record; }; label: 'Incompatible' | 'Weak Match' | 'Moderate Match' | 'Strong Match' | 'Optimal Match'; description: string; coaching?: EnterpriseCoaching; } export interface UseCaseItem { title: string; potential_impact: string; demonstrated_capability: string; justification: string; } export interface EnterpriseUseCases { items: UseCaseItem[]; note?: string; } export type RecommendationPriority = 'High' | 'Medium' | 'Low'; export type RecommendationItem = { title: string; priority: RecommendationPriority; source: string; recommendation: string; evidence: string; why_this_matters: string; what_to_do_next: string; expected_outcome: string; }; export type Recommendations = { summary?: string; bullet_points?: string[]; items?: RecommendationItem[]; }; export interface AssessmentResult { final_percent: number; report_summary?: string; recommendations: Recommendations; developer_trust_explanation?: string; industry_considerations?: string; ai_usage_summary?: { explanation: string; key_findings: string[]; originality_score: number; transparency_score: number; transparency_descriptor?: string; files_with_ai_findings: number; files_analyzed: number; files_with_disclosure?: number; repos_analyzed?: number; repos_with_ai_findings?: number; evidence?: Array<{ file_path?: string; snippet?: string; reason?: string }>; findings_by_repo?: Record>; }; key_skills?: string[]; // Deprecated: previously per-provider narrative and datapoints provider_insights?: { [provider: string]: ProviderInsight; }; badgeId?: string; screening_sources?: { ofac_lists: string[]; risk_profile_domains: DomainCSVRow[]; additional_watchlists?: string[]; ip_risk_analysis?: IpRiskAnalysis; ofac_screen?: { checked?: boolean; sources?: string[]; matches?: { sanction: { source: string; name: string; url: string; programs: string[]; entityLink: string; }; uid: string; title: string; url: string; justification: string; // eslint-disable-next-line @typescript-eslint/no-explicit-any raw_result: any; }[]; // eslint-disable-next-line @typescript-eslint/no-explicit-any raw?: any; }; sanctions_sources_detailed?: { issuingEntity: string; listName: string; matched?: boolean; sublists?: string[] }[]; sanctions_sublists?: string[]; csl_details?: CSLDetails; fbi_details?: FBIWantedDetails; fbi_matches?: FBIWantedMatch[]; }; top_contributing_rules?: TopContributingRule[]; rules_graph_s3_key?: string; optOutScreening?: boolean; clientMetadata?: ClientMetadata; scoring_summary?: ScoringSummary; skills_matrix?: SkillsMatrix; skills_all?: SkillsAll; graph_insights?: GraphInsightsPayload; enterprise_match?: EnterpriseMatch; enterprise_use_cases?: EnterpriseUseCases; // New: account authenticity assessment account_authenticity?: { label: 'Normal' | 'Suspicious' | 'Likely Inauthentic'; description?: string; // Optional diagnostics for UI/tooling oauth_connected?: string[]; mismatches?: Array<{ provider?: string; detail?: string }>; }; } export interface ClientMetadata { ipAddress: string; userAgent: string; language: string; screenResolution: string; timezone: string; referrer: string; } // --- Scoring Summary (from rules engine) --- export interface ScoringSummaryConfig { coldstart_fraction?: number; coldstart_mapping?: { default?: number; by_category?: { [category: string]: number }; }; system_weights?: { [k: string]: number }; genre_mapping?: { [genre: string]: string[] }; } export interface ScoreBreakdownTotals { applied?: number; applied_signed?: number; theoretical?: number; coldstart?: number; percent_progress?: number; // 0-100 percent_progress_signed?: number; // -100 to 100 percent_coldstart_over_final?: number | null; } export interface ScoreBreakdown { categories?: { [category: string]: { applied?: number; applied_signed?: number; theoretical?: number; coldstart?: number; percent_progress?: number; percent_progress_signed?: number; percent_coldstart_over_final?: number | null; }; }; totals?: ScoreBreakdownTotals; } export interface GenreScoreEntry { categories: string[]; atomic: ScoreBreakdownTotals & {}; business: ScoreBreakdownTotals & {}; combined: { percent_progress?: number; percent_progress_signed?: number; percent_coldstart_over_final?: number | null }; } export interface ScoringSummary { config?: ScoringSummaryConfig; overall?: { atomic?: ScoreBreakdownTotals; business?: ScoreBreakdownTotals; combined?: { percent_progress?: number; percent_progress_signed?: number; percent_coldstart_over_final?: number | null }; }; genres?: { [genre: string]: GenreScoreEntry }; category_scores?: { [category: string]: { atomic?: { percent_progress?: number; percent_progress_signed?: number } & Partial; business?: { percent_progress?: number; percent_progress_signed?: number } & Partial; combined?: { percent_progress?: number; percent_progress_signed?: number }; }; }; } // Graph insights payload rendered by GraphInsights and used in SharedBadgeDisplay export type CategoryTopBusinessItem = { label?: string; rule_label?: string; provider?: string; weight?: number; uid?: string; }; export type CategoryScoreValue = { percent_progress?: number; percent_progress_signed?: number; applied?: number; theoretical?: number; }; export type AiCategoryScoreEntry = { business?: CategoryScoreValue; combined?: CategoryScoreValue; }; export type AiSkillsCategoryRadarPoint = { axis: string; observed?: number; self_reported?: number; certified?: number; matched_rules?: number; }; export interface GraphInsightsPayload { providers?: Array<{ name: string; scores?: { atomic?: number; business?: number; total?: number }; errorCount?: number; }>; categoryAggregate?: Array<{ category: string; applied_weight_sum?: number; }>; // New: per-category percent score (0-100) from rules_engine scoring_summary categoryScoresPercent?: Array<{ category: string; percent?: number; // 0-100 }>; sanctions?: { ofacMatches?: number; fbiMatches?: number; cslMatched?: boolean; }; ipRisk?: { phase?: 'NO_MATCH' | 'POSSIBLE_MATCH' | 'POSITIVE_MATCH' | string }; categoryTopBusiness?: { [category: string]: CategoryTopBusinessItem[] }; domainAffiliations?: { checkedCount?: number }; // New: Skills category radar data skillsCategoryRadar?: Array<{ axis: string; observed?: number; // 0-100 self_reported?: number; // 0-100 certified?: number; // 0-100 // New: experience metric (0-100) for color saturation experience?: number; // New: total evidence count across all skills in this category evidence_count_total?: number; }>; // New: mapping of category -> list of skills contributing to that category skillsByCategory?: Record; // New: per-skill metadata used by UI (e.g., presence label, experience years) skillsMeta?: Record; years?: number; sources?: string[]; // New: total number of evidence sources across observed/self-reported/certified evidenceCount?: number; }>; // New: Flattened list of business rule selections (for appendix) business_rules_all?: Array<{ provider: string; category?: string; label?: string; group_id?: string; uid?: string; likert_label?: string; likert_value?: number; weight?: number; }>; // New: Compact UI summary for top summary cards uiSummary?: { technical?: { percent?: number; // 0-100, higher = more evidence label?: string; // e.g., LOW/MODERATE/HIGH EVIDENCE top_movers?: Array<{ label?: string; uid?: string }>; }; risk?: { percent_good?: number; // 0-100, higher = lower risk (good) label?: string; // e.g., LOW/MODERATE/HIGH RISK top_movers?: Array<{ label?: string; uid?: string }>; }; }; aiCategoryOrder?: string[]; aiCategoryScores?: Record; aiCategoryTopBusiness?: { [category: string]: CategoryTopBusinessItem[] }; aiSkillsCategoryRadar?: AiSkillsCategoryRadarPoint[]; aiSummary?: { percent?: number; label?: string; }; ai_usage_summary?: { explanation: string; key_findings: string[]; originality_score: number; transparency_score: number; transparency_descriptor?: string; files_with_ai_findings: number; files_analyzed: number; files_with_disclosure?: number; repos_analyzed?: number; repos_with_ai_findings?: number; evidence?: Array<{ file_path?: string; snippet?: string; reason?: string }>; findings_by_repo?: Record>; } } // Skills matrix export interface SkillBucket { present: boolean; evidence?: string; sources?: string[]; } export interface SkillRow { name: string; observed: SkillBucket; self_reported: SkillBucket; certified: SkillBucket; // optional list of skill categories from backend categories?: string[]; } export interface SkillsMatrix { skills: SkillRow[]; } export interface SkillsAll { skills: SkillRow[]; } export interface ScoresByCategory { [category: string]: { subtotal: number; fields: { [field: string]: FieldScore | AnalyzedItem | AnalyzedItem[]; }; }; } export interface FieldScore { score: number; summary?: string; justification: string; } export interface AnalyzedItem { repo_name?: string; summary: string; quality_score?: number; professional_score?: number; } export interface BusinessRule { provider: string; category: string; label: string; group_id: string; likert_label: string; likert_value: number; weight: number; uid: string; } export interface TopBusinessRule { provider: string; category: string; label: string; weight: number; uid: string; } export type Role = { roleId: string; name: string; description?: string; organization?: string; createdAt?: string; userId?: string; } // Timeseries for dashboard trends export type TimeseriesPoint = { date: string; value: number }; export interface AssessmentTimeseries { final_percent: TimeseriesPoint[]; genres: Record; categories: Record; // New: daily request counts aggregated from S3 request logs online_activity?: TimeseriesPoint[]; // New: dynamic skills categories counts over time (per assessment date) skills_categories?: Record; }