import { Compose } from "./compose.js"; import { Manifest, PrometheusTarget, GrafanaDashboard } from "./manifest.js"; import { SetupWizard } from "./setupWizard.js"; /** * ========= * CONTAINER * ========= */ export type ContainerState = "created" | "restarting" | "running" | "paused" | "exited" | "dead" | "removing"; export interface ContainerStatus { targetStatus: "stopped" | "running"; dockerTimeout: number | undefined; } export interface ContainersStatus { [serviceName: string]: ContainerStatus; } /** * PKG release assets */ export type InstallPackageDataPaths = Pick; export interface InstallPackageData extends PackageRelease { isUpdate: boolean; imagePath: string; composePath: string; composeBackupPath: string; manifestPath: string; manifestBackupPath: string; compose: Compose; fileUploads?: { [serviceName: string]: { [containerPath: string]: string; }; }; dockerTimeout: number | undefined; containersStatus: ContainersStatus; } export interface ReleaseWarnings { /** * If a core package does not come from the DAppNode Package APM registry */ coreFromForeignRegistry?: boolean; /** * If the requested name does not match the manifest name */ requestNameMismatch?: boolean; } export interface PackageRelease extends DirectoryFiles { dnpName: string; reqVersion: string; semVersion: string; imageFile: DistributedFile; avatarFile?: DistributedFile; warnings: ReleaseWarnings; isCore: boolean; origin?: string; /** Release is from safe origin OR has trusted signature */ signedSafe: boolean; signatureStatus: ReleaseSignatureStatus; } export type DirectoryFiles = { manifest: Manifest; compose: Compose; signature?: ReleaseSignature; setupWizard?: SetupWizard; disclaimer?: string; gettingStarted?: string; prometheusTargets?: PrometheusTarget[]; grafanaDashboards?: GrafanaDashboard[]; }; export interface FileConfig { regex: RegExp; format: FileFormat; maxSize: number; required: boolean; multiple: boolean; } export interface ReleasePkgAssets extends DirectoryFiles { imageFile: DistributedFile; avatarFile?: DistributedFile; } export declare enum FileFormat { JSON = "JSON", YAML = "YAML", TEXT = "TEXT" } /** * ========== * SIGNATURES * ========== */ export interface ReleaseSignature { /** Version of the ReleaseSignature format */ version: 1; /** Specs of the signed CIDs */ cid: { version: 0 | 1; base: "base58btc" | "base32" | "base64" | "base64url"; }; signature_protocol: ReleaseSignatureProtocol; /** * Signature of the serialized files in the directory * ``` * 0x71b61418808a85c495f52bc9c781cbfeb0154c86aec8528c6cf7a83a26a0365f7ac4dea4eea7eea5e4ec14a10e01d8b8708d8c0c7c12420d152a272b69092b851b * ``` */ signature: string; } export declare enum ReleaseSignatureStatusCode { notSigned = "notSigned", signedByKnownKey = "signedByKnownKey", signedByUnknownKey = "signedByUnknownKey" } export type ReleaseSignatureStatus = { status: ReleaseSignatureStatusCode.notSigned; } | { status: ReleaseSignatureStatusCode.signedByKnownKey; keyName: string; } | { status: ReleaseSignatureStatusCode.signedByUnknownKey; signatureProtocol: string; key: string; }; export type ReleaseSignatureWithData = { signature: ReleaseSignature; signedData: string; }; /** TODO: Add RSA_2048, OpenPGP */ export type ReleaseSignatureProtocol = "ECDSA_256"; export declare const releaseSignatureProtocols: ReleaseSignatureProtocol[]; export interface TrustedReleaseKey { /** Metadata name to identify this key: `DAppnode association` */ name: string; signatureProtocol: ReleaseSignatureProtocol; /** `.dnp.dappnode.eth` */ dnpNameSuffix: string; /** `0x14791697260E4c9A71f18484C9f997B308e59325` */ key: string; } type DistributedFileSource = "ipfs" | "swarm"; interface DistributedFile { hash: string; source: DistributedFileSource; size: number; } /** * APM version */ export interface PackageRequest { name: string; ver: string; req?: string; } export declare const defaultArch: "linux/amd64"; export {}; //# sourceMappingURL=pkg.d.ts.map