cnpmcore
Version:
Private NPM Registry for Enterprise
44 lines (43 loc) • 2 kB
TypeScript
import type { AbbreviatedPackageJSONType, PackageJSONType } from '../../repository/PackageRepository.ts';
import { BugVersion } from '../entity/BugVersion.ts';
export type MixedManifests = {
versions: Record<string, PackageJSONType | AbbreviatedPackageJSONType | undefined>;
};
export declare class BugVersionService {
private readonly packageRepository;
private readonly distRepository;
private readonly logger;
private readonly cacheService;
private readonly bugVersionStore;
/**
* Get the "config.bug-versions" field in "bug-versions"'s package.json
* @see https://github.com/cnpm/bug-versions/blob/master/package.json#L136
* @returns The bug version
*/
getBugVersion(): Promise<BugVersion | undefined>;
/**
* Check if the package has bug versions
* @param fullname - The fullname of the package
* @returns True if the package has bug versions, false otherwise
*/
hasBugVersions(fullname: string): Promise<boolean>;
cleanBugVersionPackageCaches(bugVersion: BugVersion): Promise<void>;
/**
* Fix package bug version with all versions
* @param bugVersion - The bug version
* @param fullname - The fullname of the package
* @param manifests - The manifests of the package
* @returns The versions of the fixed manifests
*/
fixPackageBugVersions(bugVersion: BugVersion, fullname: string, manifests: MixedManifests): Promise<string[]>;
fixPackageBugVersion(bugVersion: BugVersion, fullname: string, manifest: PackageJSONType): Promise<import("../entity/BugVersion.ts").MixedBugVersionPackageType | undefined>;
/**
* Fix package bug version with all versions
* @param fullname - The fullname of the package
* @param bugVersion - The bug version
* @param manifest - The manifest of the package
* @param manifests - The manifests of the package
* @returns The version of the fixed manifest
*/
private fixPackageBugVersionWithAllVersions;
}