import type { JsonValue } from '../control-plane';
import type { ConfigurationSecretBackend } from './backends';
import type { ConfigurationBackend, ConfigurationEntry, ConfigurationKind, ConfigurationMutationResult, ConfigurationScope } from './model';
import { parseDotenv } from './dotenv';
import { ConfigurationStore } from './store';
export interface ConfigurationMetadata {
    id: string;
    key: string;
    kind: ConfigurationKind;
    scope: ConfigurationScope;
    inherited: boolean;
    overridden: boolean;
    required: boolean;
    backend?: ConfigurationBackend;
    backendVersion?: string;
    reference?: string;
    lastUsedAt?: string;
    rotatedAt?: string;
    version: number;
    updatedAt: string;
    value?: string;
}
export interface ConfigurationWarning {
    key?: string;
    code: 'reserved' | 'limit' | 'missing_required' | 'stale_reference';
    message: string;
}
export interface ResolvedConfiguration {
    values: Record<string, string>;
    entries: Record<string, ConfigurationMetadata>;
    warnings: ConfigurationWarning[];
    configurationHash: string;
}
export interface SetConfigurationInput {
    organizationId: string;
    projectId: string;
    scope: ConfigurationScope;
    key: string;
    kind: ConfigurationKind;
    value?: string;
    reference?: string;
    backend?: Exclude<ConfigurationBackend, 'plaintext'>;
    required?: boolean;
    metadata?: Record<string, JsonValue>;
    expectedVersion?: number;
    confirmed?: boolean;
    idempotencyKey?: string;
    actorId?: string;
    origin?: ConfigurationEntry['origin'];
}
export interface ConfigurationPlan {
    added: string[];
    changed: string[];
    removed: string[];
    unchanged: string[];
    affectedResourceIds: string[];
    warnings: ConfigurationWarning[];
}
export declare class ConfigurationService {
    readonly store: ConfigurationStore;
    private readonly backends;
    private readonly fingerprintKey;
    private readonly now;
    constructor(store: ConfigurationStore, options: {
        encryptionKey: string;
        fingerprintKey?: string;
        backends?: ConfigurationSecretBackend[];
        now?: () => Date;
    });
    list(input: {
        projectId: string;
        scope?: ConfigurationScope;
        kind?: ConfigurationKind;
        search?: string;
        canReadSecretMetadata?: boolean;
    }): ConfigurationMetadata[];
    plan(input: {
        projectId: string;
        scope: ConfigurationScope;
        values: Record<string, string>;
        removeMissing?: boolean;
    }): ConfigurationPlan;
    set(input: SetConfigurationInput): Promise<{
        entry: ConfigurationEntry;
        mutation: ConfigurationMutationResult;
        warnings: ConfigurationWarning[];
    }>;
    importDotenv(input: Omit<SetConfigurationInput, 'key' | 'kind' | 'value'> & {
        source: string;
        secretKeys?: string[];
    }): Promise<{
        document: ReturnType<typeof parseDotenv>;
        mutation?: ConfigurationMutationResult;
        warnings: ConfigurationWarning[];
    }>;
    exportVariables(input: {
        projectId: string;
        scope: ConfigurationScope;
    }): string;
    transfer(input: {
        entryId: string;
        targetScope: ConfigurationScope;
        mode: 'copy' | 'move';
        confirmed?: boolean;
        actorId?: string;
        idempotencyKey?: string;
    }): Promise<{
        entry: ConfigurationEntry;
        mutation: ConfigurationMutationResult;
    }>;
    resolve(input: {
        projectId: string;
        environmentId?: string;
        resourceId?: string;
        functionId?: string;
        previewId?: string;
        trustedPreview?: boolean;
        allowedPreviewSecrets?: string[];
        nativeReferences?: boolean;
        canReadSecretMetadata?: boolean;
    }): Promise<ResolvedConfiguration>;
    reveal(input: {
        entryId: string;
        canRevealSecrets: boolean;
        recentlyAuthenticated: boolean;
        actorId?: string;
    }): Promise<string>;
    remove(input: {
        entryId: string;
        expectedVersion: number;
        confirmed?: boolean;
        actorId?: string;
    }): Promise<ConfigurationMutationResult>;
    private applies;
    private rank;
    private fingerprint;
    private requestHash;
    private backend;
    private backendName;
    private isProduction;
    private warnings;
    private affectedResources;
    private audit;
}
