import type { RailDeckDirectIntegrationClient as Client } from '@raildeck/frontend-sdk/direct-integration'; /** * Read a saved layout and its lifecycle before presenting editing choices. * @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 signal - Caller-owned cancellation signal. * @returns The selected record and lifecycle; later writes require a separate decision. */ export async function prepareLayoutReview( client: Client, accountId: string, layoutId: string, signal: AbortSignal, ) { const options = { signal, timeoutMs: 15_000 }; const layout = await client.layouts.get(accountId, layoutId, options); const lifecycle = await client.layouts.getLifecycle(accountId, layoutId, options); return { layout, lifecycle }; }