/*!
 * Copyright (C) Microsoft Corporation. All rights reserved.
 */
import type { ConnectionReference, ShareLinkDetails } from '../Config/Config.types.js';
import type { FlowConnectionReferenceResponse } from '../services/powerAutomateRp/PowerAutomateRpService.types.js';
export interface TabularMetadata {
    dataset: string;
    resourceName: string;
    isProcedure: boolean;
    friendlyName?: string;
    datasetOverride?: string;
    resourceNameOverride?: string;
}
/**
 * Upserts a connection reference in the provided collection.
 * @param connectionReferences - The collection of connection references.
 * @param params - Parameters for the connection reference.
 * @param params.apiId - The API ID of the connection.
 * @param params.displayName - The display name of the connection.
 * @param params.dataSourceName - The name of the data source.
 * @param params.authenticationType - The authentication type of the connection (optional).
 * @param params.sharedConnectionId - The shared connection ID (optional).
 * @param params.dataverseDataSourceNames - The names of the Dataverse data sources (optional).
 * @returns The disambiguated data source name.
 */
export declare function upsertConnectionReference(connectionReferences: Record<string, ConnectionReference>, params: {
    apiId: string;
    apiName: string;
    connectorDisplayName: string;
    tabularMetadata?: TabularMetadata;
    authenticationType?: string;
    sharedConnectionId?: string;
    dataverseDataSourceNames?: string[];
    connectionReferenceLogicalName?: string;
    dataSourceShareLink?: ShareLinkDetails;
    siteId?: string;
}): {
    dataSourceName: string;
    spEntity?: string;
};
export declare function getExistingCdpNames(connectionReferences: Record<string, ConnectionReference>, exclusions?: {
    apiId: string;
    datasetName?: string;
}): string[];
/**
 * A flow connection reference enriched with connection-level details fetched separately.
 */
export type EnrichedFlowDependency = FlowConnectionReferenceResponse & {
    authenticationType?: string;
    sharedConnectionId?: string;
};
/**
 * Upserts connection references for a flow and its connector dependencies.
 *
 * Creates or updates:
 * - A `shared_logicflows` connection reference for the flow itself (with `workflowDetails`).
 * - A connection reference for each connector the flow depends on, including
 *   `authenticationType`, `sharedConnectionId`, and `xrmConnectionReferenceLogicalName`.
 *
 * Existing entries are matched by `workflowEntityId` (for the flow) or by connector `id`
 * (for dependencies), so re-adding the same flow is idempotent.
 */
export declare function upsertFlowConnectionReferences(connectionReferences: Record<string, ConnectionReference>, params: {
    flowDisplayName: string;
    workflowEntityId: string;
    flowDependencies: Record<string, EnrichedFlowDependency>;
    workflowName: string;
}): void;
//# sourceMappingURL=connectionReferences.d.ts.map