import type { EntityTableSpec, ClientValidationResult, EntityPipelineResult, EntityDescribeResult } from '../database-designer.types.js';
import * as i0 from "@angular/core";
export interface CreateEntityOptions {
    skipGitCommit?: boolean;
    skipRestart?: boolean;
}
export interface ModifyEntityOptions extends CreateEntityOptions {
    /** ID of the existing entity being modified. */
    existingEntityId: string;
}
export declare class DatabaseDesignerService {
    /**
     * Lazily-created action client.  Re-uses `GraphQLDataProvider.Instance` so the
     * singleton provider (and its auth headers) are shared across all invocations.
     */
    private _actionClient;
    private getActionClient;
    /**
     * Cache maps action name → Promise<ID>.  Storing a Promise (not a resolved ID)
     * prevents duplicate in-flight lookups when two callers await the same name
     * before the first resolves.
     */
    private readonly _actionIdCache;
    private resolveActionId;
    private fetchActionId;
    /**
     * Create a new MemberJunction entity from a `EntityTableSpec`.
     * Calls the `Create Entity` action on the server which runs the full RSU pipeline.
     */
    createEntity(tableSpec: EntityTableSpec, options?: CreateEntityOptions): Promise<EntityPipelineResult>;
    /**
     * Modify an existing MemberJunction entity.
     * Calls the `Modify Entity` action on the server.
     */
    modifyEntity(tableSpec: EntityTableSpec, options: ModifyEntityOptions): Promise<EntityPipelineResult>;
    /**
     * Validate a `EntityTableSpec` without executing the pipeline.
     * Used by Step 4 (Review) of the wizard to surface errors before the user submits.
     *
     * Note: `ActionResult.Success` is `true` even when `ValidationResult.Valid` is `false`
     * because the action itself succeeded — validation failure is a business outcome, not
     * an infrastructure error.
     */
    validateEntitySchema(tableSpec: EntityTableSpec, modificationType?: 'create' | 'alter'): Promise<ClientValidationResult>;
    /**
     * Load detailed metadata for an existing entity.
     * Used by the entity list slide panel and the modify wizard entry point.
     */
    describeEntity(entityId: string): Promise<EntityDescribeResult>;
    private buildPipelineParams;
    /**
     * Extract server output params from a `RunAction` result.
     *
     * ### Why `result.Result`, not `result.Params`?
     * `ActionResolver.createActionResult` on the server serializes all Output/Both typed
     * params into a JSON string stored in `ResultData`.  `GraphQLActionClient` parses that
     * JSON and stores the resulting array in `result.Result`.  The `result.Params` field
     * contains only the *input* params passed by the caller — the server's output params
     * are never included there.
     *
     * This helper centralizes the cast so no caller ever needs to understand this transport
     * contract directly.
     */
    private extractOutputParams;
    /**
     * Map a completed `ActionResult` to an `EntityPipelineResult`.
     *
     * Two failure modes are distinguished:
     *  - `result.Success === false`: infrastructure failure (auth, pipeline exception) → hard error
     *  - `result.Success === true` but `EntityID` missing: pipeline ran but ID unconfirmed →
     *    soft warning so the UI can surface guidance without blocking the user
     */
    private extractPipelineResult;
    private errorMessage;
    static ɵfac: i0.ɵɵFactoryDeclaration<DatabaseDesignerService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<DatabaseDesignerService>;
}
//# sourceMappingURL=database-designer.service.d.ts.map