UNPKG

cnpmcore

Version:

Private NPM Registry for Enterprise

32 lines (31 loc) 1.7 kB
import { AbstractService } from '../../common/AbstractService.ts'; import type { Package } from '../entity/Package.ts'; import type { PackageVersion } from '../entity/PackageVersion.ts'; import { PackageVersionFile } from '../entity/PackageVersionFile.ts'; export declare const UNPKG_WHITE_LIST_URL = "https://github.com/cnpm/unpkg-white-list"; export declare class PackageVersionFileService extends AbstractService { #private; private readonly packageVersionRepository; private readonly packageRepository; private readonly packageVersionFileRepository; private readonly distRepository; private readonly packageManagerService; private readonly cacheAdapter; get unpkgWhiteListVersion(): string; listPackageVersionFiles(pkgVersion: PackageVersion, directory: string): Promise<{ files: PackageVersionFile[]; directories: string[]; }>; showPackageVersionFile(pkgVersion: PackageVersion, path: string): Promise<PackageVersionFile | null>; isLargePackageVersionAllowed(pkgScope: string, pkgName: string, pkgVersion: string): Promise<boolean>; /** * Check if the package is blocked to sync * @param pkgScope - The scope of the package * @param pkgName - The name of the package * @returns True if the package is blocked to sync, false otherwise */ isPackageBlockedToSync(pkgScope: string, pkgName: string): Promise<boolean>; checkPackageVersionInUnpkgWhiteList(pkgScope: string, pkgName: string, pkgVersion: string): Promise<void>; syncPackageReadme(pkg: Package, latestPkgVersion: PackageVersion): Promise<void>; syncPackageVersionFiles(pkgVersion: PackageVersion): Promise<PackageVersionFile[]>; }