import type { Logger } from '@b64hub/sfpm-core'; import type { Connection } from '@salesforce/core'; import type { FlowActivationHooksOptions, PackageFlowEntry } from './types.js'; /** * Activates or deactivates flows in a Salesforce org to match the * intended status declared in the package source. * * For each flow in the package: * - **Active** in source → activate the latest version in the org * (unless it is already active and `skipAlreadyActive` is set). * - **Draft / Obsolete / InvalidDraft** in source → deactivate in the org. * * Activation is performed by setting `FlowDefinition.Metadata.activeVersionNumber` * to the latest version number via the Tooling API. Deactivation sets it to `0`. */ export declare class FlowActivator { private readonly connection; private readonly options?; private readonly logger?; private readonly skipAlreadyActive; constructor(connection: Connection, options?: FlowActivationHooksOptions | undefined, logger?: Logger | undefined); /** * Process all flows — activate or deactivate each one to match its * intended source status. * * @returns Summary counts of activated and deactivated flows. */ processFlows(entries: PackageFlowEntry[]): Promise<{ activated: number; deactivated: number; }>; /** * Activate the latest version of a flow in the org. * * Queries `FlowDefinition` to compare the active and latest version * numbers. If the latest version is newer (or nothing is active), the * flow is activated via a Tooling API update. */ private activateFlow; /** * Deactivate a flow in the org by clearing its active version number. */ private deactivateFlow; /** * Query a single `FlowDefinition` from the org by developer name. */ private queryFlowDefinition; /** * Set the active version of a `FlowDefinition` via the Tooling API. * * @param id - The `FlowDefinition` Tooling API record Id * @param developerName - Used for logging / error messages * @param versionNumber - Version number to activate, or `''` to deactivate */ private setActiveVersion; }