"Fossies" - the Fresh Open Source Software Archive

Member "cli-1.1259.0/src/lib/ecosystems/unmanaged/types.ts" (30 Nov 2023, 4981 Bytes) of package /linux/misc/snyk-cli-1.1259.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 import { SEVERITY } from '../../snyk-test/common';
    2 import { PkgInfo } from '@snyk/dep-graph';
    3 import { UpgradePath, DepsFilePaths } from '../types';
    4 import { SupportedProjectTypes } from '../../types';
    5 
    6 export interface HashFormat {
    7   format: number;
    8   data: string;
    9 }
   10 
   11 export interface FileHash {
   12   size: number;
   13   path: string;
   14   hashes_ffm: HashFormat[];
   15 }
   16 
   17 export interface FileHashes {
   18   hashes: FileHash[];
   19 }
   20 
   21 export interface LocationResponse {
   22   id: string;
   23   location: string;
   24   type: string;
   25 }
   26 
   27 export interface JsonApi {
   28   version: string;
   29 }
   30 
   31 export interface Links {
   32   self: string;
   33 }
   34 
   35 export interface CreateDepGraphResponse {
   36   data: LocationResponse;
   37   jsonapi: JsonApi;
   38   links: Links;
   39 }
   40 
   41 export interface DepOpenApi {
   42   node_id: string;
   43 }
   44 
   45 interface NodeOpenApi {
   46   node_id: string;
   47   pkg_id: string;
   48   deps: DepOpenApi[];
   49 }
   50 export interface Details {
   51   artifact: string;
   52   version: string;
   53   author: string;
   54   path: string;
   55   id: string;
   56   url: string;
   57   score: string;
   58   filePaths: string[];
   59 }
   60 
   61 export interface DetailsOpenApi {
   62   artifact: string;
   63   version: string;
   64   author: string;
   65   path: string;
   66   id: string;
   67   url: string;
   68   score: number;
   69   file_paths: string[];
   70 }
   71 
   72 export interface ComponentDetails {
   73   [key: string]: Details;
   74 }
   75 
   76 export interface ComponentDetailsOpenApi {
   77   [key: string]: DetailsOpenApi;
   78 }
   79 
   80 export interface GraphOpenApi {
   81   root_node_id: string;
   82   nodes: NodeOpenApi[];
   83 }
   84 
   85 export interface Pkg {
   86   id: string;
   87   info: PkgInfo;
   88 }
   89 
   90 export interface PkgManager {
   91   name: string;
   92 }
   93 
   94 export interface DepGraphDataOpenAPI {
   95   schema_version: string;
   96   pkg_manager: PkgManager;
   97   pkgs: Pkg[];
   98   graph: GraphOpenApi;
   99 }
  100 
  101 export interface Attributes {
  102   start_time: number;
  103   in_progress: boolean;
  104   dep_graph_data?: DepGraphDataOpenAPI;
  105   component_details?: ComponentDetailsOpenApi;
  106 }
  107 
  108 export interface IssuesRequestDetails {
  109   artifact: string;
  110   version: string;
  111   author: string;
  112   path: string;
  113   id: string;
  114   url: string;
  115   score: number;
  116   file_paths: string[];
  117 }
  118 
  119 export interface IssuesRequestComponentDetails {
  120   [key: string]: IssuesRequestDetails;
  121 }
  122 
  123 export interface IssuesRequestDep {
  124   nodeId: string;
  125 }
  126 
  127 export interface IssuesRequestDepOpenApi {
  128   node_id: string;
  129 }
  130 
  131 export interface IssuesRequestNode {
  132   nodeId: string;
  133   pkgId: string;
  134   deps: IssuesRequestDep[];
  135 }
  136 
  137 export interface IssuesRequestNodeOpenApi {
  138   node_id: string;
  139   pkg_id: string;
  140   deps: IssuesRequestDepOpenApi[];
  141 }
  142 
  143 export interface IssuesRequestGraph {
  144   rootNodeId: string;
  145   nodes: IssuesRequestNodeOpenApi[];
  146   component_details: ComponentDetails;
  147 }
  148 
  149 export interface IssuesRequestGraphOpenApi {
  150   root_node_id: string;
  151   nodes: IssuesRequestNodeOpenApi[];
  152   component_details: ComponentDetailsOpenApi;
  153 }
  154 
  155 export interface IssuesRequestDepGraphDataOpenAPI {
  156   schema_version: string;
  157   pkg_manager: PkgManager;
  158   pkgs: Pkg[];
  159   graph: IssuesRequestGraphOpenApi;
  160 }
  161 
  162 export interface IssuesRequestAttributes {
  163   start_time: number;
  164   dep_graph: IssuesRequestDepGraphDataOpenAPI;
  165   component_details: IssuesRequestComponentDetails;
  166   target_severity: SEVERITY;
  167 }
  168 
  169 export interface Data {
  170   id: string;
  171   type: string;
  172   attributes: Attributes;
  173 }
  174 
  175 export interface FileSignaturesDetailsOpenApi {
  176   [pkgKey: string]: {
  177     confidence: number;
  178     file_paths: string[];
  179   };
  180 }
  181 
  182 export interface FixInfoOpenApi {
  183   upgrade_paths: UpgradePath[];
  184   is_patchable: boolean;
  185   nearest_fixed_in_version?: string;
  186 }
  187 
  188 export interface IssueOpenApi {
  189   pkg_name: string;
  190   pkg_version?: string;
  191   issue_id: string;
  192   fix_info: FixInfoOpenApi;
  193 }
  194 
  195 export interface IssuesDataOpenApi {
  196   [issueId: string]: IssueDataOpenApi;
  197 }
  198 
  199 export interface GetDepGraphResponse {
  200   data: Data;
  201   jsonapi: JsonApi;
  202   links: Links;
  203 }
  204 
  205 export interface IssuesResponseDataResult {
  206   start_time: string;
  207   issues: IssueOpenApi[];
  208   issues_data: IssuesDataOpenApi;
  209   dep_graph: DepGraphDataOpenAPI;
  210   deps_file_paths: DepsFilePaths;
  211   file_signatures_details: FileSignaturesDetailsOpenApi;
  212   type: string;
  213 }
  214 
  215 export interface IssuesResponseData {
  216   id: string;
  217   result: IssuesResponseDataResult;
  218 }
  219 
  220 export interface GetIssuesResponse {
  221   jsonapi: JsonApi;
  222   links: Links;
  223   data: IssuesResponseData;
  224 }
  225 
  226 interface PatchOpenApi {
  227   version: string;
  228   id: string;
  229   urls: string[];
  230   modification_time: string;
  231 }
  232 
  233 export interface IssueDataOpenApi {
  234   id: string;
  235   package_name: string;
  236   version: string;
  237   module_name?: string;
  238   below: string; // Vulnerable below version
  239   semver: {
  240     vulnerable: string | string[];
  241     vulnerable_hashes?: string[];
  242     vulnerable_by_distro?: {
  243       [distro_name_and_version: string]: string[];
  244     };
  245   };
  246   patches: PatchOpenApi[];
  247   is_new: boolean;
  248   description: string;
  249   title: string;
  250   severity: SEVERITY;
  251   fixed_in: string[];
  252   legal_instructions?: string;
  253   package_manager?: SupportedProjectTypes;
  254   from?: string[];
  255   name?: string;
  256   publication_time?: string;
  257   creation_time?: string;
  258   cvsSv3?: string;
  259   credit?: string[];
  260 }