valtech-components 4.0.246 → 4.0.248
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/components/molecules/chat-composer/chat-composer.component.mjs +4 -2
- package/esm2022/lib/services/workflows/workflow.service.mjs +54 -0
- package/esm2022/lib/version.mjs +2 -2
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/valtech-components.mjs +52 -3
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/services/workflows/workflow.service.d.ts +47 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { ValtechAuthConfig } from '../auth/types';
|
|
3
|
+
import type { FirestoreDocument } from '../firebase/types';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export type WorkflowStatus = 'RUNNING' | 'SUCCEEDED' | 'FAILED' | 'TIMED_OUT' | 'ABORTED';
|
|
6
|
+
/** Respuesta al arrancar un workflow (ADR-045). */
|
|
7
|
+
export interface WorkflowStartResult {
|
|
8
|
+
operationId: string;
|
|
9
|
+
workflow: string;
|
|
10
|
+
executionName: string;
|
|
11
|
+
executionArn: string;
|
|
12
|
+
status: 'RUNNING';
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Estado de una ejecución de workflow proyectado a Firestore por el admin Lambda
|
|
16
|
+
* (apps/{appId}/orgs/{orgId}/workflows/{executionName}). Lo observa watch().
|
|
17
|
+
*/
|
|
18
|
+
export interface WorkflowExecution extends FirestoreDocument {
|
|
19
|
+
name: string;
|
|
20
|
+
workflow: string;
|
|
21
|
+
executionArn: string;
|
|
22
|
+
status: WorkflowStatus;
|
|
23
|
+
appId: string;
|
|
24
|
+
orgId: string;
|
|
25
|
+
startedAt?: string;
|
|
26
|
+
stoppedAt?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* WorkflowService (ADR-045) — arranca state machines de Step Functions registradas
|
|
30
|
+
* y observa su ejecución en tiempo real (Firestore). Reusable por cualquier app.
|
|
31
|
+
*
|
|
32
|
+
* - start(name, input): dispara `POST /workflows/{name}/start` (el JWT lo inyecta
|
|
33
|
+
* el authInterceptor; orgId/appId se resuelven en el backend desde el contexto).
|
|
34
|
+
* - watch(executionName): onSnapshot del doc de estado, hasta SUCCEEDED/FAILED.
|
|
35
|
+
*/
|
|
36
|
+
export declare class WorkflowService {
|
|
37
|
+
private config;
|
|
38
|
+
private http;
|
|
39
|
+
private auth;
|
|
40
|
+
private collections;
|
|
41
|
+
constructor(config: ValtechAuthConfig | null);
|
|
42
|
+
private get appIdHeader();
|
|
43
|
+
start(name: string, input?: Record<string, unknown>): Observable<WorkflowStartResult>;
|
|
44
|
+
watch(executionName: string): Observable<WorkflowExecution | null>;
|
|
45
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WorkflowService, [{ optional: true; }]>;
|
|
46
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<WorkflowService>;
|
|
47
|
+
}
|
package/lib/version.d.ts
CHANGED
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -356,6 +356,7 @@ export * from './lib/services/download.service';
|
|
|
356
356
|
export * from './lib/services/pdf/pdf.service';
|
|
357
357
|
export * from './lib/services/pdf/types';
|
|
358
358
|
export * from './lib/services/events/meta';
|
|
359
|
+
export * from './lib/services/workflows/workflow.service';
|
|
359
360
|
export * from './lib/services/icons.service';
|
|
360
361
|
export * from './lib/services/in-app-browser.service';
|
|
361
362
|
export * from './lib/services/link-processor.service';
|