auditjs
Version:
Audit dependencies to identify known vulnerabilities and maintenance problems
29 lines (28 loc) • 1.36 kB
TypeScript
import type { RecommendationResponse } from '@sonatype/sonatype-guide-api-client';
import { Coordinates } from '../Types/Coordinates';
import { OssIndexServerResultJSON } from '../Types/OssIndexServerResult';
export declare class GuideRequestService {
readonly username?: string | undefined;
readonly token?: string | undefined;
readonly cacheLocation: string;
readonly server: string;
readonly accessToken?: string | undefined;
private api;
private recommendationsApi;
constructor(username?: string | undefined, token?: string | undefined, cacheLocation?: string, server?: string, accessToken?: string | undefined);
getRecommendations(purls: string[]): Promise<Map<string, RecommendationResponse>>;
private chunkData;
private combineResponseChunks;
private combineCacheAndResponses;
private insertResponsesIntoCache;
private checkIfResultsAreInCache;
private getResultsFromGuide;
/**
* Posts to Sonatype Guide OSS Index Compatibility API, returns Promise of json object of response.
* Results are cached for 24 hours.
* @param data - {@link Coordinates} Array
* @param format - purl format string (e.g. 'npm')
* @returns a {@link Promise} of all Responses
*/
callGuideOrGetFromCache(data: Coordinates[], format?: string): Promise<Array<OssIndexServerResultJSON>>;
}