cnpmcore
Version:
34 lines (33 loc) • 1.25 kB
TypeScript
import { HttpClientRequestOptions, HttpClientResponse } from 'egg';
import { PackageManifestType } from '../../repository/PackageRepository';
type HttpMethod = HttpClientRequestOptions['method'];
export type RegistryResponse = {
method: HttpMethod;
} & HttpClientResponse;
export declare class NPMRegistry {
private readonly logger;
private readonly httpclient;
private config;
private timeout;
registryHost: string;
get registry(): string;
setRegistryHost(registryHost?: string): void;
getFullManifests(fullname: string, optionalConfig?: {
retries?: number;
remoteAuthToken?: string;
}): Promise<{
method: HttpMethod;
} & HttpClientResponse<PackageManifestType>>;
createSyncTask(fullname: string, optionalConfig?: {
remoteAuthToken?: string;
}): Promise<RegistryResponse>;
getSyncTask(fullname: string, id: string, offset: number, optionalConfig?: {
remoteAuthToken?: string;
}): Promise<RegistryResponse>;
getDownloadRanges(registry: string, fullname: string, start: string, end: string, optionalConfig?: {
remoteAuthToken?: string;
}): Promise<RegistryResponse>;
private request;
private genAuthorizationHeader;
}
export {};