import * as plugins from '../plugins.js';
import type { OneboxDatabase } from './index.js';
import type { IBackup, IBackupSchedule, ICertificate, ICertRequirement, IDnsRecord, IDomain, IHostedAppLifecycleRecord, IHostedAppLifecycleState, ILogEntry, IMetric, IPlatformResource, IPlatformService, IRegistry, IRegistryToken, IRetentionPolicy, IService, IServiceSecretBundleRecord, IServicePublishedPort, IServiceVolume, ISslCertificate, IStorageClass, IStorageTarget, IUser, TBackupScheduleScope, TPlatformResourceType, TPlatformServiceStatus, TPlatformServiceType, TStorageClassPurpose, TStorageTargetKind } from '../types.js';
export declare abstract class OneboxDataDoc<TDoc extends TData, TData> extends plugins.smartdata.SmartDataDbDoc<TDoc, TData, OneboxDatabase> {
    constructor();
    private createApiDataObject;
    toData(): TData;
    toJSON(): TData;
}
export interface IMetadataRecord {
    key: string;
    value: string;
    updatedAt: number;
}
export interface ISettingRecord {
    key: string;
    value: string;
    updatedAt: number;
}
export interface ISecretSettingRecord {
    key: string;
    value: string;
    updatedAt: number;
}
export type TDnsRecordWithZone = IDnsRecord & {
    zoneID?: string;
};
export declare class MetadataDoc extends OneboxDataDoc<MetadataDoc, IMetadataRecord> implements IMetadataRecord {
    key: string;
    value: string;
    updatedAt: number;
}
export declare class ServiceDoc extends OneboxDataDoc<ServiceDoc, IService> implements IService {
    id: number;
    name: string;
    image: string;
    registry?: string;
    envVars: Record<string, string>;
    containerArgs?: string[];
    secretFiles?: IService['secretFiles'];
    volumes?: IServiceVolume[];
    publishedPorts?: IServicePublishedPort[];
    targetPorts?: IService['targetPorts'];
    domains?: IService['domains'];
    publicPortMappings?: IService['publicPortMappings'];
    port: number;
    domain?: string;
    containerID?: string;
    status: IService['status'];
    createdAt: number;
    updatedAt: number;
    useOneboxRegistry?: boolean;
    registryRepository?: string;
    registryImageTag?: string;
    autoUpdateOnPush?: boolean;
    imageDigest?: string;
    imageCleanup?: IService['imageCleanup'];
    platformRequirements?: IService['platformRequirements'];
    includeImageInBackup?: boolean;
    appTemplateId?: string;
    appTemplateVersion?: string;
}
export declare class HostedAppLifecycleDoc extends OneboxDataDoc<HostedAppLifecycleDoc, IHostedAppLifecycleRecord> implements IHostedAppLifecycleRecord {
    id: number;
    serviceId: number;
    appInstanceId: string;
    hostType: 'onebox';
    state: IHostedAppLifecycleState;
    createdAt: number;
    updatedAt: number;
}
export declare class ServiceSecretBundleDoc extends OneboxDataDoc<ServiceSecretBundleDoc, IServiceSecretBundleRecord> implements IServiceSecretBundleRecord {
    serviceId: number;
    valuesEncrypted: string;
    createdAt: number;
    updatedAt: number;
}
export declare class RegistryDoc extends OneboxDataDoc<RegistryDoc, IRegistry> implements IRegistry {
    id: number;
    url: string;
    username: string;
    passwordEncrypted: string;
    createdAt: number;
}
export declare class RegistryTokenDoc extends OneboxDataDoc<RegistryTokenDoc, IRegistryToken> implements IRegistryToken {
    id: number;
    name: string;
    tokenHash: string;
    type: 'global' | 'ci';
    scope: 'all' | string[];
    expiresAt: number | null;
    createdAt: number;
    lastUsedAt: number | null;
    createdBy: string;
}
export declare class StorageTargetDoc extends OneboxDataDoc<StorageTargetDoc, IStorageTarget> implements IStorageTarget {
    id: number;
    name: string;
    displayName: string;
    kind: TStorageTargetKind;
    config: IStorageTarget['config'];
    createdAt: number;
    updatedAt: number;
}
export declare class StorageClassDoc extends OneboxDataDoc<StorageClassDoc, IStorageClass> implements IStorageClass {
    id: number;
    name: string;
    displayName: string;
    description?: string;
    targetName: string;
    purpose: TStorageClassPurpose;
    isDefault?: boolean;
    driver?: string;
    options?: Record<string, string>;
    createdAt: number;
    updatedAt: number;
}
export declare class SettingDoc extends OneboxDataDoc<SettingDoc, ISettingRecord> implements ISettingRecord {
    key: string;
    value: string;
    updatedAt: number;
}
export declare class SecretSettingDoc extends OneboxDataDoc<SecretSettingDoc, ISecretSettingRecord> implements ISecretSettingRecord {
    key: string;
    value: string;
    updatedAt: number;
}
export declare class UserDoc extends OneboxDataDoc<UserDoc, IUser> implements IUser {
    id: number;
    username: string;
    webauthnUserId: string;
    passkeyCredentials: IUser['passkeyCredentials'];
    role: 'admin' | 'user';
    createdAt: number;
    updatedAt: number;
}
export declare class MetricDoc extends OneboxDataDoc<MetricDoc, IMetric> implements IMetric {
    id: number;
    serviceId: number;
    timestamp: number;
    cpuPercent: number;
    memoryUsed: number;
    memoryLimit: number;
    networkRxBytes: number;
    networkTxBytes: number;
}
export declare class LogEntryDoc extends OneboxDataDoc<LogEntryDoc, ILogEntry> implements ILogEntry {
    id: number;
    serviceId: number;
    timestamp: number;
    message: string;
    level: 'info' | 'warn' | 'error' | 'debug';
    source: 'stdout' | 'stderr';
}
export declare class DomainDoc extends OneboxDataDoc<DomainDoc, IDomain> implements IDomain {
    id: number;
    domain: string;
    dnsProvider: 'cloudflare' | 'manual' | 'dcrouter' | null;
    cloudflareZoneId?: string;
    isObsolete: boolean;
    defaultWildcard: boolean;
    createdAt: number;
    updatedAt: number;
}
export declare class CertificateDoc extends OneboxDataDoc<CertificateDoc, ICertificate> implements ICertificate {
    id: number;
    domainId: number;
    certDomain: string;
    isWildcard: boolean;
    certPem: string;
    keyPem: string;
    fullchainPem: string;
    expiryDate: number;
    issuer: string;
    isValid: boolean;
    createdAt: number;
    updatedAt: number;
}
export declare class CertRequirementDoc extends OneboxDataDoc<CertRequirementDoc, ICertRequirement> implements ICertRequirement {
    id: number;
    serviceId: number;
    domainId: number;
    subdomain: string;
    certificateId?: number;
    status: 'pending' | 'active' | 'renewing';
    createdAt: number;
    updatedAt: number;
}
export declare class DnsRecordDoc extends OneboxDataDoc<DnsRecordDoc, TDnsRecordWithZone> implements TDnsRecordWithZone {
    id: number;
    domain: string;
    type: 'A' | 'AAAA' | 'CNAME';
    value: string;
    cloudflareID?: string;
    zoneID?: string;
    createdAt: number;
    updatedAt: number;
}
export declare class PlatformServiceDoc extends OneboxDataDoc<PlatformServiceDoc, IPlatformService> implements IPlatformService {
    id: number;
    name: string;
    type: TPlatformServiceType;
    status: TPlatformServiceStatus;
    containerId?: string;
    config: IPlatformService['config'];
    adminCredentialsEncrypted?: string;
    createdAt: number;
    updatedAt: number;
}
export declare class PlatformResourceDoc extends OneboxDataDoc<PlatformResourceDoc, IPlatformResource> implements IPlatformResource {
    id: number;
    platformServiceId: number;
    serviceId: number;
    resourceType: TPlatformResourceType;
    resourceName: string;
    credentialsEncrypted: string;
    createdAt: number;
}
export declare class BackupDoc extends OneboxDataDoc<BackupDoc, IBackup> implements IBackup {
    id: number;
    serviceId: number;
    serviceName: string;
    filename: string;
    snapshotId?: string;
    sizeBytes: number;
    storedSizeBytes?: number;
    createdAt: number;
    includesImage: boolean;
    platformResources: TPlatformServiceType[];
    checksum: string;
    scheduleId?: number;
}
export declare class BackupScheduleDoc extends OneboxDataDoc<BackupScheduleDoc, IBackupSchedule> implements IBackupSchedule {
    id: number;
    scopeType: TBackupScheduleScope;
    scopePattern?: string;
    serviceId?: number;
    serviceName?: string;
    cronExpression: string;
    retention: IRetentionPolicy;
    enabled: boolean;
    lastRunAt: number | null;
    nextRunAt: number | null;
    lastStatus: 'success' | 'failed' | null;
    lastError: string | null;
    createdAt: number;
    updatedAt: number;
}
export declare const sslCertificateFromCertificateDoc: (docArg: CertificateDoc) => ISslCertificate;
