import type { JsonValue } from '../control-plane';
import type { QueueExecutionContext, QueueOperationHandler } from '../queue';
import type { DataAction, DataEndpoint, DataService, DataServicePlan } from './model';
import { DurableOperationQueue } from '../queue';
import { DataServiceStore } from './store';
export interface SecretBackend {
    put(reference: string, value: string): Promise<void>;
    resolve(reference: string): Promise<string>;
    remove(reference: string): Promise<void>;
}
export interface DataServiceAdapter {
    provider: DataService['provider'];
    engines: DataService['engine'][];
    observe(service: DataService): Promise<Record<string, JsonValue>>;
    apply(service: DataService, credential?: string, context?: QueueExecutionContext): Promise<Record<string, JsonValue>>;
    action(service: DataService, action: DataAction, input: Record<string, JsonValue>, credential: string | undefined, context: QueueExecutionContext): Promise<Record<string, JsonValue>>;
}
export interface OneTimeCredential {
    username: string;
    password: string;
    secretRef: string;
}
export declare function connectionGuidance(service: DataService, endpoints: DataEndpoint[]): Array<{
    type: string;
    command: string;
    secretRef?: string;
}>;
export declare class DataServiceLifecycle {
    readonly store: DataServiceStore;
    readonly queue: DurableOperationQueue;
    readonly secrets: SecretBackend;
    constructor(store: DataServiceStore, queue: DurableOperationQueue, secrets: SecretBackend);
    create(input: Omit<DataService, 'id' | 'capabilities' | 'credentialRef' | 'version' | 'createdAt' | 'updatedAt' | 'status'> & {
        username?: string;
    }): Promise<{
        service: DataService;
        credential?: OneTimeCredential;
        operationId: string;
    }>;
    plan(service: DataService, action: DataAction, changes?: Record<string, JsonValue>): DataServicePlan;
    enqueue(service: DataService, action: DataAction, input: Record<string, JsonValue>, actorId?: string): string;
    rotate(service: DataService, adapter: DataServiceAdapter, context: QueueExecutionContext): Promise<{
        credential: OneTimeCredential;
        dependencies: string[];
    }>;
}
export declare function createDataServiceQueueHandlers(input: {
    store: DataServiceStore;
    secrets: SecretBackend;
    resolveAdapter: (service: DataService) => DataServiceAdapter | undefined;
}): Record<string, QueueOperationHandler>;
