import { ResolverBase } from "../generic/ResolverBase.js";
import { AppContext } from "../types.js";
declare class ExternalObjectOutput {
    Name: string;
    Label: string;
    SupportsIncrementalSync: boolean;
    SupportsWrite: boolean;
}
declare class DiscoverObjectsOutput {
    Success: boolean;
    Message: string;
    Objects?: ExternalObjectOutput[];
}
declare class ExternalFieldOutput {
    Name: string;
    Label: string;
    DataType: string;
    IsRequired: boolean;
    IsUniqueKey: boolean;
    IsReadOnly: boolean;
}
declare class DiscoverFieldsOutput {
    Success: boolean;
    Message: string;
    Fields?: ExternalFieldOutput[];
}
declare class ConnectionTestOutput {
    Success: boolean;
    Message: string;
    ServerVersion?: string;
}
declare class PreviewRecordOutput {
    Data: string;
}
declare class PreviewDataOutput {
    Success: boolean;
    Message: string;
    Records?: PreviewRecordOutput[];
}
declare class SchemaPreviewObjectInput {
    SourceObjectName: string;
    SchemaName: string;
    TableName: string;
    EntityName: string;
}
declare class SchemaPreviewFileOutput {
    FilePath: string;
    Content: string;
    Description: string;
}
declare class SchemaPreviewOutput {
    Success: boolean;
    Message: string;
    Files?: SchemaPreviewFileOutput[];
    Warnings?: string[];
}
declare class DefaultFieldMappingOutput {
    SourceFieldName: string;
    DestinationFieldName: string;
    IsKeyField?: boolean;
}
declare class DefaultObjectConfigOutput {
    SourceObjectName: string;
    TargetTableName: string;
    TargetEntityName: string;
    SyncEnabled: boolean;
    FieldMappings: DefaultFieldMappingOutput[];
}
declare class DefaultConfigOutput {
    Success: boolean;
    Message: string;
    DefaultSchemaName?: string;
    DefaultObjects?: DefaultObjectConfigOutput[];
}
/**
 * GraphQL resolver for integration discovery operations.
 * Provides endpoints to test connections, discover objects, and discover fields
 * on external systems via their registered connectors.
 */
export declare class IntegrationDiscoveryResolver extends ResolverBase {
    /**
     * Discovers available objects/tables in the external system.
     */
    IntegrationDiscoverObjects(companyIntegrationID: string, ctx: AppContext): Promise<DiscoverObjectsOutput>;
    /**
     * Discovers fields on a specific external object.
     */
    IntegrationDiscoverFields(companyIntegrationID: string, objectName: string, ctx: AppContext): Promise<DiscoverFieldsOutput>;
    /**
     * Tests connectivity to the external system.
     */
    IntegrationTestConnection(companyIntegrationID: string, ctx: AppContext): Promise<ConnectionTestOutput>;
    /**
     * Returns the connector's default configuration for quick setup.
     * Not all connectors provide defaults — returns Success: false if unavailable.
     */
    IntegrationGetDefaultConfig(companyIntegrationID: string, ctx: AppContext): Promise<DefaultConfigOutput>;
    /**
     * Generates a DDL preview for creating tables from discovered external objects.
     * Introspects the source schema and runs SchemaBuilder to produce migration SQL.
     */
    IntegrationSchemaPreview(companyIntegrationID: string, objects: SchemaPreviewObjectInput[], platform: string, ctx: AppContext): Promise<SchemaPreviewOutput>;
    /**
     * Fetches a small sample of records from an external object for preview purposes.
     * Uses the connector's FetchChanges with a small batch size and no watermark.
     */
    IntegrationPreviewData(companyIntegrationID: string, objectName: string, limit: number, ctx: AppContext): Promise<PreviewDataOutput>;
    private buildTargetConfigs;
    private getAuthenticatedUser;
    /**
     * Loads the CompanyIntegration + its parent Integration, then resolves the
     * appropriate connector via ConnectorFactory.
     *
     * NOTE: Entity objects loaded here come from the MJServer's copy of core-entities.
     * The integration-engine package may resolve its own copy of core-entities, causing
     * TypeScript nominal type mismatches. At runtime the objects are structurally identical,
     * so we cast through `unknown` at the boundary calls.
     */
    private resolveConnector;
    private handleDiscoveryError;
}
export {};
//# sourceMappingURL=IntegrationDiscoveryResolver.d.ts.map