@centrali-io/centrali-sdk 5.5.0 → 6.0.0
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/README.md +164 -14
- package/dist/index.d.ts +1807 -878
- package/dist/index.js +9153 -4076
- package/index.ts +61 -7152
- package/package.json +10 -3
- package/query-types.ts +83 -2
- package/scripts/smoke-types.ts +145 -5
- package/src/client.ts +1507 -0
- package/src/internal/auth.ts +35 -0
- package/src/internal/deprecation.ts +11 -0
- package/src/internal/error.ts +90 -0
- package/src/internal/paths.ts +456 -0
- package/src/internal/queryGuard.ts +21 -0
- package/src/managers/allowedDomains.ts +90 -0
- package/src/managers/anomalyInsights.ts +215 -0
- package/src/managers/auditLog.ts +105 -0
- package/src/managers/collections.ts +197 -0
- package/src/managers/files.ts +182 -0
- package/src/managers/functionRuns.ts +229 -0
- package/src/managers/functions.ts +171 -0
- package/src/managers/orchestrationRuns.ts +122 -0
- package/src/managers/orchestrations.ts +297 -0
- package/src/managers/query.ts +199 -0
- package/src/managers/records.ts +186 -0
- package/src/managers/smartQueries.ts +374 -0
- package/src/managers/structures.ts +205 -0
- package/src/managers/triggers.ts +349 -0
- package/src/managers/validation.ts +303 -0
- package/src/managers/webhookSubscriptions.ts +206 -0
- package/src/realtime/manager.ts +292 -0
- package/src/types/allowedDomains.ts +29 -0
- package/src/types/auth.ts +83 -0
- package/src/types/common.ts +57 -0
- package/src/types/compute.ts +145 -0
- package/src/types/insights.ts +113 -0
- package/src/types/orchestrations.ts +460 -0
- package/src/types/realtime.ts +403 -0
- package/src/types/records.ts +261 -0
- package/src/types/search.ts +44 -0
- package/src/types/smartQueries.ts +303 -0
- package/src/types/structures.ts +203 -0
- package/src/types/triggers.ts +122 -0
- package/src/types/validation.ts +167 -0
- package/src/types/webhooks.ts +114 -0
- package/src/urls.ts +33 -0
- package/dist/query-types.d.ts +0 -187
- package/dist/query-types.js +0 -137
- package/dist/scripts/smoke-types.d.ts +0 -12
- package/dist/scripts/smoke-types.js +0 -102
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// =====================================================
|
|
2
|
+
// Anomaly Insights Types
|
|
3
|
+
// =====================================================
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Anomaly insight types.
|
|
7
|
+
*/
|
|
8
|
+
export type InsightType = 'time_series_anomaly' | 'statistical_outlier' | 'pattern_deviation' | 'volume_spike' | 'missing_data' | 'orphaned_reference' | 'reference_integrity';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Anomaly insight severity levels.
|
|
12
|
+
*/
|
|
13
|
+
export type InsightSeverity = 'info' | 'warning' | 'critical';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Anomaly insight status.
|
|
17
|
+
*/
|
|
18
|
+
export type InsightStatus = 'active' | 'acknowledged' | 'dismissed';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Anomaly insight record.
|
|
22
|
+
*/
|
|
23
|
+
export interface AnomalyInsight {
|
|
24
|
+
/** Unique identifier */
|
|
25
|
+
id: string;
|
|
26
|
+
/** Workspace slug */
|
|
27
|
+
workspaceSlug: string;
|
|
28
|
+
/** Structure ID */
|
|
29
|
+
structureId: string;
|
|
30
|
+
/** Structure slug */
|
|
31
|
+
structureSlug: string;
|
|
32
|
+
/** Batch ID if created in batch */
|
|
33
|
+
batchId: string | null;
|
|
34
|
+
/** Type of insight */
|
|
35
|
+
insightType: InsightType;
|
|
36
|
+
/** Severity level */
|
|
37
|
+
severity: InsightSeverity;
|
|
38
|
+
/** Short title */
|
|
39
|
+
title: string;
|
|
40
|
+
/** Detailed description */
|
|
41
|
+
description: string;
|
|
42
|
+
/** Affected field if applicable */
|
|
43
|
+
affectedField: string | null;
|
|
44
|
+
/** IDs of affected records */
|
|
45
|
+
affectedRecordIds: string[] | null;
|
|
46
|
+
/** Additional metadata */
|
|
47
|
+
metadata: Record<string, any>;
|
|
48
|
+
/** Confidence score 0-1 */
|
|
49
|
+
confidence: number;
|
|
50
|
+
/** Current status */
|
|
51
|
+
status: InsightStatus;
|
|
52
|
+
/** When acknowledged */
|
|
53
|
+
acknowledgedAt: string | null;
|
|
54
|
+
/** Who acknowledged */
|
|
55
|
+
acknowledgedBy: string | null;
|
|
56
|
+
/** Creation timestamp */
|
|
57
|
+
createdAt: string;
|
|
58
|
+
/** Last update timestamp */
|
|
59
|
+
updatedAt: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Options for listing anomaly insights.
|
|
64
|
+
*/
|
|
65
|
+
export interface ListInsightsOptions {
|
|
66
|
+
/** Filter by severity */
|
|
67
|
+
severity?: InsightSeverity;
|
|
68
|
+
/** Filter by status */
|
|
69
|
+
status?: InsightStatus;
|
|
70
|
+
/** Filter by insight type */
|
|
71
|
+
type?: InsightType;
|
|
72
|
+
/** Filter by structure slug */
|
|
73
|
+
structureSlug?: string;
|
|
74
|
+
/** Maximum results */
|
|
75
|
+
limit?: number;
|
|
76
|
+
/** Offset for pagination */
|
|
77
|
+
offset?: number;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Result of triggering anomaly analysis.
|
|
82
|
+
*/
|
|
83
|
+
export interface AnomalyAnalysisResult {
|
|
84
|
+
/** Whether the analysis was triggered */
|
|
85
|
+
success: boolean;
|
|
86
|
+
/** Status message */
|
|
87
|
+
message: string;
|
|
88
|
+
/** Batch ID for tracking (if triggered) */
|
|
89
|
+
batchId?: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Summary of anomaly insights.
|
|
94
|
+
*/
|
|
95
|
+
export interface InsightsSummary {
|
|
96
|
+
/** Total insights */
|
|
97
|
+
total: number;
|
|
98
|
+
/** Active insights */
|
|
99
|
+
active: number;
|
|
100
|
+
/** Acknowledged insights */
|
|
101
|
+
acknowledged: number;
|
|
102
|
+
/** Dismissed insights */
|
|
103
|
+
dismissed: number;
|
|
104
|
+
/** Breakdown by severity */
|
|
105
|
+
bySeverity: {
|
|
106
|
+
critical: number;
|
|
107
|
+
warning: number;
|
|
108
|
+
info: number;
|
|
109
|
+
};
|
|
110
|
+
/** Breakdown by type */
|
|
111
|
+
byType: Record<string, number>;
|
|
112
|
+
}
|
|
113
|
+
|
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
// =====================================================
|
|
2
|
+
// Orchestration Types
|
|
3
|
+
// =====================================================
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Orchestration trigger types.
|
|
7
|
+
*/
|
|
8
|
+
export type OrchestrationTriggerType = 'event-driven' | 'scheduled' | 'on-demand' | 'http-trigger';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Schedule types for scheduled orchestrations.
|
|
12
|
+
*/
|
|
13
|
+
export type OrchestrationScheduleType = 'interval' | 'cron' | 'once';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Orchestration lifecycle status.
|
|
17
|
+
*/
|
|
18
|
+
export type OrchestrationStatus = 'draft' | 'active' | 'paused';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Orchestration run status.
|
|
22
|
+
*/
|
|
23
|
+
export type OrchestrationRunStatus = 'pending' | 'running' | 'waiting' | 'completed' | 'failed';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Orchestration step types.
|
|
27
|
+
*/
|
|
28
|
+
export type OrchestrationStepType = 'compute' | 'decision' | 'delay';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Run step status.
|
|
32
|
+
*/
|
|
33
|
+
export type OrchestrationStepStatus = 'pending' | 'running' | 'waiting' | 'succeeded' | 'failed';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Condition operators for decision steps.
|
|
37
|
+
*/
|
|
38
|
+
export type ConditionOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'exists' | 'notExists' | 'in' | 'notIn';
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Orchestration trigger configuration.
|
|
42
|
+
*/
|
|
43
|
+
export interface OrchestrationTrigger {
|
|
44
|
+
/** Trigger type */
|
|
45
|
+
type: OrchestrationTriggerType;
|
|
46
|
+
|
|
47
|
+
// Event-driven trigger config
|
|
48
|
+
/** Event type for event-driven triggers */
|
|
49
|
+
eventType?: string;
|
|
50
|
+
/** Structure slug to watch */
|
|
51
|
+
structureSlug?: string;
|
|
52
|
+
|
|
53
|
+
// Scheduled trigger config
|
|
54
|
+
/** Schedule type for scheduled triggers */
|
|
55
|
+
scheduleType?: OrchestrationScheduleType;
|
|
56
|
+
/** Interval in seconds (for interval type) */
|
|
57
|
+
interval?: number;
|
|
58
|
+
/** Cron expression (for cron type) */
|
|
59
|
+
cronExpression?: string;
|
|
60
|
+
/** ISO datetime (for once type) */
|
|
61
|
+
scheduledAt?: string;
|
|
62
|
+
/** IANA timezone (default: UTC) */
|
|
63
|
+
timezone?: string;
|
|
64
|
+
|
|
65
|
+
// HTTP trigger config
|
|
66
|
+
/** Webhook path */
|
|
67
|
+
path?: string;
|
|
68
|
+
/** Whether to validate HMAC signature */
|
|
69
|
+
validateSignature?: boolean;
|
|
70
|
+
/** Signing secret for HMAC validation */
|
|
71
|
+
signingSecret?: string;
|
|
72
|
+
/** Header name for signature */
|
|
73
|
+
signatureHeaderName?: string;
|
|
74
|
+
/** Header name for message ID */
|
|
75
|
+
signatureIdHeaderName?: string;
|
|
76
|
+
/** Header name for timestamp (separate header format) */
|
|
77
|
+
timestampHeaderName?: string;
|
|
78
|
+
/** Regex to extract timestamp from signature header (compound format, e.g. Stripe) */
|
|
79
|
+
timestampExtractionPattern?: string;
|
|
80
|
+
/** HMAC algorithm (default: sha256) */
|
|
81
|
+
hmacAlgorithm?: string;
|
|
82
|
+
/** HMAC digest encoding (default: base64) */
|
|
83
|
+
hmacEncoding?: string;
|
|
84
|
+
/** Regex to extract signature value from header */
|
|
85
|
+
extractionPattern?: string;
|
|
86
|
+
/** Secret key encoding after prefix split (default: base64) */
|
|
87
|
+
encoding?: string;
|
|
88
|
+
/** How to derive HMAC key: 'raw' uses full string as UTF-8 (Stripe), 'prefixed-base64' strips prefix before _ and base64-decodes (Svix) */
|
|
89
|
+
secretEncoding?: 'raw' | 'prefixed-base64';
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Retry configuration for compute steps.
|
|
94
|
+
*/
|
|
95
|
+
export interface OrchestrationRetryConfig {
|
|
96
|
+
/** Maximum retry attempts */
|
|
97
|
+
maxAttempts: number;
|
|
98
|
+
/** Backoff delay in milliseconds */
|
|
99
|
+
backoffMs: number;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* On success configuration for compute steps.
|
|
104
|
+
*/
|
|
105
|
+
export interface OrchestrationOnSuccess {
|
|
106
|
+
/** Next step ID to execute on success */
|
|
107
|
+
nextStepId?: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* On failure configuration for compute steps.
|
|
112
|
+
*/
|
|
113
|
+
export interface OrchestrationOnFailure {
|
|
114
|
+
/** Action to take on failure: 'fail' or 'end' */
|
|
115
|
+
action: 'fail' | 'end';
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Condition in a decision case.
|
|
120
|
+
*/
|
|
121
|
+
export interface OrchestrationCondition {
|
|
122
|
+
/** Path to evaluate (e.g., 'input.data.status', 'steps.validate.output.isValid') */
|
|
123
|
+
path: string;
|
|
124
|
+
/** Comparison operator */
|
|
125
|
+
op: ConditionOperator;
|
|
126
|
+
/** Static value to compare against */
|
|
127
|
+
value?: unknown;
|
|
128
|
+
/** Path to dynamic value to compare against (alternative to value) */
|
|
129
|
+
valuePath?: string;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Decision case in a decision step.
|
|
134
|
+
*/
|
|
135
|
+
export interface OrchestrationDecisionCase {
|
|
136
|
+
/** Conditions to evaluate (AND logic) */
|
|
137
|
+
conditions: OrchestrationCondition[];
|
|
138
|
+
/** Next step ID if conditions match */
|
|
139
|
+
nextStepId: string;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Encrypted parameter for a compute step. To encrypt a new value, set encrypt=true and value=plaintext.
|
|
144
|
+
* Stored values have encrypted=true and value is masked in API responses.
|
|
145
|
+
*/
|
|
146
|
+
export interface StepEncryptedParam {
|
|
147
|
+
/** The parameter value (plaintext on create, masked as "********" on read) */
|
|
148
|
+
value: string;
|
|
149
|
+
/** True when the value is encrypted at rest */
|
|
150
|
+
encrypted?: boolean;
|
|
151
|
+
/** Encryption key version (for key rotation support) */
|
|
152
|
+
keyVersion?: number;
|
|
153
|
+
/** Client flag: set to true to encrypt this plaintext value */
|
|
154
|
+
encrypt?: boolean;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Orchestration step definition.
|
|
159
|
+
*/
|
|
160
|
+
export interface OrchestrationStep {
|
|
161
|
+
/** Unique step identifier */
|
|
162
|
+
id: string;
|
|
163
|
+
/** Human-readable step name */
|
|
164
|
+
name?: string;
|
|
165
|
+
/** Step type */
|
|
166
|
+
type: OrchestrationStepType;
|
|
167
|
+
|
|
168
|
+
// Compute step fields
|
|
169
|
+
/** Function ID to execute (for compute steps) */
|
|
170
|
+
functionId?: string;
|
|
171
|
+
/** Timeout in milliseconds (for compute steps) */
|
|
172
|
+
timeoutMs?: number;
|
|
173
|
+
/** Retry configuration (for compute steps) */
|
|
174
|
+
retry?: OrchestrationRetryConfig;
|
|
175
|
+
/** On success handler (for compute steps) */
|
|
176
|
+
onSuccess?: OrchestrationOnSuccess;
|
|
177
|
+
/** On failure handler (for compute steps) */
|
|
178
|
+
onFailure?: OrchestrationOnFailure;
|
|
179
|
+
/** Encrypted parameters for compute steps. Secrets are encrypted at rest and decrypted at execution time. */
|
|
180
|
+
encryptedParams?: Record<string, StepEncryptedParam>;
|
|
181
|
+
|
|
182
|
+
// Decision step fields
|
|
183
|
+
/** Decision cases (for decision steps) */
|
|
184
|
+
cases?: OrchestrationDecisionCase[];
|
|
185
|
+
/** Default next step if no case matches (for decision steps) */
|
|
186
|
+
defaultNextStepId?: string;
|
|
187
|
+
|
|
188
|
+
// Delay step fields
|
|
189
|
+
/** Delay duration in milliseconds (for delay steps) */
|
|
190
|
+
delayMs?: number;
|
|
191
|
+
/** Next step ID (for delay steps) */
|
|
192
|
+
nextStepId?: string;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Orchestration definition.
|
|
197
|
+
*/
|
|
198
|
+
export interface Orchestration {
|
|
199
|
+
/** Unique identifier */
|
|
200
|
+
id: string;
|
|
201
|
+
/** Workspace slug */
|
|
202
|
+
workspaceSlug: string;
|
|
203
|
+
/** URL-friendly slug */
|
|
204
|
+
slug: string;
|
|
205
|
+
/** Human-readable name */
|
|
206
|
+
name: string;
|
|
207
|
+
/** Optional description */
|
|
208
|
+
description?: string;
|
|
209
|
+
/** Version number (increments on update) */
|
|
210
|
+
version: number;
|
|
211
|
+
/** Lifecycle status */
|
|
212
|
+
status: OrchestrationStatus;
|
|
213
|
+
/** Trigger configuration */
|
|
214
|
+
trigger: OrchestrationTrigger;
|
|
215
|
+
/** Workflow steps */
|
|
216
|
+
steps: OrchestrationStep[];
|
|
217
|
+
/** ISO timestamp of creation */
|
|
218
|
+
createdAt: string;
|
|
219
|
+
/** User who created the orchestration */
|
|
220
|
+
createdBy: string;
|
|
221
|
+
/** ISO timestamp of last update */
|
|
222
|
+
updatedAt: string;
|
|
223
|
+
/** User who last updated the orchestration */
|
|
224
|
+
updatedBy: string;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Input for creating an orchestration.
|
|
229
|
+
*/
|
|
230
|
+
export interface CreateOrchestrationInput {
|
|
231
|
+
/** URL-friendly slug (unique within workspace) */
|
|
232
|
+
slug: string;
|
|
233
|
+
/** Human-readable name */
|
|
234
|
+
name: string;
|
|
235
|
+
/** Optional description */
|
|
236
|
+
description?: string;
|
|
237
|
+
/** Trigger configuration */
|
|
238
|
+
trigger: OrchestrationTrigger;
|
|
239
|
+
/** Workflow steps */
|
|
240
|
+
steps: OrchestrationStep[];
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Input for updating an orchestration.
|
|
245
|
+
*/
|
|
246
|
+
export interface UpdateOrchestrationInput {
|
|
247
|
+
/** Updated name */
|
|
248
|
+
name?: string;
|
|
249
|
+
/** Updated description */
|
|
250
|
+
description?: string;
|
|
251
|
+
/** Updated status */
|
|
252
|
+
status?: OrchestrationStatus;
|
|
253
|
+
/** Updated trigger configuration */
|
|
254
|
+
trigger?: OrchestrationTrigger;
|
|
255
|
+
/** Updated workflow steps */
|
|
256
|
+
steps?: OrchestrationStep[];
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Trigger metadata for a run.
|
|
261
|
+
*/
|
|
262
|
+
export interface OrchestrationTriggerMetadata {
|
|
263
|
+
/** Event type (for event-driven triggers) */
|
|
264
|
+
eventType?: string;
|
|
265
|
+
/** Schedule ID (for scheduled triggers) */
|
|
266
|
+
scheduleId?: string;
|
|
267
|
+
/** Principal ID who initiated the run (for manual triggers) */
|
|
268
|
+
initiatedByPrincipalId?: string;
|
|
269
|
+
/** Webhook path (for HTTP triggers) */
|
|
270
|
+
webhookPath?: string;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Orchestration run instance.
|
|
275
|
+
*/
|
|
276
|
+
export interface OrchestrationRun {
|
|
277
|
+
/** Unique run identifier */
|
|
278
|
+
id: string;
|
|
279
|
+
/** Parent orchestration ID */
|
|
280
|
+
orchestrationId: string;
|
|
281
|
+
/** Orchestration version at time of run */
|
|
282
|
+
orchestrationVersion: number;
|
|
283
|
+
/** Workspace slug */
|
|
284
|
+
workspaceSlug: string;
|
|
285
|
+
/** Run status */
|
|
286
|
+
status: OrchestrationRunStatus;
|
|
287
|
+
/** Current step being executed */
|
|
288
|
+
currentStepId?: string;
|
|
289
|
+
/** Input data that triggered the run */
|
|
290
|
+
input: Record<string, unknown>;
|
|
291
|
+
/** Shared context across steps */
|
|
292
|
+
context: Record<string, unknown>;
|
|
293
|
+
/** Outputs from completed steps */
|
|
294
|
+
stepOutputs: Record<string, unknown>;
|
|
295
|
+
/** Correlation ID for tracing */
|
|
296
|
+
correlationId?: string;
|
|
297
|
+
/** How the run was triggered */
|
|
298
|
+
triggerType: OrchestrationTriggerType;
|
|
299
|
+
/** Trigger-specific metadata */
|
|
300
|
+
triggerMetadata?: OrchestrationTriggerMetadata;
|
|
301
|
+
/** Whether any step has errors */
|
|
302
|
+
hasErrors: boolean;
|
|
303
|
+
/** Number of delay steps encountered */
|
|
304
|
+
delayStepCount: number;
|
|
305
|
+
/** Reason for failure (if failed) */
|
|
306
|
+
failureReason?: string;
|
|
307
|
+
/** ISO timestamp when run started */
|
|
308
|
+
startedAt: string;
|
|
309
|
+
/** ISO timestamp when run completed */
|
|
310
|
+
completedAt?: string;
|
|
311
|
+
/** ISO timestamp when run data expires */
|
|
312
|
+
ttlExpiresAt: string;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Decision result from a decision step.
|
|
317
|
+
*/
|
|
318
|
+
export interface OrchestrationDecisionResult {
|
|
319
|
+
/** Number of cases evaluated */
|
|
320
|
+
evaluatedCases: number;
|
|
321
|
+
/** Index of matched case (null if default) */
|
|
322
|
+
matchedCaseIndex?: number;
|
|
323
|
+
/** Selected next step ID */
|
|
324
|
+
selectedNextStepId: string;
|
|
325
|
+
/** Detailed evaluation of each case */
|
|
326
|
+
evaluations?: OrchestrationCaseEvaluation[];
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Evaluation result for a single decision case.
|
|
331
|
+
*/
|
|
332
|
+
export interface OrchestrationCaseEvaluation {
|
|
333
|
+
/** Case index */
|
|
334
|
+
caseIndex: number;
|
|
335
|
+
/** Next step ID for this case */
|
|
336
|
+
nextStepId: string;
|
|
337
|
+
/** Condition evaluations */
|
|
338
|
+
conditions: OrchestrationConditionEvaluation[];
|
|
339
|
+
/** Whether this case matched */
|
|
340
|
+
matched: boolean;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Evaluation result for a single condition.
|
|
345
|
+
*/
|
|
346
|
+
export interface OrchestrationConditionEvaluation {
|
|
347
|
+
/** Path that was evaluated */
|
|
348
|
+
path: string;
|
|
349
|
+
/** Operator used */
|
|
350
|
+
operator: string;
|
|
351
|
+
/** Expected value */
|
|
352
|
+
expectedValue?: unknown;
|
|
353
|
+
/** Value path (if comparing against another path) */
|
|
354
|
+
valuePath?: string;
|
|
355
|
+
/** Actual value found at path */
|
|
356
|
+
actualValue?: unknown;
|
|
357
|
+
/** Whether the path exists */
|
|
358
|
+
pathExists: boolean;
|
|
359
|
+
/** Whether condition matched */
|
|
360
|
+
matched: boolean;
|
|
361
|
+
/** Error message if evaluation failed */
|
|
362
|
+
error?: string;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Delay configuration result from a delay step.
|
|
367
|
+
*/
|
|
368
|
+
export interface OrchestrationDelayConfig {
|
|
369
|
+
/** Delay duration in milliseconds */
|
|
370
|
+
delayMs: number;
|
|
371
|
+
/** ISO timestamp when step will resume */
|
|
372
|
+
resumeAt: string;
|
|
373
|
+
/** ISO timestamp when step actually resumed */
|
|
374
|
+
resumedAt?: string;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Error information from a failed step.
|
|
379
|
+
*/
|
|
380
|
+
export interface OrchestrationStepError {
|
|
381
|
+
/** Error message */
|
|
382
|
+
message: string;
|
|
383
|
+
/** Error code */
|
|
384
|
+
code?: string;
|
|
385
|
+
/** Stack trace */
|
|
386
|
+
stack?: string;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Run step execution record.
|
|
391
|
+
*/
|
|
392
|
+
export interface OrchestrationRunStep {
|
|
393
|
+
/** Unique step execution identifier */
|
|
394
|
+
id: string;
|
|
395
|
+
/** Parent run ID */
|
|
396
|
+
orchestrationRunId: string;
|
|
397
|
+
/** Step ID from orchestration definition */
|
|
398
|
+
stepId: string;
|
|
399
|
+
/** Step type */
|
|
400
|
+
stepType: OrchestrationStepType;
|
|
401
|
+
/** Attempt number (for retries) */
|
|
402
|
+
attempt: number;
|
|
403
|
+
/** Step execution status */
|
|
404
|
+
status: OrchestrationStepStatus;
|
|
405
|
+
/** Input data for this step */
|
|
406
|
+
input?: Record<string, unknown>;
|
|
407
|
+
/** Output data from this step */
|
|
408
|
+
output?: Record<string, unknown>;
|
|
409
|
+
/** Decision result (for decision steps) */
|
|
410
|
+
decisionResult?: OrchestrationDecisionResult;
|
|
411
|
+
/** Delay configuration (for delay steps) */
|
|
412
|
+
delayConfig?: OrchestrationDelayConfig;
|
|
413
|
+
/** Error information (if failed) */
|
|
414
|
+
error?: OrchestrationStepError;
|
|
415
|
+
/** ISO timestamp when step started */
|
|
416
|
+
startedAt?: string;
|
|
417
|
+
/** ISO timestamp when step completed */
|
|
418
|
+
completedAt?: string;
|
|
419
|
+
/** Compute gateway execution ID (for logs) */
|
|
420
|
+
executionId?: string;
|
|
421
|
+
/** Function run ID (for UI linking) */
|
|
422
|
+
functionRunId?: string;
|
|
423
|
+
/** Function ID that was executed */
|
|
424
|
+
functionId?: string;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Options for triggering an orchestration run.
|
|
429
|
+
*/
|
|
430
|
+
export interface TriggerOrchestrationRunOptions {
|
|
431
|
+
/** Input data for the run */
|
|
432
|
+
input?: Record<string, unknown>;
|
|
433
|
+
/** Correlation ID for tracing */
|
|
434
|
+
correlationId?: string;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Options for listing orchestrations.
|
|
439
|
+
*/
|
|
440
|
+
export interface ListOrchestrationsOptions {
|
|
441
|
+
/** Number of items per page (default: 20, max: 100) */
|
|
442
|
+
limit?: number;
|
|
443
|
+
/** Number of items to skip */
|
|
444
|
+
offset?: number;
|
|
445
|
+
/** Filter by status */
|
|
446
|
+
status?: OrchestrationStatus;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Options for listing orchestration runs.
|
|
451
|
+
*/
|
|
452
|
+
export interface ListOrchestrationRunsOptions {
|
|
453
|
+
/** Number of items per page (default: 20, max: 100) */
|
|
454
|
+
limit?: number;
|
|
455
|
+
/** Number of items to skip */
|
|
456
|
+
offset?: number;
|
|
457
|
+
/** Filter by run status */
|
|
458
|
+
status?: OrchestrationRunStatus;
|
|
459
|
+
}
|
|
460
|
+
|