/** * Common AI Profile reference: * Either profile_id or profile_name must be provided. */ export interface AiProfile { profile_id?: string; profile_name?: string; } /** * Optional metadata about your application or AI model */ export interface Metadata { app_name?: string; app_user?: string; ai_model?: string; } /** * Content object for scanning (prompt/response pairs or partial). */ export interface ScanContent { prompt?: string; response?: string; } /** * Sync Scan Request: * - A single scan request object */ export interface ScanRequest { tr_id?: string; ai_profile: AiProfile; metadata?: Metadata; contents: ScanContent[]; } /** * Response sub-objects: indicates detections for prompt or response. */ export interface PromptDetected { url_cats?: boolean; dlp?: boolean; injection?: boolean; } export interface ResponseDetected { url_cats?: boolean; dlp?: boolean; } /** * Sync Scan Response object */ export interface ScanResponse { report_id: string; scan_id: string; tr_id?: string; profile_id?: string; profile_name?: string; category: string; action: string; prompt_detected?: PromptDetected; response_detected?: ResponseDetected; created_at?: string; completed_at?: string; } /** * Async Scan Request: * - You can post multiple items in a single request */ export interface AsyncScanObject { req_id: number; scan_req: ScanRequest; } export type AsyncScanRequest = AsyncScanObject[]; /** * Async Scan Response */ export interface AsyncScanResponse { received: string; scan_id: string; report_id?: string; } /** * Scan Results (GET /v1/scan/results) - returns array of scan results by scan IDs */ export interface ScanIdResult { req_id?: number; status?: string; scan_id: string; result?: ScanResponse; } /** * Threat Scan Reports (GET /v1/scan/reports) * Returns an array of ThreatScanReportObject */ export interface ThreatScanReportObject { report_id: string; scan_id: string; req_id?: number; transaction_id?: string; detection_results?: DetectionServiceResultObject[]; } export type ThreatScanReportObjects = ThreatScanReportObject[]; /** * Detailed detection results */ export interface DetectionServiceResultObject { data_type?: string; detection_service?: string; verdict?: string; action?: string; result_detail?: DSDetailResultObject; } export interface DSDetailResultObject { urlf_report?: UrlFilterReportObject[]; dlp_report?: DlpReportObject; } /** * URL Filtering entries */ export type UrlFilterReportObject = UrlfEntryObject[]; export interface UrlfEntryObject { url?: string; risk_level?: string; categories?: string[]; } /** * DLP report details */ export interface DlpReportObject { dlp_report_id?: string; dlp_profile_name?: string; dlp_profile_id?: string; dlp_profile_version?: number; data_pattern_rule1_verdict?: string; data_pattern_rule2_verdict?: string; } /** * Error response object */ export interface PanAirsApiErrorResponse { status_code?: number; message?: string; error?: { message?: string; [key: string]: string | number | boolean | null | undefined; }; retry_after?: { interval?: number; unit?: string; }; }