import { Observable } from 'rxjs'; import { ValtechAuthConfig } from '../auth/types'; import type { FirestoreDocument } from '../firebase/types'; import * as i0 from "@angular/core"; export type WorkflowStatus = 'RUNNING' | 'SUCCEEDED' | 'FAILED' | 'TIMED_OUT' | 'ABORTED'; /** Respuesta al arrancar un workflow (ADR-045). */ export interface WorkflowStartResult { operationId: string; workflow: string; executionName: string; executionArn: string; status: 'RUNNING'; } /** * Estado de una ejecución de workflow proyectado a Firestore por el admin Lambda * (apps/{appId}/orgs/{orgId}/workflows/{executionName}). Lo observa watch(). */ export interface WorkflowExecution extends FirestoreDocument { name: string; workflow: string; executionArn: string; status: WorkflowStatus; appId: string; orgId: string; startedAt?: string; stoppedAt?: string; } /** Estado por-paso de una ejecución (vista "en acción"). */ export interface WorkflowStep { name: string; status: 'pending' | 'running' | 'succeeded' | 'failed'; retries: number; } /** Resumen del historial de una ejecución. */ export interface WorkflowHistory { status: WorkflowStatus; steps: WorkflowStep[]; } /** * WorkflowService (ADR-045) — arranca state machines de Step Functions registradas * y observa su ejecución en tiempo real (Firestore). Reusable por cualquier app. * * - start(name, input): dispara `POST /workflows/{name}/start` (el JWT lo inyecta * el authInterceptor; orgId/appId se resuelven en el backend desde el contexto). * - watch(executionName): onSnapshot del doc de estado, hasta SUCCEEDED/FAILED. */ export declare class WorkflowService { private config; private http; private auth; private collections; constructor(config: ValtechAuthConfig | null); private get appIdHeader(); start(name: string, input?: Record): Observable; /** Resumen por-paso del historial de una ejecución (para mostrar el progreso). */ history(executionArn: string): Observable; watch(executionName: string): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }