@centrali-io/centrali-sdk 3.1.0 → 3.1.2

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/dist/index.js CHANGED
@@ -203,6 +203,13 @@ class RealtimeManager {
203
203
  if (options.functionId) {
204
204
  url.searchParams.set('functionId', options.functionId);
205
205
  }
206
+ // Add orchestration filters
207
+ if (options.orchestrationId) {
208
+ url.searchParams.set('orchestrationId', options.orchestrationId);
209
+ }
210
+ if (options.runId) {
211
+ url.searchParams.set('runId', options.runId);
212
+ }
206
213
  // Create EventSource (uses polyfill in Node.js)
207
214
  eventSource = new EventSourceImpl(url.toString());
208
215
  // Handle connection open
package/index.ts CHANGED
@@ -38,11 +38,16 @@ export type AnomalyEventType = 'anomaly_insight_created' | 'anomaly_detection_co
38
38
  */
39
39
  export type ComputeEventType = 'function_run_completed' | 'function_run_failed';
40
40
 
41
+ /**
42
+ * Orchestration run event types emitted by the realtime service.
43
+ */
44
+ export type OrchestrationEventType = 'orchestration_run_started' | 'orchestration_run_completed' | 'orchestration_run_failed';
45
+
41
46
  /**
42
47
  * All event types emitted by the realtime service.
43
48
  * Matches: services/backend/realtime/internal/redis/message.go
44
49
  */
45
- export type RealtimeEventType = RecordEventType | ValidationEventType | AnomalyEventType | ComputeEventType;
50
+ export type RealtimeEventType = RecordEventType | ValidationEventType | AnomalyEventType | ComputeEventType | OrchestrationEventType;
46
51
 
47
52
  /**
48
53
  * Record event payload from the realtime service.
@@ -304,6 +309,45 @@ export interface RealtimeFunctionRunEvent {
304
309
  timestamp: string;
305
310
  }
306
311
 
312
+ /**
313
+ * Orchestration failure reason details.
314
+ */
315
+ export interface OrchestrationFailureReason {
316
+ /** Error code (e.g., "STEP_EXECUTION_FAILED") */
317
+ code: string;
318
+ /** Human-readable error message */
319
+ message: string;
320
+ /** ID of the step that failed */
321
+ stepId?: string;
322
+ }
323
+
324
+ /**
325
+ * Orchestration run event payload from the realtime service.
326
+ * Matches: services/backend/realtime/internal/redis/message.go OrchestrationRunEvent
327
+ */
328
+ export interface RealtimeOrchestrationRunEvent {
329
+ /** Event type */
330
+ event: OrchestrationEventType;
331
+ /** Workspace slug */
332
+ workspaceSlug: string;
333
+ /** Orchestration run ID */
334
+ runId: string;
335
+ /** Orchestration definition ID */
336
+ orchestrationId: string;
337
+ /** Orchestration name */
338
+ orchestrationName: string;
339
+ /** Trigger type: on-demand, event-driven, scheduled, http-trigger */
340
+ triggerType: 'on-demand' | 'event-driven' | 'scheduled' | 'http-trigger';
341
+ /** Outputs from completed steps (for completed/failed events) */
342
+ stepOutputs?: Record<string, unknown>;
343
+ /** Execution time in milliseconds (for completed/failed events) */
344
+ duration?: number;
345
+ /** Failure details (for failed events only) */
346
+ failureReason?: OrchestrationFailureReason;
347
+ /** ISO timestamp when the event occurred */
348
+ timestamp: string;
349
+ }
350
+
307
351
  /**
308
352
  * Close event payload from the realtime service.
309
353
  */
@@ -317,7 +361,7 @@ export interface RealtimeCloseEvent {
317
361
  /**
318
362
  * Union type of all realtime events.
319
363
  */
320
- export type RealtimeEvent = RealtimeRecordEvent | RealtimeValidationSuggestionEvent | RealtimeValidationBatchEvent | RealtimeAnomalyInsightEvent | RealtimeAnomalyDetectionEvent | RealtimeFunctionRunEvent;
364
+ export type RealtimeEvent = RealtimeRecordEvent | RealtimeValidationSuggestionEvent | RealtimeValidationBatchEvent | RealtimeAnomalyInsightEvent | RealtimeAnomalyDetectionEvent | RealtimeFunctionRunEvent | RealtimeOrchestrationRunEvent;
321
365
 
322
366
  /**
323
367
  * Error object for realtime connection errors.
@@ -347,6 +391,10 @@ export interface RealtimeSubscribeOptions {
347
391
  triggerType?: 'on-demand' | 'event-driven' | 'scheduled' | 'http-trigger';
348
392
  /** Filter compute events to a specific function ID */
349
393
  functionId?: string;
394
+ /** Filter orchestration events to a specific orchestration ID */
395
+ orchestrationId?: string;
396
+ /** Filter orchestration events to a specific run ID */
397
+ runId?: string;
350
398
  /** Callback for record events */
351
399
  onEvent: (event: RealtimeEvent) => void;
352
400
  /** Callback for errors */
@@ -503,7 +551,7 @@ export interface AuthorizationResult {
503
551
  /**
504
552
  * Trigger execution types supported by Centrali.
505
553
  */
506
- export type TriggerExecutionType = 'on-demand' | 'event-driven' | 'scheduled' | 'webhook';
554
+ export type TriggerExecutionType = 'on-demand' | 'event-driven' | 'scheduled' | 'http-trigger';
507
555
 
508
556
  /**
509
557
  * Function trigger definition.
@@ -2152,6 +2200,14 @@ export class RealtimeManager {
2152
2200
  url.searchParams.set('functionId', options.functionId);
2153
2201
  }
2154
2202
 
2203
+ // Add orchestration filters
2204
+ if (options.orchestrationId) {
2205
+ url.searchParams.set('orchestrationId', options.orchestrationId);
2206
+ }
2207
+ if (options.runId) {
2208
+ url.searchParams.set('runId', options.runId);
2209
+ }
2210
+
2155
2211
  // Create EventSource (uses polyfill in Node.js)
2156
2212
  eventSource = new EventSourceImpl(url.toString());
2157
2213
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@centrali-io/centrali-sdk",
3
- "version": "3.1.0",
3
+ "version": "3.1.2",
4
4
  "description": "Centrali Node SDK",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",