/******************************************************************************** * Copyright (c) 2026 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * https://www.eclipse.org/legal/epl-2.0 * * SPDX-License-Identifier: EPL-2.0 ********************************************************************************/ export type ScanStatus = 'STARTED' | 'VALIDATING' | 'SCANNING' | 'PASSED' | 'QUARANTINED' | 'AUTO REJECTED' | 'ERROR'; export interface ValidationFailure { id: string; type: string; ruleName: string; reason: string; dateDetected: string; enforcedFlag: boolean; } export interface Threat { id: string; fileName: string | null; fileHash: string | null; fileExtension: string | null; type: string; ruleName: string; severity?: string; enforcedFlag: boolean; reason: string; dateDetected: string; } export interface AdminDecision { decision: string; decidedBy: string; dateDecided: string; } export interface CheckResult { checkType: string; category: 'PUBLISH_CHECK' | 'SCANNER_JOB'; result: 'PASSED' | 'QUARANTINE' | 'REJECT' | 'ERROR'; startedAt: string; completedAt: string | null; durationMs: number | null; filesScanned: number | null; findingsCount: number | null; summary: string | null; errorMessage: string | null; /** Whether this check was required (errors block publishing). Null for scanner jobs. */ required: boolean | null; /** Deep link to the external scanner's dashboard for this job. Null if not applicable. */ externalUrl: string | null; } export type ScannerJobStatus = 'QUEUED' | 'PROCESSING' | 'SUBMITTED' | 'COMPLETE' | 'FAILED' | 'REMOVED'; export interface ScannerJob { id: string; scannerType: string; status: ScannerJobStatus; createdAt: string; updatedAt: string; errorMessage: string | null; /** Deep link to the external scanner's dashboard for this job. Null if not applicable. */ externalUrl: string | null; } export interface ScanResult { id: string; displayName: string; namespace: string; extensionName: string; publisher: string; publisherUrl: string | null; version: string; targetPlatform: string; universalTargetPlatform: boolean; status: ScanStatus; dateScanStarted: string; dateScanEnded: string | null; dateQuarantined: string | null; dateRejected: string | null; adminDecision: AdminDecision | null; threats: Threat[]; validationFailures: ValidationFailure[]; checkResults: CheckResult[]; scannerJobs: ScannerJob[]; extensionIcon?: string; downloadUrl: string | null; errorMessage: string | null; } export type DateRangeType = 'today' | 'last7days' | 'last30days' | 'last90days' | 'all'; export type EnforcementType = 'enforced' | 'notEnforced' | 'all'; export type ConfirmActionType = 'allow' | 'block' | 'delete' | null; export type FileActionType = 'allow' | 'block' | 'delete' | null; export type FileDecisionType = string; export interface ScanCounts { STARTED: number; VALIDATING: number; SCANNING: number; PASSED: number; QUARANTINED: number; AUTO_REJECTED: number; ERROR: number; ALLOWED: number; BLOCKED: number; NEEDS_REVIEW: number; } /** * Unified file decision type for the /files API * Represents a file that has been allowed or blocked by an admin */ export interface FileDecision { id: string; fileName: string; fileHash: string; fileType: string; decision: FileDecisionType; decidedBy: string; dateDecided: string; displayName: string; namespace: string; extensionName: string; publisher: string; version: string; scanId?: string; } export interface FileDecisionCounts { allowed: number; blocked: number; total: number; } export interface ScanState { selectedTab: number; publisherQuery: string; namespaceQuery: string; nameQuery: string; currentPage: number; pageSize: number; dateRange: DateRangeType; enforcement: EnforcementType; fileDateRange: DateRangeType; statusFilters: Set; quarantineFilters: Set; threatScannerFilters: Set; validationTypeFilters: Set; filterOptionsLoaded: boolean; availableValidationTypes: string[]; availableThreatScanners: string[]; filterMenuAnchor: HTMLElement | null; quarantineFilterMenuAnchor: HTMLElement | null; autoRejectedFilterMenuAnchor: HTMLElement | null; quarantinedChecked: Record; scanDecisions: Record; filesChecked: Set; confirmDialogOpen: boolean; confirmAction: ConfirmActionType; fileDialogOpen: boolean; fileActionType: FileActionType; scans: ScanResult[]; totalScans: number; isLoadingScans: boolean; scanCounts: ScanCounts | null; refreshTrigger: number; lastRefreshed: Date | null; autoRefresh: boolean; files: FileDecision[]; totalFiles: number; isLoadingFiles: boolean; fileCounts: FileDecisionCounts | null; } export type ScanAction = { type: 'SET_TAB'; payload: number; } | { type: 'SET_PUBLISHER_QUERY'; payload: string; } | { type: 'SET_NAMESPACE_QUERY'; payload: string; } | { type: 'SET_NAME_QUERY'; payload: string; } | { type: 'CLEAR_SEARCH'; } | { type: 'SET_PAGE'; payload: number; } | { type: 'RESET_PAGE'; } | { type: 'SET_DATE_RANGE'; payload: DateRangeType; } | { type: 'SET_ENFORCEMENT'; payload: EnforcementType; } | { type: 'SET_FILE_DATE_RANGE'; payload: DateRangeType; } | { type: 'TOGGLE_STATUS_FILTER'; payload: string; } | { type: 'SET_STATUS_FILTERS'; payload: Set; } | { type: 'TOGGLE_QUARANTINE_FILTER'; payload: string; } | { type: 'SET_QUARANTINE_FILTERS'; payload: Set; } | { type: 'TOGGLE_THREAT_SCANNER_FILTER'; payload: string; } | { type: 'SET_THREAT_SCANNER_FILTERS'; payload: Set; } | { type: 'TOGGLE_VALIDATION_TYPE_FILTER'; payload: string; } | { type: 'SET_VALIDATION_TYPE_FILTERS'; payload: Set; } | { type: 'SET_FILTER_OPTIONS_LOADED'; payload: boolean; } | { type: 'SET_AVAILABLE_VALIDATION_TYPES'; payload: string[]; } | { type: 'SET_AVAILABLE_THREAT_SCANNERS'; payload: string[]; } | { type: 'SET_FILTER_MENU_ANCHOR'; payload: HTMLElement | null; } | { type: 'SET_QUARANTINE_FILTER_MENU_ANCHOR'; payload: HTMLElement | null; } | { type: 'SET_AUTO_REJECTED_FILTER_MENU_ANCHOR'; payload: HTMLElement | null; } | { type: 'SET_QUARANTINED_CHECKED'; payload: Record; } | { type: 'TOGGLE_QUARANTINED_CHECKED'; payload: { id: string; checked: boolean; }; } | { type: 'SELECT_ALL_QUARANTINED'; payload: ScanResult[]; } | { type: 'DESELECT_ALL_QUARANTINED'; } | { type: 'SET_SCAN_DECISIONS'; payload: Record; } | { type: 'SET_FILES_CHECKED'; payload: Set; } | { type: 'OPEN_CONFIRM_DIALOG'; payload: ConfirmActionType; } | { type: 'CLOSE_CONFIRM_DIALOG'; } | { type: 'OPEN_FILE_DIALOG'; payload: FileActionType; } | { type: 'CLOSE_FILE_DIALOG'; } | { type: 'SET_SCANS'; payload: { scans: ScanResult[]; totalScans: number; }; } | { type: 'SET_LOADING_SCANS'; payload: boolean; } | { type: 'SET_SCAN_COUNTS'; payload: ScanCounts | null; } | { type: 'TRIGGER_REFRESH'; } | { type: 'SET_LAST_REFRESHED'; payload: Date; } | { type: 'SET_AUTO_REFRESH'; payload: boolean; } | { type: 'SET_FILES'; payload: { files: FileDecision[]; totalFiles: number; }; } | { type: 'SET_LOADING_FILES'; payload: boolean; } | { type: 'SET_FILE_COUNTS'; payload: FileDecisionCounts | null; } | { type: 'EXECUTE_CONFIRM_ACTION'; }; export declare const initialScanState: ScanState; //# sourceMappingURL=scan-types.d.ts.map