import type { RailDeckDirectIntegrationClient as Client } from '@raildeck/frontend-sdk/direct-integration'; /** * Read the selected route and analyse its current activation consequences. * @param client - Configured client; the caller owns current authority. * @param accountId - Authorised account for this workflow. * @param layoutId - Explicitly selected layout within the account. * @param routeId - Saved route chosen for review. * @param signal - Caller-owned cancellation signal. * @returns A definition and advisory analysis for an explicit operator decision. */ export async function prepareRouteActivation( client: Client, accountId: string, layoutId: string, routeId: string, signal: AbortSignal, ) { const options = { signal, timeoutMs: 15_000 }; const route = await client.routes.get(accountId, layoutId, routeId, options); const analysis = await client.routes.analyseActivation(accountId, layoutId, routeId); return { route, analysis }; } /** * Submit the original activation intent only after its explicit confirmation. * @param client - Configured client; the caller owns current authority. * @param accountId - Authorised account for this workflow. * @param layoutId - Explicitly selected layout within the account. * @param routeId - Saved route chosen for review. * @param reviewed - Original reviewed command, including its request identity and revision. * @param signal - Caller-owned cancellation signal. * @returns The correlated receipt; no automatic retry, fresh revision or replacement intent. */ export async function activateReviewedRoute( client: Client, accountId: string, layoutId: string, routeId: string, reviewed: Parameters[3], signal: AbortSignal, ) { return client.routes.activate(accountId, layoutId, routeId, reviewed, { signal, timeoutMs: 15_000, }); }