///
import IDataboxManifest from '@ulixee/specification/types/IDataboxManifest';
import { IDataboxRecord } from './DataboxesTable';
import { IDataboxStatsRecord } from './DataboxStatsTable';
export interface IStatsByFunctionName {
[functionName: string]: IDataboxStatsRecord;
}
declare type TDataboxRecordAndStats = IDataboxRecord & {
statsByFunction: IStatsByFunctionName;
path: string;
latestVersionHash: string;
};
export default class DataboxRegistry {
#private;
readonly storageDir: string;
readonly workingDir: string;
private get databoxesDb();
constructor(storageDir: string, workingDir: string);
close(): void;
hasVersionHash(versionHash: string): boolean;
loadVersion(versionHash: string): Promise<{
registryEntry: TDataboxRecordAndStats;
manifest: IDataboxManifest;
}>;
getByVersionHash(versionHash: string): TDataboxRecordAndStats;
recordStats(versionHash: string, functionName: string, stats: {
bytes: number;
microgons: number;
millis: number;
}): void;
openDbx(manifest: IDataboxManifest): Promise;
getStoragePath(versionHash: string): string;
getLatestVersion(hash: string): string;
save(databoxTmpPath: string, rawBuffer: Buffer, allowNewLinkedVersionHistory?: boolean): Promise<{
dbxPath: string;
}>;
private checkDataboxCoreInstalled;
private checkMatchingEntrypointVersions;
private checkVersionHistoryMatch;
private getDbxPath;
private getDataboxWorkingDirectory;
private getExtractedDataboxPath;
private saveManifestMetadata;
}
export {};