import type { ApiTokenPrincipal, AutomationIdentityStore } from '../automation';
import type { AuthorizationCapability, AuthorizationScope, AuthorizationTarget, ControlPlaneOperation, ControlPlaneStore } from '../control-plane';
import type { ApiDeploymentRequest } from './types';
export declare class ApiServiceError extends Error {
    readonly code: string;
    readonly status: number;
    readonly details?: Record<string, unknown> | undefined;
    constructor(code: string, message: string, status: number, details?: Record<string, unknown> | undefined);
}
export declare function requestHash(method: string, pathname: string, body: unknown): string;
export declare class AutomationApiService {
    private readonly controlPlane;
    private readonly identities;
    private readonly queue;
    constructor(controlPlane: ControlPlaneStore, identities: AutomationIdentityStore);
    target(principal: ApiTokenPrincipal, requested: AuthorizationScope): AuthorizationTarget;
    authorize(principal: ApiTokenPrincipal, capability: AuthorizationCapability, requested: AuthorizationScope): AuthorizationTarget;
    listProjects(principal: ApiTokenPrincipal): Array<Record<string, unknown>>;
    listEnvironments(principal: ApiTokenPrincipal, projectId: string): Array<Record<string, unknown>>;
    listServices(principal: ApiTokenPrincipal, projectId: string, environmentId?: string): Array<Record<string, unknown>>;
    listOperations(principal: ApiTokenPrincipal, projectId?: string): Array<Record<string, unknown>>;
    listEvents(principal: ApiTokenPrincipal, projectId?: string, afterSequence?: number): Array<Record<string, unknown>>;
    createDeployment(principal: ApiTokenPrincipal, input: ApiDeploymentRequest, idempotencyKey: string): {
        operation: Record<string, unknown>;
        replay: boolean;
    };
    operation(operation: ControlPlaneOperation): Record<string, unknown>;
}
