
/**
 * This file was automatically generated by json-schema-to-typescript.
 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
 * and run json-schema-to-typescript to regenerate this file.
 */

/**
 * Schema for OSS-IQ project metrics export data (v1.1 adds transitive_packages and dependency_path)
 */
export interface OSSIQExportSchemaV11 {
  /**
   * Metadata about the export itself
   */
  metadata: {
    /**
     * Version of the export schema format
     */
    schema_version: "1.1";
    /**
     * UTC timestamp when the export was generated
     */
    export_timestamp: string;
    [k: string]: unknown;
  };
  /**
   * Basic project information
   */
  project: {
    /**
     * Project name
     */
    name: string;
    /**
     * Absolute path to the project
     */
    path: string;
    /**
     * Package registry type (npm, pypi, etc.)
     */
    registry: "npm" | "pypi";
    [k: string]: unknown;
  };
  /**
   * Summary statistics for the scanned project
   */
  summary: {
    /**
     * Total number of packages (production + development)
     */
    total_packages: number;
    /**
     * Number of production dependencies
     */
    production_packages: number;
    /**
     * Number of development dependencies
     */
    development_packages: number;
    /**
     * Number of packages with known CVEs
     */
    packages_with_cves: number;
    /**
     * Total number of CVEs across all packages
     */
    total_cves: number;
    /**
     * Number of packages behind the latest version
     */
    packages_outdated: number;
    [k: string]: unknown;
  };
  /**
   * Production dependency metrics
   */
  production_packages: PackageMetrics[];
  /**
   * Development dependency metrics
   */
  development_packages: PackageMetrics[];
  /**
   * Transitive dependency metrics (all paths, production edges only)
   */
  transitive_packages: PackageMetrics[];
  [k: string]: unknown;
}
/**
 * Metrics for a single package
 */
export interface PackageMetrics {
  /**
   * Package name
   */
  package_name: string;
  /**
   * Whether this is a development/optional dependency
   */
  is_optional_dependency: boolean;
  /**
   * Currently installed version
   */
  installed_version: string;
  /**
   * Latest available version
   */
  latest_version: string | null;
  /**
   * Days between installed and latest version
   */
  time_lag_days: number | null;
  /**
   * Number of releases between installed and latest
   */
  releases_lag: number | null;
  /**
   * Known CVEs for this package
   */
  cve: CVEInfo[];
  /**
   * Ancestor chain from root to this package (null for direct dependencies)
   */
  dependency_path: string[] | null;
  repo_url?: string | null;
  homepage_url?: string | null;
  package_url?: string | null;
  /**
   * SPDX license identifiers parsed from the package license expression
   */
  license?: string[] | null;
  /**
   * Package URL (PURL) per ECMA-386
   */
  purl?: string | null;
  /**
   * Version constraint declared in the project manifest
   */
  version_constraint?: string | null;
  [k: string]: unknown;
}
/**
 * CVE information for a package
 */
export interface CVEInfo {
  /**
   * Primary CVE identifier
   */
  id: string;
  /**
   * All aliases (CVE, GHSA, OSV)
   */
  cve_ids: string[];
  /**
   * CVE database source
   */
  source: string;
  /**
   * Affected package name
   */
  package_name: string;
  /**
   * Package registry (npm, pypi, etc.)
   */
  package_registry: string;
  /**
   * Vulnerability description
   */
  summary: string;
  /**
   * Severity level
   */
  severity: "LOW" | "MEDIUM" | "HIGH" | "CRITICAL";
  /**
   * List of affected versions
   */
  affected_versions: string[];
  /**
   * Publication date
   */
  published: string | null;
  /**
   * URL to upstream advisory
   */
  link: string;
  [k: string]: unknown;
}
