@cyoda/workflow-core 0.1.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.
@@ -0,0 +1,2646 @@
1
+ import { z, ZodError } from 'zod';
2
+
3
+ type OperatorType = "EQUALS" | "NOT_EQUAL" | "IS_NULL" | "NOT_NULL" | "GREATER_THAN" | "LESS_THAN" | "GREATER_OR_EQUAL" | "LESS_OR_EQUAL" | "BETWEEN" | "BETWEEN_INCLUSIVE" | "CONTAINS" | "NOT_CONTAINS" | "STARTS_WITH" | "NOT_STARTS_WITH" | "ENDS_WITH" | "NOT_ENDS_WITH" | "MATCHES_PATTERN" | "LIKE" | "IEQUALS" | "INOT_EQUAL" | "ICONTAINS" | "INOT_CONTAINS" | "ISTARTS_WITH" | "INOT_STARTS_WITH" | "IENDS_WITH" | "INOT_ENDS_WITH" | "IS_UNCHANGED" | "IS_CHANGED";
4
+ declare const OPERATOR_TYPES: ReadonlySet<OperatorType>;
5
+ type JsonValue = string | number | boolean | null | JsonValue[] | {
6
+ [k: string]: JsonValue;
7
+ };
8
+
9
+ type Criterion = SimpleCriterion | GroupCriterion | FunctionCriterion | LifecycleCriterion | ArrayCriterion;
10
+ interface SimpleCriterion {
11
+ type: "simple";
12
+ jsonPath: string;
13
+ operation: OperatorType;
14
+ value?: JsonValue;
15
+ }
16
+ interface GroupCriterion {
17
+ type: "group";
18
+ operator: "AND" | "OR" | "NOT";
19
+ conditions: Criterion[];
20
+ }
21
+ interface FunctionCriterion {
22
+ type: "function";
23
+ function: {
24
+ name: string;
25
+ config?: FunctionConfig;
26
+ criterion?: Criterion;
27
+ };
28
+ }
29
+ interface LifecycleCriterion {
30
+ type: "lifecycle";
31
+ field: "state" | "creationDate" | "previousTransition";
32
+ operation: OperatorType;
33
+ value?: JsonValue;
34
+ }
35
+ interface ArrayCriterion {
36
+ type: "array";
37
+ jsonPath: string;
38
+ operation: OperatorType;
39
+ value: string[];
40
+ }
41
+ interface FunctionConfig {
42
+ attachEntity?: boolean;
43
+ calculationNodesTags?: string;
44
+ responseTimeoutMs?: number;
45
+ retryPolicy?: string;
46
+ context?: string;
47
+ }
48
+
49
+ type Processor = ExternalizedProcessor | ScheduledProcessor;
50
+ type ExecutionMode = "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX";
51
+ interface ExternalizedProcessor {
52
+ type: "externalized";
53
+ name: string;
54
+ executionMode?: ExecutionMode;
55
+ config?: ExternalizedProcessorConfig;
56
+ }
57
+ interface ScheduledProcessor {
58
+ type: "scheduled";
59
+ name: string;
60
+ config: {
61
+ delayMs: number;
62
+ transition: string;
63
+ timeoutMs?: number;
64
+ };
65
+ }
66
+ interface ExternalizedProcessorConfig extends FunctionConfig {
67
+ asyncResult?: boolean;
68
+ crossoverToAsyncMs?: number;
69
+ }
70
+
71
+ type StateCode = string;
72
+ type TransitionName = string;
73
+ interface Workflow {
74
+ version: string;
75
+ name: string;
76
+ desc?: string;
77
+ initialState: StateCode;
78
+ active: boolean;
79
+ criterion?: Criterion;
80
+ states: Record<StateCode, State>;
81
+ }
82
+ interface State {
83
+ transitions: Transition[];
84
+ }
85
+ interface Transition {
86
+ name: TransitionName;
87
+ next: StateCode;
88
+ manual: boolean;
89
+ disabled: boolean;
90
+ criterion?: Criterion;
91
+ processors?: Processor[];
92
+ }
93
+
94
+ type ImportMode = "MERGE" | "REPLACE" | "ACTIVATE";
95
+ interface EntityIdentity {
96
+ entityName: string;
97
+ modelVersion: number;
98
+ }
99
+ interface WorkflowSession {
100
+ entity: EntityIdentity | null;
101
+ importMode: ImportMode;
102
+ workflows: Workflow[];
103
+ }
104
+ interface ImportPayload {
105
+ importMode: ImportMode;
106
+ workflows: Workflow[];
107
+ }
108
+ interface ExportPayload {
109
+ entityName: string;
110
+ modelVersion: number;
111
+ workflows: Workflow[];
112
+ }
113
+
114
+ type Severity = "error" | "warning" | "info";
115
+ interface ValidationIssue {
116
+ severity: Severity;
117
+ code: string;
118
+ message: string;
119
+ targetId?: string;
120
+ detail?: Record<string, unknown>;
121
+ }
122
+
123
+ interface WorkflowEditorDocument {
124
+ session: WorkflowSession;
125
+ meta: EditorMetadata;
126
+ }
127
+ interface EditorViewport {
128
+ x: number;
129
+ y: number;
130
+ zoom: number;
131
+ }
132
+ interface EditorMetadata {
133
+ revision: number;
134
+ ids: SyntheticIdMap;
135
+ workflowUi: Record<string, WorkflowUiMeta>;
136
+ lastValidJsonHash?: string;
137
+ }
138
+ interface SyntheticIdMap {
139
+ workflows: Record<string, string>;
140
+ states: Record<string, StatePointer>;
141
+ transitions: Record<string, TransitionPointer>;
142
+ processors: Record<string, ProcessorPointer>;
143
+ criteria: Record<string, CriterionPointer>;
144
+ }
145
+ interface StatePointer {
146
+ workflow: string;
147
+ state: string;
148
+ }
149
+ interface TransitionPointer {
150
+ workflow: string;
151
+ state: string;
152
+ transitionUuid: string;
153
+ }
154
+ interface ProcessorPointer {
155
+ workflow: string;
156
+ state: string;
157
+ transitionUuid: string;
158
+ processorUuid: string;
159
+ }
160
+ interface CriterionPointer {
161
+ host: HostRef;
162
+ path: string[];
163
+ }
164
+ type HostRef = {
165
+ kind: "workflow";
166
+ workflow: string;
167
+ } | {
168
+ kind: "transition";
169
+ workflow: string;
170
+ state: string;
171
+ transitionUuid: string;
172
+ } | {
173
+ kind: "processorConfig";
174
+ workflow: string;
175
+ state: string;
176
+ transitionUuid: string;
177
+ processorUuid: string;
178
+ };
179
+ /**
180
+ * Editor-only anchor side for an edge endpoint. Lives in WorkflowUiMeta and
181
+ * is never serialised into exported Cyoda JSON.
182
+ */
183
+ type EdgeAnchor = "top" | "right" | "bottom" | "left";
184
+ interface EdgeAnchorPair {
185
+ source?: EdgeAnchor;
186
+ target?: EdgeAnchor;
187
+ }
188
+ interface WorkflowUiMeta {
189
+ layout?: {
190
+ nodes: Record<StateCode, {
191
+ x: number;
192
+ y: number;
193
+ pinned?: boolean;
194
+ }>;
195
+ };
196
+ collapsedStates?: string[];
197
+ viewPreset?: "compact" | "ops" | "website";
198
+ selectedId?: string;
199
+ /**
200
+ * Per-transition anchor overrides keyed by synthetic transition UUID.
201
+ * Missing entries (or entries with missing `source`/`target`) fall back
202
+ * to heuristic defaults computed at projection time.
203
+ */
204
+ edgeAnchors?: Record<string, EdgeAnchorPair>;
205
+ /**
206
+ * Canvas viewport snapshots keyed by layout orientation. These are editor-only
207
+ * affordances and are never serialised into exported Cyoda JSON.
208
+ */
209
+ viewports?: Partial<Record<"vertical" | "horizontal", EditorViewport>>;
210
+ }
211
+
212
+ type DomainPatch = {
213
+ op: "addWorkflow";
214
+ workflow: Workflow;
215
+ } | {
216
+ op: "removeWorkflow";
217
+ workflow: string;
218
+ } | {
219
+ op: "updateWorkflowMeta";
220
+ workflow: string;
221
+ updates: Partial<Pick<Workflow, "version" | "desc" | "active">>;
222
+ } | {
223
+ op: "renameWorkflow";
224
+ from: string;
225
+ to: string;
226
+ } | {
227
+ op: "setInitialState";
228
+ workflow: string;
229
+ stateCode: StateCode;
230
+ } | {
231
+ op: "setWorkflowCriterion";
232
+ workflow: string;
233
+ criterion?: Criterion;
234
+ } | {
235
+ op: "addState";
236
+ workflow: string;
237
+ stateCode: StateCode;
238
+ } | {
239
+ op: "renameState";
240
+ workflow: string;
241
+ from: StateCode;
242
+ to: StateCode;
243
+ } | {
244
+ op: "removeState";
245
+ workflow: string;
246
+ stateCode: StateCode;
247
+ } | {
248
+ op: "addTransition";
249
+ workflow: string;
250
+ fromState: StateCode;
251
+ transition: Transition;
252
+ } | {
253
+ op: "updateTransition";
254
+ transitionUuid: string;
255
+ updates: Partial<Transition>;
256
+ } | {
257
+ op: "removeTransition";
258
+ transitionUuid: string;
259
+ } | {
260
+ op: "reorderTransition";
261
+ workflow: string;
262
+ fromState: StateCode;
263
+ transitionUuid: string;
264
+ toIndex: number;
265
+ } | {
266
+ op: "addProcessor";
267
+ transitionUuid: string;
268
+ processor: Processor;
269
+ index?: number;
270
+ } | {
271
+ op: "updateProcessor";
272
+ processorUuid: string;
273
+ updates: Partial<Processor>;
274
+ } | {
275
+ op: "removeProcessor";
276
+ processorUuid: string;
277
+ } | {
278
+ op: "reorderProcessor";
279
+ transitionUuid: string;
280
+ processorUuid: string;
281
+ toIndex: number;
282
+ } | {
283
+ op: "setCriterion";
284
+ host: HostRef;
285
+ path: string[];
286
+ criterion?: Criterion;
287
+ } | {
288
+ op: "setImportMode";
289
+ mode: ImportMode;
290
+ } | {
291
+ op: "setEntity";
292
+ entity: EntityIdentity | null;
293
+ } | {
294
+ op: "replaceSession";
295
+ session: WorkflowSession;
296
+ }
297
+ /**
298
+ * UI-only: persist source/target anchor overrides for a transition edge.
299
+ * Writes to `meta.workflowUi[workflow].edgeAnchors[transitionUuid]`.
300
+ * `anchors: null` clears the override. Does not touch `session.workflows`.
301
+ */
302
+ | {
303
+ op: "setEdgeAnchors";
304
+ transitionUuid: string;
305
+ anchors: EdgeAnchorPair | null;
306
+ };
307
+
308
+ /**
309
+ * Opaque concurrency token returned by `exportWorkflows` and echoed back
310
+ * on `importWorkflows` to enable 409 detection (spec §17.4).
311
+ *
312
+ * [Unverified] The shape of this token is a spec §30 open question — keep it
313
+ * opaque so servers can use ETags, revision numbers, or session nonces
314
+ * interchangeably.
315
+ */
316
+ type ConcurrencyToken = string;
317
+ interface ExportResult {
318
+ payload: ExportPayload;
319
+ concurrencyToken: ConcurrencyToken | null;
320
+ }
321
+ interface ImportResult {
322
+ /** New concurrency token assigned by the server after the import succeeded. */
323
+ concurrencyToken: ConcurrencyToken | null;
324
+ }
325
+ /**
326
+ * Contract between the configurator shell and the Cyoda backend (spec §17.1).
327
+ * Implementations are expected to be thin wrappers around a REST client;
328
+ * the editor never constructs requests directly.
329
+ */
330
+ interface WorkflowApi {
331
+ /**
332
+ * Fetch the active workflows for an entity. When `concurrencyToken`
333
+ * is present on the result, the save flow passes it back on the next
334
+ * import to detect 409 conflicts.
335
+ */
336
+ exportWorkflows(entity: EntityIdentity): Promise<ExportResult>;
337
+ /**
338
+ * Submit a workflow payload to the backend.
339
+ *
340
+ * Implementations MUST throw `WorkflowApiConflictError` when the server
341
+ * responds with a 409 (stale concurrency token).
342
+ */
343
+ importWorkflows(entity: EntityIdentity, payload: ImportPayload, opts?: {
344
+ concurrencyToken?: ConcurrencyToken | null;
345
+ }): Promise<ImportResult>;
346
+ }
347
+ /**
348
+ * Thrown by `importWorkflows` when the backend responds with a 409
349
+ * (spec §17.4). The editor shell surfaces a non-dismissable banner offering
350
+ * Reload (re-fetch + discard local) or Force overwrite (resend without
351
+ * the token).
352
+ */
353
+ declare class WorkflowApiConflictError extends Error {
354
+ readonly entity: EntityIdentity;
355
+ readonly serverConcurrencyToken: ConcurrencyToken | null;
356
+ readonly name = "WorkflowApiConflictError";
357
+ constructor(entity: EntityIdentity, serverConcurrencyToken: ConcurrencyToken | null, message?: string);
358
+ }
359
+ /**
360
+ * Thrown by either API method when the transport itself fails (network
361
+ * error, 5xx). Separate class so the save modal can distinguish transient
362
+ * failures from genuine concurrency conflicts.
363
+ */
364
+ declare class WorkflowApiTransportError extends Error {
365
+ readonly cause: unknown;
366
+ readonly name = "WorkflowApiTransportError";
367
+ constructor(cause: unknown, message?: string);
368
+ }
369
+ /**
370
+ * JSONPath hint provider for criterion editing (spec §17.2, §15.3).
371
+ * Optional — when omitted, criterion JSONPath inputs fall back to free-text.
372
+ */
373
+ interface EntityFieldHintProvider {
374
+ /**
375
+ * Return a flat list of JSONPath candidates for the given entity at
376
+ * the call-site depth. The result is used to power an autocomplete
377
+ * dropdown; implementations should cache per-entity internally.
378
+ */
379
+ listFieldPaths(entity: EntityIdentity): Promise<FieldHint[]>;
380
+ }
381
+ interface FieldHint {
382
+ jsonPath: string;
383
+ /** Human-readable type (string | number | boolean | object | array). */
384
+ type: string;
385
+ /** Optional description for hover. */
386
+ description?: string;
387
+ }
388
+ /** Visible save-flow state surfaced to the UI shell (spec §17.3). */
389
+ type SaveStatus = {
390
+ kind: "idle";
391
+ } | {
392
+ kind: "confirming";
393
+ mode: ImportMode;
394
+ requiresExplicitConfirm: boolean;
395
+ } | {
396
+ kind: "saving";
397
+ } | {
398
+ kind: "success";
399
+ at: number;
400
+ } | {
401
+ kind: "conflict";
402
+ serverConcurrencyToken: ConcurrencyToken | null;
403
+ } | {
404
+ kind: "error";
405
+ message: string;
406
+ };
407
+
408
+ declare const NAME_REGEX: RegExp;
409
+ declare const NameSchema: z.ZodString;
410
+
411
+ declare const OperatorEnum: z.ZodEnum<["EQUALS", "NOT_EQUAL", "IS_NULL", "NOT_NULL", "GREATER_THAN", "LESS_THAN", "GREATER_OR_EQUAL", "LESS_OR_EQUAL", "BETWEEN", "BETWEEN_INCLUSIVE", "CONTAINS", "NOT_CONTAINS", "STARTS_WITH", "NOT_STARTS_WITH", "ENDS_WITH", "NOT_ENDS_WITH", "MATCHES_PATTERN", "LIKE", "IEQUALS", "INOT_EQUAL", "ICONTAINS", "INOT_CONTAINS", "ISTARTS_WITH", "INOT_STARTS_WITH", "IENDS_WITH", "INOT_ENDS_WITH", "IS_UNCHANGED", "IS_CHANGED"]>;
412
+
413
+ declare const FunctionConfigSchema: z.ZodObject<{
414
+ attachEntity: z.ZodOptional<z.ZodBoolean>;
415
+ calculationNodesTags: z.ZodOptional<z.ZodString>;
416
+ responseTimeoutMs: z.ZodOptional<z.ZodNumber>;
417
+ retryPolicy: z.ZodOptional<z.ZodString>;
418
+ context: z.ZodOptional<z.ZodString>;
419
+ }, "strip", z.ZodTypeAny, {
420
+ attachEntity?: boolean | undefined;
421
+ calculationNodesTags?: string | undefined;
422
+ responseTimeoutMs?: number | undefined;
423
+ retryPolicy?: string | undefined;
424
+ context?: string | undefined;
425
+ }, {
426
+ attachEntity?: boolean | undefined;
427
+ calculationNodesTags?: string | undefined;
428
+ responseTimeoutMs?: number | undefined;
429
+ retryPolicy?: string | undefined;
430
+ context?: string | undefined;
431
+ }>;
432
+ declare const SimpleCriterionSchema: z.ZodObject<{
433
+ type: z.ZodLiteral<"simple">;
434
+ jsonPath: z.ZodString;
435
+ operation: z.ZodEnum<["EQUALS", "NOT_EQUAL", "IS_NULL", "NOT_NULL", "GREATER_THAN", "LESS_THAN", "GREATER_OR_EQUAL", "LESS_OR_EQUAL", "BETWEEN", "BETWEEN_INCLUSIVE", "CONTAINS", "NOT_CONTAINS", "STARTS_WITH", "NOT_STARTS_WITH", "ENDS_WITH", "NOT_ENDS_WITH", "MATCHES_PATTERN", "LIKE", "IEQUALS", "INOT_EQUAL", "ICONTAINS", "INOT_CONTAINS", "ISTARTS_WITH", "INOT_STARTS_WITH", "IENDS_WITH", "INOT_ENDS_WITH", "IS_UNCHANGED", "IS_CHANGED"]>;
436
+ value: z.ZodOptional<z.ZodUnknown>;
437
+ }, "strip", z.ZodTypeAny, {
438
+ type: "simple";
439
+ jsonPath: string;
440
+ operation: "EQUALS" | "NOT_EQUAL" | "IS_NULL" | "NOT_NULL" | "GREATER_THAN" | "LESS_THAN" | "GREATER_OR_EQUAL" | "LESS_OR_EQUAL" | "BETWEEN" | "BETWEEN_INCLUSIVE" | "CONTAINS" | "NOT_CONTAINS" | "STARTS_WITH" | "NOT_STARTS_WITH" | "ENDS_WITH" | "NOT_ENDS_WITH" | "MATCHES_PATTERN" | "LIKE" | "IEQUALS" | "INOT_EQUAL" | "ICONTAINS" | "INOT_CONTAINS" | "ISTARTS_WITH" | "INOT_STARTS_WITH" | "IENDS_WITH" | "INOT_ENDS_WITH" | "IS_UNCHANGED" | "IS_CHANGED";
441
+ value?: unknown;
442
+ }, {
443
+ type: "simple";
444
+ jsonPath: string;
445
+ operation: "EQUALS" | "NOT_EQUAL" | "IS_NULL" | "NOT_NULL" | "GREATER_THAN" | "LESS_THAN" | "GREATER_OR_EQUAL" | "LESS_OR_EQUAL" | "BETWEEN" | "BETWEEN_INCLUSIVE" | "CONTAINS" | "NOT_CONTAINS" | "STARTS_WITH" | "NOT_STARTS_WITH" | "ENDS_WITH" | "NOT_ENDS_WITH" | "MATCHES_PATTERN" | "LIKE" | "IEQUALS" | "INOT_EQUAL" | "ICONTAINS" | "INOT_CONTAINS" | "ISTARTS_WITH" | "INOT_STARTS_WITH" | "IENDS_WITH" | "INOT_ENDS_WITH" | "IS_UNCHANGED" | "IS_CHANGED";
446
+ value?: unknown;
447
+ }>;
448
+ declare const LifecycleCriterionSchema: z.ZodObject<{
449
+ type: z.ZodLiteral<"lifecycle">;
450
+ field: z.ZodEnum<["state", "creationDate", "previousTransition"]>;
451
+ operation: z.ZodEnum<["EQUALS", "NOT_EQUAL", "IS_NULL", "NOT_NULL", "GREATER_THAN", "LESS_THAN", "GREATER_OR_EQUAL", "LESS_OR_EQUAL", "BETWEEN", "BETWEEN_INCLUSIVE", "CONTAINS", "NOT_CONTAINS", "STARTS_WITH", "NOT_STARTS_WITH", "ENDS_WITH", "NOT_ENDS_WITH", "MATCHES_PATTERN", "LIKE", "IEQUALS", "INOT_EQUAL", "ICONTAINS", "INOT_CONTAINS", "ISTARTS_WITH", "INOT_STARTS_WITH", "IENDS_WITH", "INOT_ENDS_WITH", "IS_UNCHANGED", "IS_CHANGED"]>;
452
+ value: z.ZodOptional<z.ZodUnknown>;
453
+ }, "strip", z.ZodTypeAny, {
454
+ type: "lifecycle";
455
+ operation: "EQUALS" | "NOT_EQUAL" | "IS_NULL" | "NOT_NULL" | "GREATER_THAN" | "LESS_THAN" | "GREATER_OR_EQUAL" | "LESS_OR_EQUAL" | "BETWEEN" | "BETWEEN_INCLUSIVE" | "CONTAINS" | "NOT_CONTAINS" | "STARTS_WITH" | "NOT_STARTS_WITH" | "ENDS_WITH" | "NOT_ENDS_WITH" | "MATCHES_PATTERN" | "LIKE" | "IEQUALS" | "INOT_EQUAL" | "ICONTAINS" | "INOT_CONTAINS" | "ISTARTS_WITH" | "INOT_STARTS_WITH" | "IENDS_WITH" | "INOT_ENDS_WITH" | "IS_UNCHANGED" | "IS_CHANGED";
456
+ field: "state" | "creationDate" | "previousTransition";
457
+ value?: unknown;
458
+ }, {
459
+ type: "lifecycle";
460
+ operation: "EQUALS" | "NOT_EQUAL" | "IS_NULL" | "NOT_NULL" | "GREATER_THAN" | "LESS_THAN" | "GREATER_OR_EQUAL" | "LESS_OR_EQUAL" | "BETWEEN" | "BETWEEN_INCLUSIVE" | "CONTAINS" | "NOT_CONTAINS" | "STARTS_WITH" | "NOT_STARTS_WITH" | "ENDS_WITH" | "NOT_ENDS_WITH" | "MATCHES_PATTERN" | "LIKE" | "IEQUALS" | "INOT_EQUAL" | "ICONTAINS" | "INOT_CONTAINS" | "ISTARTS_WITH" | "INOT_STARTS_WITH" | "IENDS_WITH" | "INOT_ENDS_WITH" | "IS_UNCHANGED" | "IS_CHANGED";
461
+ field: "state" | "creationDate" | "previousTransition";
462
+ value?: unknown;
463
+ }>;
464
+ declare const ArrayCriterionSchema: z.ZodObject<{
465
+ type: z.ZodLiteral<"array">;
466
+ jsonPath: z.ZodString;
467
+ operation: z.ZodEnum<["EQUALS", "NOT_EQUAL", "IS_NULL", "NOT_NULL", "GREATER_THAN", "LESS_THAN", "GREATER_OR_EQUAL", "LESS_OR_EQUAL", "BETWEEN", "BETWEEN_INCLUSIVE", "CONTAINS", "NOT_CONTAINS", "STARTS_WITH", "NOT_STARTS_WITH", "ENDS_WITH", "NOT_ENDS_WITH", "MATCHES_PATTERN", "LIKE", "IEQUALS", "INOT_EQUAL", "ICONTAINS", "INOT_CONTAINS", "ISTARTS_WITH", "INOT_STARTS_WITH", "IENDS_WITH", "INOT_ENDS_WITH", "IS_UNCHANGED", "IS_CHANGED"]>;
468
+ value: z.ZodArray<z.ZodString, "many">;
469
+ }, "strip", z.ZodTypeAny, {
470
+ value: string[];
471
+ type: "array";
472
+ jsonPath: string;
473
+ operation: "EQUALS" | "NOT_EQUAL" | "IS_NULL" | "NOT_NULL" | "GREATER_THAN" | "LESS_THAN" | "GREATER_OR_EQUAL" | "LESS_OR_EQUAL" | "BETWEEN" | "BETWEEN_INCLUSIVE" | "CONTAINS" | "NOT_CONTAINS" | "STARTS_WITH" | "NOT_STARTS_WITH" | "ENDS_WITH" | "NOT_ENDS_WITH" | "MATCHES_PATTERN" | "LIKE" | "IEQUALS" | "INOT_EQUAL" | "ICONTAINS" | "INOT_CONTAINS" | "ISTARTS_WITH" | "INOT_STARTS_WITH" | "IENDS_WITH" | "INOT_ENDS_WITH" | "IS_UNCHANGED" | "IS_CHANGED";
474
+ }, {
475
+ value: string[];
476
+ type: "array";
477
+ jsonPath: string;
478
+ operation: "EQUALS" | "NOT_EQUAL" | "IS_NULL" | "NOT_NULL" | "GREATER_THAN" | "LESS_THAN" | "GREATER_OR_EQUAL" | "LESS_OR_EQUAL" | "BETWEEN" | "BETWEEN_INCLUSIVE" | "CONTAINS" | "NOT_CONTAINS" | "STARTS_WITH" | "NOT_STARTS_WITH" | "ENDS_WITH" | "NOT_ENDS_WITH" | "MATCHES_PATTERN" | "LIKE" | "IEQUALS" | "INOT_EQUAL" | "ICONTAINS" | "INOT_CONTAINS" | "ISTARTS_WITH" | "INOT_STARTS_WITH" | "IENDS_WITH" | "INOT_ENDS_WITH" | "IS_UNCHANGED" | "IS_CHANGED";
479
+ }>;
480
+ declare const CriterionSchema: z.ZodType<Criterion>;
481
+ declare const GroupCriterionSchema: z.ZodLazy<z.ZodObject<{
482
+ type: z.ZodLiteral<"group">;
483
+ operator: z.ZodEnum<["AND", "OR", "NOT"]>;
484
+ conditions: z.ZodArray<z.ZodType<Criterion, z.ZodTypeDef, Criterion>, "many">;
485
+ }, "strip", z.ZodTypeAny, {
486
+ type: "group";
487
+ operator: "AND" | "OR" | "NOT";
488
+ conditions: Criterion[];
489
+ }, {
490
+ type: "group";
491
+ operator: "AND" | "OR" | "NOT";
492
+ conditions: Criterion[];
493
+ }>>;
494
+ declare const FunctionCriterionSchema: z.ZodLazy<z.ZodObject<{
495
+ type: z.ZodLiteral<"function">;
496
+ function: z.ZodObject<{
497
+ name: z.ZodString;
498
+ config: z.ZodOptional<z.ZodObject<{
499
+ attachEntity: z.ZodOptional<z.ZodBoolean>;
500
+ calculationNodesTags: z.ZodOptional<z.ZodString>;
501
+ responseTimeoutMs: z.ZodOptional<z.ZodNumber>;
502
+ retryPolicy: z.ZodOptional<z.ZodString>;
503
+ context: z.ZodOptional<z.ZodString>;
504
+ }, "strip", z.ZodTypeAny, {
505
+ attachEntity?: boolean | undefined;
506
+ calculationNodesTags?: string | undefined;
507
+ responseTimeoutMs?: number | undefined;
508
+ retryPolicy?: string | undefined;
509
+ context?: string | undefined;
510
+ }, {
511
+ attachEntity?: boolean | undefined;
512
+ calculationNodesTags?: string | undefined;
513
+ responseTimeoutMs?: number | undefined;
514
+ retryPolicy?: string | undefined;
515
+ context?: string | undefined;
516
+ }>>;
517
+ criterion: z.ZodOptional<z.ZodType<Criterion, z.ZodTypeDef, Criterion>>;
518
+ }, "strip", z.ZodTypeAny, {
519
+ name: string;
520
+ criterion?: Criterion | undefined;
521
+ config?: {
522
+ attachEntity?: boolean | undefined;
523
+ calculationNodesTags?: string | undefined;
524
+ responseTimeoutMs?: number | undefined;
525
+ retryPolicy?: string | undefined;
526
+ context?: string | undefined;
527
+ } | undefined;
528
+ }, {
529
+ name: string;
530
+ criterion?: Criterion | undefined;
531
+ config?: {
532
+ attachEntity?: boolean | undefined;
533
+ calculationNodesTags?: string | undefined;
534
+ responseTimeoutMs?: number | undefined;
535
+ retryPolicy?: string | undefined;
536
+ context?: string | undefined;
537
+ } | undefined;
538
+ }>;
539
+ }, "strip", z.ZodTypeAny, {
540
+ function: {
541
+ name: string;
542
+ criterion?: Criterion | undefined;
543
+ config?: {
544
+ attachEntity?: boolean | undefined;
545
+ calculationNodesTags?: string | undefined;
546
+ responseTimeoutMs?: number | undefined;
547
+ retryPolicy?: string | undefined;
548
+ context?: string | undefined;
549
+ } | undefined;
550
+ };
551
+ type: "function";
552
+ }, {
553
+ function: {
554
+ name: string;
555
+ criterion?: Criterion | undefined;
556
+ config?: {
557
+ attachEntity?: boolean | undefined;
558
+ calculationNodesTags?: string | undefined;
559
+ responseTimeoutMs?: number | undefined;
560
+ retryPolicy?: string | undefined;
561
+ context?: string | undefined;
562
+ } | undefined;
563
+ };
564
+ type: "function";
565
+ }>>;
566
+
567
+ declare const ExecutionModeSchema: z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX"]>;
568
+ declare const ExternalizedProcessorSchema: z.ZodObject<{
569
+ type: z.ZodLiteral<"externalized">;
570
+ name: z.ZodString;
571
+ executionMode: z.ZodOptional<z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX"]>>;
572
+ config: z.ZodOptional<z.ZodIntersection<z.ZodObject<{
573
+ attachEntity: z.ZodOptional<z.ZodBoolean>;
574
+ calculationNodesTags: z.ZodOptional<z.ZodString>;
575
+ responseTimeoutMs: z.ZodOptional<z.ZodNumber>;
576
+ retryPolicy: z.ZodOptional<z.ZodString>;
577
+ context: z.ZodOptional<z.ZodString>;
578
+ }, "strip", z.ZodTypeAny, {
579
+ attachEntity?: boolean | undefined;
580
+ calculationNodesTags?: string | undefined;
581
+ responseTimeoutMs?: number | undefined;
582
+ retryPolicy?: string | undefined;
583
+ context?: string | undefined;
584
+ }, {
585
+ attachEntity?: boolean | undefined;
586
+ calculationNodesTags?: string | undefined;
587
+ responseTimeoutMs?: number | undefined;
588
+ retryPolicy?: string | undefined;
589
+ context?: string | undefined;
590
+ }>, z.ZodObject<{
591
+ asyncResult: z.ZodOptional<z.ZodBoolean>;
592
+ crossoverToAsyncMs: z.ZodOptional<z.ZodNumber>;
593
+ }, "strip", z.ZodTypeAny, {
594
+ asyncResult?: boolean | undefined;
595
+ crossoverToAsyncMs?: number | undefined;
596
+ }, {
597
+ asyncResult?: boolean | undefined;
598
+ crossoverToAsyncMs?: number | undefined;
599
+ }>>>;
600
+ }, "strip", z.ZodTypeAny, {
601
+ name: string;
602
+ type: "externalized";
603
+ config?: ({
604
+ attachEntity?: boolean | undefined;
605
+ calculationNodesTags?: string | undefined;
606
+ responseTimeoutMs?: number | undefined;
607
+ retryPolicy?: string | undefined;
608
+ context?: string | undefined;
609
+ } & {
610
+ asyncResult?: boolean | undefined;
611
+ crossoverToAsyncMs?: number | undefined;
612
+ }) | undefined;
613
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
614
+ }, {
615
+ name: string;
616
+ type: "externalized";
617
+ config?: ({
618
+ attachEntity?: boolean | undefined;
619
+ calculationNodesTags?: string | undefined;
620
+ responseTimeoutMs?: number | undefined;
621
+ retryPolicy?: string | undefined;
622
+ context?: string | undefined;
623
+ } & {
624
+ asyncResult?: boolean | undefined;
625
+ crossoverToAsyncMs?: number | undefined;
626
+ }) | undefined;
627
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
628
+ }>;
629
+ declare const ScheduledProcessorSchema: z.ZodObject<{
630
+ type: z.ZodLiteral<"scheduled">;
631
+ name: z.ZodString;
632
+ config: z.ZodObject<{
633
+ delayMs: z.ZodNumber;
634
+ transition: z.ZodString;
635
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
636
+ }, "strip", z.ZodTypeAny, {
637
+ transition: string;
638
+ delayMs: number;
639
+ timeoutMs?: number | undefined;
640
+ }, {
641
+ transition: string;
642
+ delayMs: number;
643
+ timeoutMs?: number | undefined;
644
+ }>;
645
+ }, "strip", z.ZodTypeAny, {
646
+ name: string;
647
+ type: "scheduled";
648
+ config: {
649
+ transition: string;
650
+ delayMs: number;
651
+ timeoutMs?: number | undefined;
652
+ };
653
+ }, {
654
+ name: string;
655
+ type: "scheduled";
656
+ config: {
657
+ transition: string;
658
+ delayMs: number;
659
+ timeoutMs?: number | undefined;
660
+ };
661
+ }>;
662
+ declare const ProcessorSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
663
+ type: z.ZodLiteral<"externalized">;
664
+ name: z.ZodString;
665
+ executionMode: z.ZodOptional<z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX"]>>;
666
+ config: z.ZodOptional<z.ZodIntersection<z.ZodObject<{
667
+ attachEntity: z.ZodOptional<z.ZodBoolean>;
668
+ calculationNodesTags: z.ZodOptional<z.ZodString>;
669
+ responseTimeoutMs: z.ZodOptional<z.ZodNumber>;
670
+ retryPolicy: z.ZodOptional<z.ZodString>;
671
+ context: z.ZodOptional<z.ZodString>;
672
+ }, "strip", z.ZodTypeAny, {
673
+ attachEntity?: boolean | undefined;
674
+ calculationNodesTags?: string | undefined;
675
+ responseTimeoutMs?: number | undefined;
676
+ retryPolicy?: string | undefined;
677
+ context?: string | undefined;
678
+ }, {
679
+ attachEntity?: boolean | undefined;
680
+ calculationNodesTags?: string | undefined;
681
+ responseTimeoutMs?: number | undefined;
682
+ retryPolicy?: string | undefined;
683
+ context?: string | undefined;
684
+ }>, z.ZodObject<{
685
+ asyncResult: z.ZodOptional<z.ZodBoolean>;
686
+ crossoverToAsyncMs: z.ZodOptional<z.ZodNumber>;
687
+ }, "strip", z.ZodTypeAny, {
688
+ asyncResult?: boolean | undefined;
689
+ crossoverToAsyncMs?: number | undefined;
690
+ }, {
691
+ asyncResult?: boolean | undefined;
692
+ crossoverToAsyncMs?: number | undefined;
693
+ }>>>;
694
+ }, "strip", z.ZodTypeAny, {
695
+ name: string;
696
+ type: "externalized";
697
+ config?: ({
698
+ attachEntity?: boolean | undefined;
699
+ calculationNodesTags?: string | undefined;
700
+ responseTimeoutMs?: number | undefined;
701
+ retryPolicy?: string | undefined;
702
+ context?: string | undefined;
703
+ } & {
704
+ asyncResult?: boolean | undefined;
705
+ crossoverToAsyncMs?: number | undefined;
706
+ }) | undefined;
707
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
708
+ }, {
709
+ name: string;
710
+ type: "externalized";
711
+ config?: ({
712
+ attachEntity?: boolean | undefined;
713
+ calculationNodesTags?: string | undefined;
714
+ responseTimeoutMs?: number | undefined;
715
+ retryPolicy?: string | undefined;
716
+ context?: string | undefined;
717
+ } & {
718
+ asyncResult?: boolean | undefined;
719
+ crossoverToAsyncMs?: number | undefined;
720
+ }) | undefined;
721
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
722
+ }>, z.ZodObject<{
723
+ type: z.ZodLiteral<"scheduled">;
724
+ name: z.ZodString;
725
+ config: z.ZodObject<{
726
+ delayMs: z.ZodNumber;
727
+ transition: z.ZodString;
728
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
729
+ }, "strip", z.ZodTypeAny, {
730
+ transition: string;
731
+ delayMs: number;
732
+ timeoutMs?: number | undefined;
733
+ }, {
734
+ transition: string;
735
+ delayMs: number;
736
+ timeoutMs?: number | undefined;
737
+ }>;
738
+ }, "strip", z.ZodTypeAny, {
739
+ name: string;
740
+ type: "scheduled";
741
+ config: {
742
+ transition: string;
743
+ delayMs: number;
744
+ timeoutMs?: number | undefined;
745
+ };
746
+ }, {
747
+ name: string;
748
+ type: "scheduled";
749
+ config: {
750
+ transition: string;
751
+ delayMs: number;
752
+ timeoutMs?: number | undefined;
753
+ };
754
+ }>]>;
755
+
756
+ declare const TransitionSchema: z.ZodObject<{
757
+ name: z.ZodString;
758
+ next: z.ZodString;
759
+ manual: z.ZodBoolean;
760
+ disabled: z.ZodBoolean;
761
+ criterion: z.ZodOptional<z.ZodType<Criterion, z.ZodTypeDef, Criterion>>;
762
+ processors: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
763
+ type: z.ZodLiteral<"externalized">;
764
+ name: z.ZodString;
765
+ executionMode: z.ZodOptional<z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX"]>>;
766
+ config: z.ZodOptional<z.ZodIntersection<z.ZodObject<{
767
+ attachEntity: z.ZodOptional<z.ZodBoolean>;
768
+ calculationNodesTags: z.ZodOptional<z.ZodString>;
769
+ responseTimeoutMs: z.ZodOptional<z.ZodNumber>;
770
+ retryPolicy: z.ZodOptional<z.ZodString>;
771
+ context: z.ZodOptional<z.ZodString>;
772
+ }, "strip", z.ZodTypeAny, {
773
+ attachEntity?: boolean | undefined;
774
+ calculationNodesTags?: string | undefined;
775
+ responseTimeoutMs?: number | undefined;
776
+ retryPolicy?: string | undefined;
777
+ context?: string | undefined;
778
+ }, {
779
+ attachEntity?: boolean | undefined;
780
+ calculationNodesTags?: string | undefined;
781
+ responseTimeoutMs?: number | undefined;
782
+ retryPolicy?: string | undefined;
783
+ context?: string | undefined;
784
+ }>, z.ZodObject<{
785
+ asyncResult: z.ZodOptional<z.ZodBoolean>;
786
+ crossoverToAsyncMs: z.ZodOptional<z.ZodNumber>;
787
+ }, "strip", z.ZodTypeAny, {
788
+ asyncResult?: boolean | undefined;
789
+ crossoverToAsyncMs?: number | undefined;
790
+ }, {
791
+ asyncResult?: boolean | undefined;
792
+ crossoverToAsyncMs?: number | undefined;
793
+ }>>>;
794
+ }, "strip", z.ZodTypeAny, {
795
+ name: string;
796
+ type: "externalized";
797
+ config?: ({
798
+ attachEntity?: boolean | undefined;
799
+ calculationNodesTags?: string | undefined;
800
+ responseTimeoutMs?: number | undefined;
801
+ retryPolicy?: string | undefined;
802
+ context?: string | undefined;
803
+ } & {
804
+ asyncResult?: boolean | undefined;
805
+ crossoverToAsyncMs?: number | undefined;
806
+ }) | undefined;
807
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
808
+ }, {
809
+ name: string;
810
+ type: "externalized";
811
+ config?: ({
812
+ attachEntity?: boolean | undefined;
813
+ calculationNodesTags?: string | undefined;
814
+ responseTimeoutMs?: number | undefined;
815
+ retryPolicy?: string | undefined;
816
+ context?: string | undefined;
817
+ } & {
818
+ asyncResult?: boolean | undefined;
819
+ crossoverToAsyncMs?: number | undefined;
820
+ }) | undefined;
821
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
822
+ }>, z.ZodObject<{
823
+ type: z.ZodLiteral<"scheduled">;
824
+ name: z.ZodString;
825
+ config: z.ZodObject<{
826
+ delayMs: z.ZodNumber;
827
+ transition: z.ZodString;
828
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
829
+ }, "strip", z.ZodTypeAny, {
830
+ transition: string;
831
+ delayMs: number;
832
+ timeoutMs?: number | undefined;
833
+ }, {
834
+ transition: string;
835
+ delayMs: number;
836
+ timeoutMs?: number | undefined;
837
+ }>;
838
+ }, "strip", z.ZodTypeAny, {
839
+ name: string;
840
+ type: "scheduled";
841
+ config: {
842
+ transition: string;
843
+ delayMs: number;
844
+ timeoutMs?: number | undefined;
845
+ };
846
+ }, {
847
+ name: string;
848
+ type: "scheduled";
849
+ config: {
850
+ transition: string;
851
+ delayMs: number;
852
+ timeoutMs?: number | undefined;
853
+ };
854
+ }>]>, "many">>;
855
+ }, "strip", z.ZodTypeAny, {
856
+ name: string;
857
+ next: string;
858
+ manual: boolean;
859
+ disabled: boolean;
860
+ criterion?: Criterion | undefined;
861
+ processors?: ({
862
+ name: string;
863
+ type: "externalized";
864
+ config?: ({
865
+ attachEntity?: boolean | undefined;
866
+ calculationNodesTags?: string | undefined;
867
+ responseTimeoutMs?: number | undefined;
868
+ retryPolicy?: string | undefined;
869
+ context?: string | undefined;
870
+ } & {
871
+ asyncResult?: boolean | undefined;
872
+ crossoverToAsyncMs?: number | undefined;
873
+ }) | undefined;
874
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
875
+ } | {
876
+ name: string;
877
+ type: "scheduled";
878
+ config: {
879
+ transition: string;
880
+ delayMs: number;
881
+ timeoutMs?: number | undefined;
882
+ };
883
+ })[] | undefined;
884
+ }, {
885
+ name: string;
886
+ next: string;
887
+ manual: boolean;
888
+ disabled: boolean;
889
+ criterion?: Criterion | undefined;
890
+ processors?: ({
891
+ name: string;
892
+ type: "externalized";
893
+ config?: ({
894
+ attachEntity?: boolean | undefined;
895
+ calculationNodesTags?: string | undefined;
896
+ responseTimeoutMs?: number | undefined;
897
+ retryPolicy?: string | undefined;
898
+ context?: string | undefined;
899
+ } & {
900
+ asyncResult?: boolean | undefined;
901
+ crossoverToAsyncMs?: number | undefined;
902
+ }) | undefined;
903
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
904
+ } | {
905
+ name: string;
906
+ type: "scheduled";
907
+ config: {
908
+ transition: string;
909
+ delayMs: number;
910
+ timeoutMs?: number | undefined;
911
+ };
912
+ })[] | undefined;
913
+ }>;
914
+ declare const StateSchema: z.ZodObject<{
915
+ transitions: z.ZodArray<z.ZodObject<{
916
+ name: z.ZodString;
917
+ next: z.ZodString;
918
+ manual: z.ZodBoolean;
919
+ disabled: z.ZodBoolean;
920
+ criterion: z.ZodOptional<z.ZodType<Criterion, z.ZodTypeDef, Criterion>>;
921
+ processors: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
922
+ type: z.ZodLiteral<"externalized">;
923
+ name: z.ZodString;
924
+ executionMode: z.ZodOptional<z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX"]>>;
925
+ config: z.ZodOptional<z.ZodIntersection<z.ZodObject<{
926
+ attachEntity: z.ZodOptional<z.ZodBoolean>;
927
+ calculationNodesTags: z.ZodOptional<z.ZodString>;
928
+ responseTimeoutMs: z.ZodOptional<z.ZodNumber>;
929
+ retryPolicy: z.ZodOptional<z.ZodString>;
930
+ context: z.ZodOptional<z.ZodString>;
931
+ }, "strip", z.ZodTypeAny, {
932
+ attachEntity?: boolean | undefined;
933
+ calculationNodesTags?: string | undefined;
934
+ responseTimeoutMs?: number | undefined;
935
+ retryPolicy?: string | undefined;
936
+ context?: string | undefined;
937
+ }, {
938
+ attachEntity?: boolean | undefined;
939
+ calculationNodesTags?: string | undefined;
940
+ responseTimeoutMs?: number | undefined;
941
+ retryPolicy?: string | undefined;
942
+ context?: string | undefined;
943
+ }>, z.ZodObject<{
944
+ asyncResult: z.ZodOptional<z.ZodBoolean>;
945
+ crossoverToAsyncMs: z.ZodOptional<z.ZodNumber>;
946
+ }, "strip", z.ZodTypeAny, {
947
+ asyncResult?: boolean | undefined;
948
+ crossoverToAsyncMs?: number | undefined;
949
+ }, {
950
+ asyncResult?: boolean | undefined;
951
+ crossoverToAsyncMs?: number | undefined;
952
+ }>>>;
953
+ }, "strip", z.ZodTypeAny, {
954
+ name: string;
955
+ type: "externalized";
956
+ config?: ({
957
+ attachEntity?: boolean | undefined;
958
+ calculationNodesTags?: string | undefined;
959
+ responseTimeoutMs?: number | undefined;
960
+ retryPolicy?: string | undefined;
961
+ context?: string | undefined;
962
+ } & {
963
+ asyncResult?: boolean | undefined;
964
+ crossoverToAsyncMs?: number | undefined;
965
+ }) | undefined;
966
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
967
+ }, {
968
+ name: string;
969
+ type: "externalized";
970
+ config?: ({
971
+ attachEntity?: boolean | undefined;
972
+ calculationNodesTags?: string | undefined;
973
+ responseTimeoutMs?: number | undefined;
974
+ retryPolicy?: string | undefined;
975
+ context?: string | undefined;
976
+ } & {
977
+ asyncResult?: boolean | undefined;
978
+ crossoverToAsyncMs?: number | undefined;
979
+ }) | undefined;
980
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
981
+ }>, z.ZodObject<{
982
+ type: z.ZodLiteral<"scheduled">;
983
+ name: z.ZodString;
984
+ config: z.ZodObject<{
985
+ delayMs: z.ZodNumber;
986
+ transition: z.ZodString;
987
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
988
+ }, "strip", z.ZodTypeAny, {
989
+ transition: string;
990
+ delayMs: number;
991
+ timeoutMs?: number | undefined;
992
+ }, {
993
+ transition: string;
994
+ delayMs: number;
995
+ timeoutMs?: number | undefined;
996
+ }>;
997
+ }, "strip", z.ZodTypeAny, {
998
+ name: string;
999
+ type: "scheduled";
1000
+ config: {
1001
+ transition: string;
1002
+ delayMs: number;
1003
+ timeoutMs?: number | undefined;
1004
+ };
1005
+ }, {
1006
+ name: string;
1007
+ type: "scheduled";
1008
+ config: {
1009
+ transition: string;
1010
+ delayMs: number;
1011
+ timeoutMs?: number | undefined;
1012
+ };
1013
+ }>]>, "many">>;
1014
+ }, "strip", z.ZodTypeAny, {
1015
+ name: string;
1016
+ next: string;
1017
+ manual: boolean;
1018
+ disabled: boolean;
1019
+ criterion?: Criterion | undefined;
1020
+ processors?: ({
1021
+ name: string;
1022
+ type: "externalized";
1023
+ config?: ({
1024
+ attachEntity?: boolean | undefined;
1025
+ calculationNodesTags?: string | undefined;
1026
+ responseTimeoutMs?: number | undefined;
1027
+ retryPolicy?: string | undefined;
1028
+ context?: string | undefined;
1029
+ } & {
1030
+ asyncResult?: boolean | undefined;
1031
+ crossoverToAsyncMs?: number | undefined;
1032
+ }) | undefined;
1033
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1034
+ } | {
1035
+ name: string;
1036
+ type: "scheduled";
1037
+ config: {
1038
+ transition: string;
1039
+ delayMs: number;
1040
+ timeoutMs?: number | undefined;
1041
+ };
1042
+ })[] | undefined;
1043
+ }, {
1044
+ name: string;
1045
+ next: string;
1046
+ manual: boolean;
1047
+ disabled: boolean;
1048
+ criterion?: Criterion | undefined;
1049
+ processors?: ({
1050
+ name: string;
1051
+ type: "externalized";
1052
+ config?: ({
1053
+ attachEntity?: boolean | undefined;
1054
+ calculationNodesTags?: string | undefined;
1055
+ responseTimeoutMs?: number | undefined;
1056
+ retryPolicy?: string | undefined;
1057
+ context?: string | undefined;
1058
+ } & {
1059
+ asyncResult?: boolean | undefined;
1060
+ crossoverToAsyncMs?: number | undefined;
1061
+ }) | undefined;
1062
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1063
+ } | {
1064
+ name: string;
1065
+ type: "scheduled";
1066
+ config: {
1067
+ transition: string;
1068
+ delayMs: number;
1069
+ timeoutMs?: number | undefined;
1070
+ };
1071
+ })[] | undefined;
1072
+ }>, "many">;
1073
+ }, "strip", z.ZodTypeAny, {
1074
+ transitions: {
1075
+ name: string;
1076
+ next: string;
1077
+ manual: boolean;
1078
+ disabled: boolean;
1079
+ criterion?: Criterion | undefined;
1080
+ processors?: ({
1081
+ name: string;
1082
+ type: "externalized";
1083
+ config?: ({
1084
+ attachEntity?: boolean | undefined;
1085
+ calculationNodesTags?: string | undefined;
1086
+ responseTimeoutMs?: number | undefined;
1087
+ retryPolicy?: string | undefined;
1088
+ context?: string | undefined;
1089
+ } & {
1090
+ asyncResult?: boolean | undefined;
1091
+ crossoverToAsyncMs?: number | undefined;
1092
+ }) | undefined;
1093
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1094
+ } | {
1095
+ name: string;
1096
+ type: "scheduled";
1097
+ config: {
1098
+ transition: string;
1099
+ delayMs: number;
1100
+ timeoutMs?: number | undefined;
1101
+ };
1102
+ })[] | undefined;
1103
+ }[];
1104
+ }, {
1105
+ transitions: {
1106
+ name: string;
1107
+ next: string;
1108
+ manual: boolean;
1109
+ disabled: boolean;
1110
+ criterion?: Criterion | undefined;
1111
+ processors?: ({
1112
+ name: string;
1113
+ type: "externalized";
1114
+ config?: ({
1115
+ attachEntity?: boolean | undefined;
1116
+ calculationNodesTags?: string | undefined;
1117
+ responseTimeoutMs?: number | undefined;
1118
+ retryPolicy?: string | undefined;
1119
+ context?: string | undefined;
1120
+ } & {
1121
+ asyncResult?: boolean | undefined;
1122
+ crossoverToAsyncMs?: number | undefined;
1123
+ }) | undefined;
1124
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1125
+ } | {
1126
+ name: string;
1127
+ type: "scheduled";
1128
+ config: {
1129
+ transition: string;
1130
+ delayMs: number;
1131
+ timeoutMs?: number | undefined;
1132
+ };
1133
+ })[] | undefined;
1134
+ }[];
1135
+ }>;
1136
+ declare const WorkflowSchema: z.ZodObject<{
1137
+ version: z.ZodString;
1138
+ name: z.ZodString;
1139
+ desc: z.ZodOptional<z.ZodString>;
1140
+ initialState: z.ZodString;
1141
+ active: z.ZodBoolean;
1142
+ criterion: z.ZodOptional<z.ZodType<Criterion, z.ZodTypeDef, Criterion>>;
1143
+ states: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
1144
+ transitions: z.ZodArray<z.ZodObject<{
1145
+ name: z.ZodString;
1146
+ next: z.ZodString;
1147
+ manual: z.ZodBoolean;
1148
+ disabled: z.ZodBoolean;
1149
+ criterion: z.ZodOptional<z.ZodType<Criterion, z.ZodTypeDef, Criterion>>;
1150
+ processors: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1151
+ type: z.ZodLiteral<"externalized">;
1152
+ name: z.ZodString;
1153
+ executionMode: z.ZodOptional<z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX"]>>;
1154
+ config: z.ZodOptional<z.ZodIntersection<z.ZodObject<{
1155
+ attachEntity: z.ZodOptional<z.ZodBoolean>;
1156
+ calculationNodesTags: z.ZodOptional<z.ZodString>;
1157
+ responseTimeoutMs: z.ZodOptional<z.ZodNumber>;
1158
+ retryPolicy: z.ZodOptional<z.ZodString>;
1159
+ context: z.ZodOptional<z.ZodString>;
1160
+ }, "strip", z.ZodTypeAny, {
1161
+ attachEntity?: boolean | undefined;
1162
+ calculationNodesTags?: string | undefined;
1163
+ responseTimeoutMs?: number | undefined;
1164
+ retryPolicy?: string | undefined;
1165
+ context?: string | undefined;
1166
+ }, {
1167
+ attachEntity?: boolean | undefined;
1168
+ calculationNodesTags?: string | undefined;
1169
+ responseTimeoutMs?: number | undefined;
1170
+ retryPolicy?: string | undefined;
1171
+ context?: string | undefined;
1172
+ }>, z.ZodObject<{
1173
+ asyncResult: z.ZodOptional<z.ZodBoolean>;
1174
+ crossoverToAsyncMs: z.ZodOptional<z.ZodNumber>;
1175
+ }, "strip", z.ZodTypeAny, {
1176
+ asyncResult?: boolean | undefined;
1177
+ crossoverToAsyncMs?: number | undefined;
1178
+ }, {
1179
+ asyncResult?: boolean | undefined;
1180
+ crossoverToAsyncMs?: number | undefined;
1181
+ }>>>;
1182
+ }, "strip", z.ZodTypeAny, {
1183
+ name: string;
1184
+ type: "externalized";
1185
+ config?: ({
1186
+ attachEntity?: boolean | undefined;
1187
+ calculationNodesTags?: string | undefined;
1188
+ responseTimeoutMs?: number | undefined;
1189
+ retryPolicy?: string | undefined;
1190
+ context?: string | undefined;
1191
+ } & {
1192
+ asyncResult?: boolean | undefined;
1193
+ crossoverToAsyncMs?: number | undefined;
1194
+ }) | undefined;
1195
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1196
+ }, {
1197
+ name: string;
1198
+ type: "externalized";
1199
+ config?: ({
1200
+ attachEntity?: boolean | undefined;
1201
+ calculationNodesTags?: string | undefined;
1202
+ responseTimeoutMs?: number | undefined;
1203
+ retryPolicy?: string | undefined;
1204
+ context?: string | undefined;
1205
+ } & {
1206
+ asyncResult?: boolean | undefined;
1207
+ crossoverToAsyncMs?: number | undefined;
1208
+ }) | undefined;
1209
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1210
+ }>, z.ZodObject<{
1211
+ type: z.ZodLiteral<"scheduled">;
1212
+ name: z.ZodString;
1213
+ config: z.ZodObject<{
1214
+ delayMs: z.ZodNumber;
1215
+ transition: z.ZodString;
1216
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
1217
+ }, "strip", z.ZodTypeAny, {
1218
+ transition: string;
1219
+ delayMs: number;
1220
+ timeoutMs?: number | undefined;
1221
+ }, {
1222
+ transition: string;
1223
+ delayMs: number;
1224
+ timeoutMs?: number | undefined;
1225
+ }>;
1226
+ }, "strip", z.ZodTypeAny, {
1227
+ name: string;
1228
+ type: "scheduled";
1229
+ config: {
1230
+ transition: string;
1231
+ delayMs: number;
1232
+ timeoutMs?: number | undefined;
1233
+ };
1234
+ }, {
1235
+ name: string;
1236
+ type: "scheduled";
1237
+ config: {
1238
+ transition: string;
1239
+ delayMs: number;
1240
+ timeoutMs?: number | undefined;
1241
+ };
1242
+ }>]>, "many">>;
1243
+ }, "strip", z.ZodTypeAny, {
1244
+ name: string;
1245
+ next: string;
1246
+ manual: boolean;
1247
+ disabled: boolean;
1248
+ criterion?: Criterion | undefined;
1249
+ processors?: ({
1250
+ name: string;
1251
+ type: "externalized";
1252
+ config?: ({
1253
+ attachEntity?: boolean | undefined;
1254
+ calculationNodesTags?: string | undefined;
1255
+ responseTimeoutMs?: number | undefined;
1256
+ retryPolicy?: string | undefined;
1257
+ context?: string | undefined;
1258
+ } & {
1259
+ asyncResult?: boolean | undefined;
1260
+ crossoverToAsyncMs?: number | undefined;
1261
+ }) | undefined;
1262
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1263
+ } | {
1264
+ name: string;
1265
+ type: "scheduled";
1266
+ config: {
1267
+ transition: string;
1268
+ delayMs: number;
1269
+ timeoutMs?: number | undefined;
1270
+ };
1271
+ })[] | undefined;
1272
+ }, {
1273
+ name: string;
1274
+ next: string;
1275
+ manual: boolean;
1276
+ disabled: boolean;
1277
+ criterion?: Criterion | undefined;
1278
+ processors?: ({
1279
+ name: string;
1280
+ type: "externalized";
1281
+ config?: ({
1282
+ attachEntity?: boolean | undefined;
1283
+ calculationNodesTags?: string | undefined;
1284
+ responseTimeoutMs?: number | undefined;
1285
+ retryPolicy?: string | undefined;
1286
+ context?: string | undefined;
1287
+ } & {
1288
+ asyncResult?: boolean | undefined;
1289
+ crossoverToAsyncMs?: number | undefined;
1290
+ }) | undefined;
1291
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1292
+ } | {
1293
+ name: string;
1294
+ type: "scheduled";
1295
+ config: {
1296
+ transition: string;
1297
+ delayMs: number;
1298
+ timeoutMs?: number | undefined;
1299
+ };
1300
+ })[] | undefined;
1301
+ }>, "many">;
1302
+ }, "strip", z.ZodTypeAny, {
1303
+ transitions: {
1304
+ name: string;
1305
+ next: string;
1306
+ manual: boolean;
1307
+ disabled: boolean;
1308
+ criterion?: Criterion | undefined;
1309
+ processors?: ({
1310
+ name: string;
1311
+ type: "externalized";
1312
+ config?: ({
1313
+ attachEntity?: boolean | undefined;
1314
+ calculationNodesTags?: string | undefined;
1315
+ responseTimeoutMs?: number | undefined;
1316
+ retryPolicy?: string | undefined;
1317
+ context?: string | undefined;
1318
+ } & {
1319
+ asyncResult?: boolean | undefined;
1320
+ crossoverToAsyncMs?: number | undefined;
1321
+ }) | undefined;
1322
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1323
+ } | {
1324
+ name: string;
1325
+ type: "scheduled";
1326
+ config: {
1327
+ transition: string;
1328
+ delayMs: number;
1329
+ timeoutMs?: number | undefined;
1330
+ };
1331
+ })[] | undefined;
1332
+ }[];
1333
+ }, {
1334
+ transitions: {
1335
+ name: string;
1336
+ next: string;
1337
+ manual: boolean;
1338
+ disabled: boolean;
1339
+ criterion?: Criterion | undefined;
1340
+ processors?: ({
1341
+ name: string;
1342
+ type: "externalized";
1343
+ config?: ({
1344
+ attachEntity?: boolean | undefined;
1345
+ calculationNodesTags?: string | undefined;
1346
+ responseTimeoutMs?: number | undefined;
1347
+ retryPolicy?: string | undefined;
1348
+ context?: string | undefined;
1349
+ } & {
1350
+ asyncResult?: boolean | undefined;
1351
+ crossoverToAsyncMs?: number | undefined;
1352
+ }) | undefined;
1353
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1354
+ } | {
1355
+ name: string;
1356
+ type: "scheduled";
1357
+ config: {
1358
+ transition: string;
1359
+ delayMs: number;
1360
+ timeoutMs?: number | undefined;
1361
+ };
1362
+ })[] | undefined;
1363
+ }[];
1364
+ }>>, Record<string, {
1365
+ transitions: {
1366
+ name: string;
1367
+ next: string;
1368
+ manual: boolean;
1369
+ disabled: boolean;
1370
+ criterion?: Criterion | undefined;
1371
+ processors?: ({
1372
+ name: string;
1373
+ type: "externalized";
1374
+ config?: ({
1375
+ attachEntity?: boolean | undefined;
1376
+ calculationNodesTags?: string | undefined;
1377
+ responseTimeoutMs?: number | undefined;
1378
+ retryPolicy?: string | undefined;
1379
+ context?: string | undefined;
1380
+ } & {
1381
+ asyncResult?: boolean | undefined;
1382
+ crossoverToAsyncMs?: number | undefined;
1383
+ }) | undefined;
1384
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1385
+ } | {
1386
+ name: string;
1387
+ type: "scheduled";
1388
+ config: {
1389
+ transition: string;
1390
+ delayMs: number;
1391
+ timeoutMs?: number | undefined;
1392
+ };
1393
+ })[] | undefined;
1394
+ }[];
1395
+ }>, Record<string, {
1396
+ transitions: {
1397
+ name: string;
1398
+ next: string;
1399
+ manual: boolean;
1400
+ disabled: boolean;
1401
+ criterion?: Criterion | undefined;
1402
+ processors?: ({
1403
+ name: string;
1404
+ type: "externalized";
1405
+ config?: ({
1406
+ attachEntity?: boolean | undefined;
1407
+ calculationNodesTags?: string | undefined;
1408
+ responseTimeoutMs?: number | undefined;
1409
+ retryPolicy?: string | undefined;
1410
+ context?: string | undefined;
1411
+ } & {
1412
+ asyncResult?: boolean | undefined;
1413
+ crossoverToAsyncMs?: number | undefined;
1414
+ }) | undefined;
1415
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1416
+ } | {
1417
+ name: string;
1418
+ type: "scheduled";
1419
+ config: {
1420
+ transition: string;
1421
+ delayMs: number;
1422
+ timeoutMs?: number | undefined;
1423
+ };
1424
+ })[] | undefined;
1425
+ }[];
1426
+ }>>;
1427
+ }, "strip", z.ZodTypeAny, {
1428
+ version: string;
1429
+ active: boolean;
1430
+ name: string;
1431
+ initialState: string;
1432
+ states: Record<string, {
1433
+ transitions: {
1434
+ name: string;
1435
+ next: string;
1436
+ manual: boolean;
1437
+ disabled: boolean;
1438
+ criterion?: Criterion | undefined;
1439
+ processors?: ({
1440
+ name: string;
1441
+ type: "externalized";
1442
+ config?: ({
1443
+ attachEntity?: boolean | undefined;
1444
+ calculationNodesTags?: string | undefined;
1445
+ responseTimeoutMs?: number | undefined;
1446
+ retryPolicy?: string | undefined;
1447
+ context?: string | undefined;
1448
+ } & {
1449
+ asyncResult?: boolean | undefined;
1450
+ crossoverToAsyncMs?: number | undefined;
1451
+ }) | undefined;
1452
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1453
+ } | {
1454
+ name: string;
1455
+ type: "scheduled";
1456
+ config: {
1457
+ transition: string;
1458
+ delayMs: number;
1459
+ timeoutMs?: number | undefined;
1460
+ };
1461
+ })[] | undefined;
1462
+ }[];
1463
+ }>;
1464
+ desc?: string | undefined;
1465
+ criterion?: Criterion | undefined;
1466
+ }, {
1467
+ version: string;
1468
+ active: boolean;
1469
+ name: string;
1470
+ initialState: string;
1471
+ states: Record<string, {
1472
+ transitions: {
1473
+ name: string;
1474
+ next: string;
1475
+ manual: boolean;
1476
+ disabled: boolean;
1477
+ criterion?: Criterion | undefined;
1478
+ processors?: ({
1479
+ name: string;
1480
+ type: "externalized";
1481
+ config?: ({
1482
+ attachEntity?: boolean | undefined;
1483
+ calculationNodesTags?: string | undefined;
1484
+ responseTimeoutMs?: number | undefined;
1485
+ retryPolicy?: string | undefined;
1486
+ context?: string | undefined;
1487
+ } & {
1488
+ asyncResult?: boolean | undefined;
1489
+ crossoverToAsyncMs?: number | undefined;
1490
+ }) | undefined;
1491
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1492
+ } | {
1493
+ name: string;
1494
+ type: "scheduled";
1495
+ config: {
1496
+ transition: string;
1497
+ delayMs: number;
1498
+ timeoutMs?: number | undefined;
1499
+ };
1500
+ })[] | undefined;
1501
+ }[];
1502
+ }>;
1503
+ desc?: string | undefined;
1504
+ criterion?: Criterion | undefined;
1505
+ }>;
1506
+
1507
+ declare const ImportPayloadSchema: z.ZodObject<{
1508
+ importMode: z.ZodEnum<["MERGE", "REPLACE", "ACTIVATE"]>;
1509
+ workflows: z.ZodArray<z.ZodObject<{
1510
+ version: z.ZodString;
1511
+ name: z.ZodString;
1512
+ desc: z.ZodOptional<z.ZodString>;
1513
+ initialState: z.ZodString;
1514
+ active: z.ZodBoolean;
1515
+ criterion: z.ZodOptional<z.ZodType<Criterion, z.ZodTypeDef, Criterion>>;
1516
+ states: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
1517
+ transitions: z.ZodArray<z.ZodObject<{
1518
+ name: z.ZodString;
1519
+ next: z.ZodString;
1520
+ manual: z.ZodBoolean;
1521
+ disabled: z.ZodBoolean;
1522
+ criterion: z.ZodOptional<z.ZodType<Criterion, z.ZodTypeDef, Criterion>>;
1523
+ processors: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1524
+ type: z.ZodLiteral<"externalized">;
1525
+ name: z.ZodString;
1526
+ executionMode: z.ZodOptional<z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX"]>>;
1527
+ config: z.ZodOptional<z.ZodIntersection<z.ZodObject<{
1528
+ attachEntity: z.ZodOptional<z.ZodBoolean>;
1529
+ calculationNodesTags: z.ZodOptional<z.ZodString>;
1530
+ responseTimeoutMs: z.ZodOptional<z.ZodNumber>;
1531
+ retryPolicy: z.ZodOptional<z.ZodString>;
1532
+ context: z.ZodOptional<z.ZodString>;
1533
+ }, "strip", z.ZodTypeAny, {
1534
+ attachEntity?: boolean | undefined;
1535
+ calculationNodesTags?: string | undefined;
1536
+ responseTimeoutMs?: number | undefined;
1537
+ retryPolicy?: string | undefined;
1538
+ context?: string | undefined;
1539
+ }, {
1540
+ attachEntity?: boolean | undefined;
1541
+ calculationNodesTags?: string | undefined;
1542
+ responseTimeoutMs?: number | undefined;
1543
+ retryPolicy?: string | undefined;
1544
+ context?: string | undefined;
1545
+ }>, z.ZodObject<{
1546
+ asyncResult: z.ZodOptional<z.ZodBoolean>;
1547
+ crossoverToAsyncMs: z.ZodOptional<z.ZodNumber>;
1548
+ }, "strip", z.ZodTypeAny, {
1549
+ asyncResult?: boolean | undefined;
1550
+ crossoverToAsyncMs?: number | undefined;
1551
+ }, {
1552
+ asyncResult?: boolean | undefined;
1553
+ crossoverToAsyncMs?: number | undefined;
1554
+ }>>>;
1555
+ }, "strip", z.ZodTypeAny, {
1556
+ name: string;
1557
+ type: "externalized";
1558
+ config?: ({
1559
+ attachEntity?: boolean | undefined;
1560
+ calculationNodesTags?: string | undefined;
1561
+ responseTimeoutMs?: number | undefined;
1562
+ retryPolicy?: string | undefined;
1563
+ context?: string | undefined;
1564
+ } & {
1565
+ asyncResult?: boolean | undefined;
1566
+ crossoverToAsyncMs?: number | undefined;
1567
+ }) | undefined;
1568
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1569
+ }, {
1570
+ name: string;
1571
+ type: "externalized";
1572
+ config?: ({
1573
+ attachEntity?: boolean | undefined;
1574
+ calculationNodesTags?: string | undefined;
1575
+ responseTimeoutMs?: number | undefined;
1576
+ retryPolicy?: string | undefined;
1577
+ context?: string | undefined;
1578
+ } & {
1579
+ asyncResult?: boolean | undefined;
1580
+ crossoverToAsyncMs?: number | undefined;
1581
+ }) | undefined;
1582
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1583
+ }>, z.ZodObject<{
1584
+ type: z.ZodLiteral<"scheduled">;
1585
+ name: z.ZodString;
1586
+ config: z.ZodObject<{
1587
+ delayMs: z.ZodNumber;
1588
+ transition: z.ZodString;
1589
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
1590
+ }, "strip", z.ZodTypeAny, {
1591
+ transition: string;
1592
+ delayMs: number;
1593
+ timeoutMs?: number | undefined;
1594
+ }, {
1595
+ transition: string;
1596
+ delayMs: number;
1597
+ timeoutMs?: number | undefined;
1598
+ }>;
1599
+ }, "strip", z.ZodTypeAny, {
1600
+ name: string;
1601
+ type: "scheduled";
1602
+ config: {
1603
+ transition: string;
1604
+ delayMs: number;
1605
+ timeoutMs?: number | undefined;
1606
+ };
1607
+ }, {
1608
+ name: string;
1609
+ type: "scheduled";
1610
+ config: {
1611
+ transition: string;
1612
+ delayMs: number;
1613
+ timeoutMs?: number | undefined;
1614
+ };
1615
+ }>]>, "many">>;
1616
+ }, "strip", z.ZodTypeAny, {
1617
+ name: string;
1618
+ next: string;
1619
+ manual: boolean;
1620
+ disabled: boolean;
1621
+ criterion?: Criterion | undefined;
1622
+ processors?: ({
1623
+ name: string;
1624
+ type: "externalized";
1625
+ config?: ({
1626
+ attachEntity?: boolean | undefined;
1627
+ calculationNodesTags?: string | undefined;
1628
+ responseTimeoutMs?: number | undefined;
1629
+ retryPolicy?: string | undefined;
1630
+ context?: string | undefined;
1631
+ } & {
1632
+ asyncResult?: boolean | undefined;
1633
+ crossoverToAsyncMs?: number | undefined;
1634
+ }) | undefined;
1635
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1636
+ } | {
1637
+ name: string;
1638
+ type: "scheduled";
1639
+ config: {
1640
+ transition: string;
1641
+ delayMs: number;
1642
+ timeoutMs?: number | undefined;
1643
+ };
1644
+ })[] | undefined;
1645
+ }, {
1646
+ name: string;
1647
+ next: string;
1648
+ manual: boolean;
1649
+ disabled: boolean;
1650
+ criterion?: Criterion | undefined;
1651
+ processors?: ({
1652
+ name: string;
1653
+ type: "externalized";
1654
+ config?: ({
1655
+ attachEntity?: boolean | undefined;
1656
+ calculationNodesTags?: string | undefined;
1657
+ responseTimeoutMs?: number | undefined;
1658
+ retryPolicy?: string | undefined;
1659
+ context?: string | undefined;
1660
+ } & {
1661
+ asyncResult?: boolean | undefined;
1662
+ crossoverToAsyncMs?: number | undefined;
1663
+ }) | undefined;
1664
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1665
+ } | {
1666
+ name: string;
1667
+ type: "scheduled";
1668
+ config: {
1669
+ transition: string;
1670
+ delayMs: number;
1671
+ timeoutMs?: number | undefined;
1672
+ };
1673
+ })[] | undefined;
1674
+ }>, "many">;
1675
+ }, "strip", z.ZodTypeAny, {
1676
+ transitions: {
1677
+ name: string;
1678
+ next: string;
1679
+ manual: boolean;
1680
+ disabled: boolean;
1681
+ criterion?: Criterion | undefined;
1682
+ processors?: ({
1683
+ name: string;
1684
+ type: "externalized";
1685
+ config?: ({
1686
+ attachEntity?: boolean | undefined;
1687
+ calculationNodesTags?: string | undefined;
1688
+ responseTimeoutMs?: number | undefined;
1689
+ retryPolicy?: string | undefined;
1690
+ context?: string | undefined;
1691
+ } & {
1692
+ asyncResult?: boolean | undefined;
1693
+ crossoverToAsyncMs?: number | undefined;
1694
+ }) | undefined;
1695
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1696
+ } | {
1697
+ name: string;
1698
+ type: "scheduled";
1699
+ config: {
1700
+ transition: string;
1701
+ delayMs: number;
1702
+ timeoutMs?: number | undefined;
1703
+ };
1704
+ })[] | undefined;
1705
+ }[];
1706
+ }, {
1707
+ transitions: {
1708
+ name: string;
1709
+ next: string;
1710
+ manual: boolean;
1711
+ disabled: boolean;
1712
+ criterion?: Criterion | undefined;
1713
+ processors?: ({
1714
+ name: string;
1715
+ type: "externalized";
1716
+ config?: ({
1717
+ attachEntity?: boolean | undefined;
1718
+ calculationNodesTags?: string | undefined;
1719
+ responseTimeoutMs?: number | undefined;
1720
+ retryPolicy?: string | undefined;
1721
+ context?: string | undefined;
1722
+ } & {
1723
+ asyncResult?: boolean | undefined;
1724
+ crossoverToAsyncMs?: number | undefined;
1725
+ }) | undefined;
1726
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1727
+ } | {
1728
+ name: string;
1729
+ type: "scheduled";
1730
+ config: {
1731
+ transition: string;
1732
+ delayMs: number;
1733
+ timeoutMs?: number | undefined;
1734
+ };
1735
+ })[] | undefined;
1736
+ }[];
1737
+ }>>, Record<string, {
1738
+ transitions: {
1739
+ name: string;
1740
+ next: string;
1741
+ manual: boolean;
1742
+ disabled: boolean;
1743
+ criterion?: Criterion | undefined;
1744
+ processors?: ({
1745
+ name: string;
1746
+ type: "externalized";
1747
+ config?: ({
1748
+ attachEntity?: boolean | undefined;
1749
+ calculationNodesTags?: string | undefined;
1750
+ responseTimeoutMs?: number | undefined;
1751
+ retryPolicy?: string | undefined;
1752
+ context?: string | undefined;
1753
+ } & {
1754
+ asyncResult?: boolean | undefined;
1755
+ crossoverToAsyncMs?: number | undefined;
1756
+ }) | undefined;
1757
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1758
+ } | {
1759
+ name: string;
1760
+ type: "scheduled";
1761
+ config: {
1762
+ transition: string;
1763
+ delayMs: number;
1764
+ timeoutMs?: number | undefined;
1765
+ };
1766
+ })[] | undefined;
1767
+ }[];
1768
+ }>, Record<string, {
1769
+ transitions: {
1770
+ name: string;
1771
+ next: string;
1772
+ manual: boolean;
1773
+ disabled: boolean;
1774
+ criterion?: Criterion | undefined;
1775
+ processors?: ({
1776
+ name: string;
1777
+ type: "externalized";
1778
+ config?: ({
1779
+ attachEntity?: boolean | undefined;
1780
+ calculationNodesTags?: string | undefined;
1781
+ responseTimeoutMs?: number | undefined;
1782
+ retryPolicy?: string | undefined;
1783
+ context?: string | undefined;
1784
+ } & {
1785
+ asyncResult?: boolean | undefined;
1786
+ crossoverToAsyncMs?: number | undefined;
1787
+ }) | undefined;
1788
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1789
+ } | {
1790
+ name: string;
1791
+ type: "scheduled";
1792
+ config: {
1793
+ transition: string;
1794
+ delayMs: number;
1795
+ timeoutMs?: number | undefined;
1796
+ };
1797
+ })[] | undefined;
1798
+ }[];
1799
+ }>>;
1800
+ }, "strip", z.ZodTypeAny, {
1801
+ version: string;
1802
+ active: boolean;
1803
+ name: string;
1804
+ initialState: string;
1805
+ states: Record<string, {
1806
+ transitions: {
1807
+ name: string;
1808
+ next: string;
1809
+ manual: boolean;
1810
+ disabled: boolean;
1811
+ criterion?: Criterion | undefined;
1812
+ processors?: ({
1813
+ name: string;
1814
+ type: "externalized";
1815
+ config?: ({
1816
+ attachEntity?: boolean | undefined;
1817
+ calculationNodesTags?: string | undefined;
1818
+ responseTimeoutMs?: number | undefined;
1819
+ retryPolicy?: string | undefined;
1820
+ context?: string | undefined;
1821
+ } & {
1822
+ asyncResult?: boolean | undefined;
1823
+ crossoverToAsyncMs?: number | undefined;
1824
+ }) | undefined;
1825
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1826
+ } | {
1827
+ name: string;
1828
+ type: "scheduled";
1829
+ config: {
1830
+ transition: string;
1831
+ delayMs: number;
1832
+ timeoutMs?: number | undefined;
1833
+ };
1834
+ })[] | undefined;
1835
+ }[];
1836
+ }>;
1837
+ desc?: string | undefined;
1838
+ criterion?: Criterion | undefined;
1839
+ }, {
1840
+ version: string;
1841
+ active: boolean;
1842
+ name: string;
1843
+ initialState: string;
1844
+ states: Record<string, {
1845
+ transitions: {
1846
+ name: string;
1847
+ next: string;
1848
+ manual: boolean;
1849
+ disabled: boolean;
1850
+ criterion?: Criterion | undefined;
1851
+ processors?: ({
1852
+ name: string;
1853
+ type: "externalized";
1854
+ config?: ({
1855
+ attachEntity?: boolean | undefined;
1856
+ calculationNodesTags?: string | undefined;
1857
+ responseTimeoutMs?: number | undefined;
1858
+ retryPolicy?: string | undefined;
1859
+ context?: string | undefined;
1860
+ } & {
1861
+ asyncResult?: boolean | undefined;
1862
+ crossoverToAsyncMs?: number | undefined;
1863
+ }) | undefined;
1864
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1865
+ } | {
1866
+ name: string;
1867
+ type: "scheduled";
1868
+ config: {
1869
+ transition: string;
1870
+ delayMs: number;
1871
+ timeoutMs?: number | undefined;
1872
+ };
1873
+ })[] | undefined;
1874
+ }[];
1875
+ }>;
1876
+ desc?: string | undefined;
1877
+ criterion?: Criterion | undefined;
1878
+ }>, "many">;
1879
+ }, "strip", z.ZodTypeAny, {
1880
+ importMode: "MERGE" | "REPLACE" | "ACTIVATE";
1881
+ workflows: {
1882
+ version: string;
1883
+ active: boolean;
1884
+ name: string;
1885
+ initialState: string;
1886
+ states: Record<string, {
1887
+ transitions: {
1888
+ name: string;
1889
+ next: string;
1890
+ manual: boolean;
1891
+ disabled: boolean;
1892
+ criterion?: Criterion | undefined;
1893
+ processors?: ({
1894
+ name: string;
1895
+ type: "externalized";
1896
+ config?: ({
1897
+ attachEntity?: boolean | undefined;
1898
+ calculationNodesTags?: string | undefined;
1899
+ responseTimeoutMs?: number | undefined;
1900
+ retryPolicy?: string | undefined;
1901
+ context?: string | undefined;
1902
+ } & {
1903
+ asyncResult?: boolean | undefined;
1904
+ crossoverToAsyncMs?: number | undefined;
1905
+ }) | undefined;
1906
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1907
+ } | {
1908
+ name: string;
1909
+ type: "scheduled";
1910
+ config: {
1911
+ transition: string;
1912
+ delayMs: number;
1913
+ timeoutMs?: number | undefined;
1914
+ };
1915
+ })[] | undefined;
1916
+ }[];
1917
+ }>;
1918
+ desc?: string | undefined;
1919
+ criterion?: Criterion | undefined;
1920
+ }[];
1921
+ }, {
1922
+ importMode: "MERGE" | "REPLACE" | "ACTIVATE";
1923
+ workflows: {
1924
+ version: string;
1925
+ active: boolean;
1926
+ name: string;
1927
+ initialState: string;
1928
+ states: Record<string, {
1929
+ transitions: {
1930
+ name: string;
1931
+ next: string;
1932
+ manual: boolean;
1933
+ disabled: boolean;
1934
+ criterion?: Criterion | undefined;
1935
+ processors?: ({
1936
+ name: string;
1937
+ type: "externalized";
1938
+ config?: ({
1939
+ attachEntity?: boolean | undefined;
1940
+ calculationNodesTags?: string | undefined;
1941
+ responseTimeoutMs?: number | undefined;
1942
+ retryPolicy?: string | undefined;
1943
+ context?: string | undefined;
1944
+ } & {
1945
+ asyncResult?: boolean | undefined;
1946
+ crossoverToAsyncMs?: number | undefined;
1947
+ }) | undefined;
1948
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1949
+ } | {
1950
+ name: string;
1951
+ type: "scheduled";
1952
+ config: {
1953
+ transition: string;
1954
+ delayMs: number;
1955
+ timeoutMs?: number | undefined;
1956
+ };
1957
+ })[] | undefined;
1958
+ }[];
1959
+ }>;
1960
+ desc?: string | undefined;
1961
+ criterion?: Criterion | undefined;
1962
+ }[];
1963
+ }>;
1964
+ declare const ExportPayloadSchema: z.ZodObject<{
1965
+ entityName: z.ZodString;
1966
+ modelVersion: z.ZodNumber;
1967
+ workflows: z.ZodArray<z.ZodObject<{
1968
+ version: z.ZodString;
1969
+ name: z.ZodString;
1970
+ desc: z.ZodOptional<z.ZodString>;
1971
+ initialState: z.ZodString;
1972
+ active: z.ZodBoolean;
1973
+ criterion: z.ZodOptional<z.ZodType<Criterion, z.ZodTypeDef, Criterion>>;
1974
+ states: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
1975
+ transitions: z.ZodArray<z.ZodObject<{
1976
+ name: z.ZodString;
1977
+ next: z.ZodString;
1978
+ manual: z.ZodBoolean;
1979
+ disabled: z.ZodBoolean;
1980
+ criterion: z.ZodOptional<z.ZodType<Criterion, z.ZodTypeDef, Criterion>>;
1981
+ processors: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1982
+ type: z.ZodLiteral<"externalized">;
1983
+ name: z.ZodString;
1984
+ executionMode: z.ZodOptional<z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX"]>>;
1985
+ config: z.ZodOptional<z.ZodIntersection<z.ZodObject<{
1986
+ attachEntity: z.ZodOptional<z.ZodBoolean>;
1987
+ calculationNodesTags: z.ZodOptional<z.ZodString>;
1988
+ responseTimeoutMs: z.ZodOptional<z.ZodNumber>;
1989
+ retryPolicy: z.ZodOptional<z.ZodString>;
1990
+ context: z.ZodOptional<z.ZodString>;
1991
+ }, "strip", z.ZodTypeAny, {
1992
+ attachEntity?: boolean | undefined;
1993
+ calculationNodesTags?: string | undefined;
1994
+ responseTimeoutMs?: number | undefined;
1995
+ retryPolicy?: string | undefined;
1996
+ context?: string | undefined;
1997
+ }, {
1998
+ attachEntity?: boolean | undefined;
1999
+ calculationNodesTags?: string | undefined;
2000
+ responseTimeoutMs?: number | undefined;
2001
+ retryPolicy?: string | undefined;
2002
+ context?: string | undefined;
2003
+ }>, z.ZodObject<{
2004
+ asyncResult: z.ZodOptional<z.ZodBoolean>;
2005
+ crossoverToAsyncMs: z.ZodOptional<z.ZodNumber>;
2006
+ }, "strip", z.ZodTypeAny, {
2007
+ asyncResult?: boolean | undefined;
2008
+ crossoverToAsyncMs?: number | undefined;
2009
+ }, {
2010
+ asyncResult?: boolean | undefined;
2011
+ crossoverToAsyncMs?: number | undefined;
2012
+ }>>>;
2013
+ }, "strip", z.ZodTypeAny, {
2014
+ name: string;
2015
+ type: "externalized";
2016
+ config?: ({
2017
+ attachEntity?: boolean | undefined;
2018
+ calculationNodesTags?: string | undefined;
2019
+ responseTimeoutMs?: number | undefined;
2020
+ retryPolicy?: string | undefined;
2021
+ context?: string | undefined;
2022
+ } & {
2023
+ asyncResult?: boolean | undefined;
2024
+ crossoverToAsyncMs?: number | undefined;
2025
+ }) | undefined;
2026
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2027
+ }, {
2028
+ name: string;
2029
+ type: "externalized";
2030
+ config?: ({
2031
+ attachEntity?: boolean | undefined;
2032
+ calculationNodesTags?: string | undefined;
2033
+ responseTimeoutMs?: number | undefined;
2034
+ retryPolicy?: string | undefined;
2035
+ context?: string | undefined;
2036
+ } & {
2037
+ asyncResult?: boolean | undefined;
2038
+ crossoverToAsyncMs?: number | undefined;
2039
+ }) | undefined;
2040
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2041
+ }>, z.ZodObject<{
2042
+ type: z.ZodLiteral<"scheduled">;
2043
+ name: z.ZodString;
2044
+ config: z.ZodObject<{
2045
+ delayMs: z.ZodNumber;
2046
+ transition: z.ZodString;
2047
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
2048
+ }, "strip", z.ZodTypeAny, {
2049
+ transition: string;
2050
+ delayMs: number;
2051
+ timeoutMs?: number | undefined;
2052
+ }, {
2053
+ transition: string;
2054
+ delayMs: number;
2055
+ timeoutMs?: number | undefined;
2056
+ }>;
2057
+ }, "strip", z.ZodTypeAny, {
2058
+ name: string;
2059
+ type: "scheduled";
2060
+ config: {
2061
+ transition: string;
2062
+ delayMs: number;
2063
+ timeoutMs?: number | undefined;
2064
+ };
2065
+ }, {
2066
+ name: string;
2067
+ type: "scheduled";
2068
+ config: {
2069
+ transition: string;
2070
+ delayMs: number;
2071
+ timeoutMs?: number | undefined;
2072
+ };
2073
+ }>]>, "many">>;
2074
+ }, "strip", z.ZodTypeAny, {
2075
+ name: string;
2076
+ next: string;
2077
+ manual: boolean;
2078
+ disabled: boolean;
2079
+ criterion?: Criterion | undefined;
2080
+ processors?: ({
2081
+ name: string;
2082
+ type: "externalized";
2083
+ config?: ({
2084
+ attachEntity?: boolean | undefined;
2085
+ calculationNodesTags?: string | undefined;
2086
+ responseTimeoutMs?: number | undefined;
2087
+ retryPolicy?: string | undefined;
2088
+ context?: string | undefined;
2089
+ } & {
2090
+ asyncResult?: boolean | undefined;
2091
+ crossoverToAsyncMs?: number | undefined;
2092
+ }) | undefined;
2093
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2094
+ } | {
2095
+ name: string;
2096
+ type: "scheduled";
2097
+ config: {
2098
+ transition: string;
2099
+ delayMs: number;
2100
+ timeoutMs?: number | undefined;
2101
+ };
2102
+ })[] | undefined;
2103
+ }, {
2104
+ name: string;
2105
+ next: string;
2106
+ manual: boolean;
2107
+ disabled: boolean;
2108
+ criterion?: Criterion | undefined;
2109
+ processors?: ({
2110
+ name: string;
2111
+ type: "externalized";
2112
+ config?: ({
2113
+ attachEntity?: boolean | undefined;
2114
+ calculationNodesTags?: string | undefined;
2115
+ responseTimeoutMs?: number | undefined;
2116
+ retryPolicy?: string | undefined;
2117
+ context?: string | undefined;
2118
+ } & {
2119
+ asyncResult?: boolean | undefined;
2120
+ crossoverToAsyncMs?: number | undefined;
2121
+ }) | undefined;
2122
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2123
+ } | {
2124
+ name: string;
2125
+ type: "scheduled";
2126
+ config: {
2127
+ transition: string;
2128
+ delayMs: number;
2129
+ timeoutMs?: number | undefined;
2130
+ };
2131
+ })[] | undefined;
2132
+ }>, "many">;
2133
+ }, "strip", z.ZodTypeAny, {
2134
+ transitions: {
2135
+ name: string;
2136
+ next: string;
2137
+ manual: boolean;
2138
+ disabled: boolean;
2139
+ criterion?: Criterion | undefined;
2140
+ processors?: ({
2141
+ name: string;
2142
+ type: "externalized";
2143
+ config?: ({
2144
+ attachEntity?: boolean | undefined;
2145
+ calculationNodesTags?: string | undefined;
2146
+ responseTimeoutMs?: number | undefined;
2147
+ retryPolicy?: string | undefined;
2148
+ context?: string | undefined;
2149
+ } & {
2150
+ asyncResult?: boolean | undefined;
2151
+ crossoverToAsyncMs?: number | undefined;
2152
+ }) | undefined;
2153
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2154
+ } | {
2155
+ name: string;
2156
+ type: "scheduled";
2157
+ config: {
2158
+ transition: string;
2159
+ delayMs: number;
2160
+ timeoutMs?: number | undefined;
2161
+ };
2162
+ })[] | undefined;
2163
+ }[];
2164
+ }, {
2165
+ transitions: {
2166
+ name: string;
2167
+ next: string;
2168
+ manual: boolean;
2169
+ disabled: boolean;
2170
+ criterion?: Criterion | undefined;
2171
+ processors?: ({
2172
+ name: string;
2173
+ type: "externalized";
2174
+ config?: ({
2175
+ attachEntity?: boolean | undefined;
2176
+ calculationNodesTags?: string | undefined;
2177
+ responseTimeoutMs?: number | undefined;
2178
+ retryPolicy?: string | undefined;
2179
+ context?: string | undefined;
2180
+ } & {
2181
+ asyncResult?: boolean | undefined;
2182
+ crossoverToAsyncMs?: number | undefined;
2183
+ }) | undefined;
2184
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2185
+ } | {
2186
+ name: string;
2187
+ type: "scheduled";
2188
+ config: {
2189
+ transition: string;
2190
+ delayMs: number;
2191
+ timeoutMs?: number | undefined;
2192
+ };
2193
+ })[] | undefined;
2194
+ }[];
2195
+ }>>, Record<string, {
2196
+ transitions: {
2197
+ name: string;
2198
+ next: string;
2199
+ manual: boolean;
2200
+ disabled: boolean;
2201
+ criterion?: Criterion | undefined;
2202
+ processors?: ({
2203
+ name: string;
2204
+ type: "externalized";
2205
+ config?: ({
2206
+ attachEntity?: boolean | undefined;
2207
+ calculationNodesTags?: string | undefined;
2208
+ responseTimeoutMs?: number | undefined;
2209
+ retryPolicy?: string | undefined;
2210
+ context?: string | undefined;
2211
+ } & {
2212
+ asyncResult?: boolean | undefined;
2213
+ crossoverToAsyncMs?: number | undefined;
2214
+ }) | undefined;
2215
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2216
+ } | {
2217
+ name: string;
2218
+ type: "scheduled";
2219
+ config: {
2220
+ transition: string;
2221
+ delayMs: number;
2222
+ timeoutMs?: number | undefined;
2223
+ };
2224
+ })[] | undefined;
2225
+ }[];
2226
+ }>, Record<string, {
2227
+ transitions: {
2228
+ name: string;
2229
+ next: string;
2230
+ manual: boolean;
2231
+ disabled: boolean;
2232
+ criterion?: Criterion | undefined;
2233
+ processors?: ({
2234
+ name: string;
2235
+ type: "externalized";
2236
+ config?: ({
2237
+ attachEntity?: boolean | undefined;
2238
+ calculationNodesTags?: string | undefined;
2239
+ responseTimeoutMs?: number | undefined;
2240
+ retryPolicy?: string | undefined;
2241
+ context?: string | undefined;
2242
+ } & {
2243
+ asyncResult?: boolean | undefined;
2244
+ crossoverToAsyncMs?: number | undefined;
2245
+ }) | undefined;
2246
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2247
+ } | {
2248
+ name: string;
2249
+ type: "scheduled";
2250
+ config: {
2251
+ transition: string;
2252
+ delayMs: number;
2253
+ timeoutMs?: number | undefined;
2254
+ };
2255
+ })[] | undefined;
2256
+ }[];
2257
+ }>>;
2258
+ }, "strip", z.ZodTypeAny, {
2259
+ version: string;
2260
+ active: boolean;
2261
+ name: string;
2262
+ initialState: string;
2263
+ states: Record<string, {
2264
+ transitions: {
2265
+ name: string;
2266
+ next: string;
2267
+ manual: boolean;
2268
+ disabled: boolean;
2269
+ criterion?: Criterion | undefined;
2270
+ processors?: ({
2271
+ name: string;
2272
+ type: "externalized";
2273
+ config?: ({
2274
+ attachEntity?: boolean | undefined;
2275
+ calculationNodesTags?: string | undefined;
2276
+ responseTimeoutMs?: number | undefined;
2277
+ retryPolicy?: string | undefined;
2278
+ context?: string | undefined;
2279
+ } & {
2280
+ asyncResult?: boolean | undefined;
2281
+ crossoverToAsyncMs?: number | undefined;
2282
+ }) | undefined;
2283
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2284
+ } | {
2285
+ name: string;
2286
+ type: "scheduled";
2287
+ config: {
2288
+ transition: string;
2289
+ delayMs: number;
2290
+ timeoutMs?: number | undefined;
2291
+ };
2292
+ })[] | undefined;
2293
+ }[];
2294
+ }>;
2295
+ desc?: string | undefined;
2296
+ criterion?: Criterion | undefined;
2297
+ }, {
2298
+ version: string;
2299
+ active: boolean;
2300
+ name: string;
2301
+ initialState: string;
2302
+ states: Record<string, {
2303
+ transitions: {
2304
+ name: string;
2305
+ next: string;
2306
+ manual: boolean;
2307
+ disabled: boolean;
2308
+ criterion?: Criterion | undefined;
2309
+ processors?: ({
2310
+ name: string;
2311
+ type: "externalized";
2312
+ config?: ({
2313
+ attachEntity?: boolean | undefined;
2314
+ calculationNodesTags?: string | undefined;
2315
+ responseTimeoutMs?: number | undefined;
2316
+ retryPolicy?: string | undefined;
2317
+ context?: string | undefined;
2318
+ } & {
2319
+ asyncResult?: boolean | undefined;
2320
+ crossoverToAsyncMs?: number | undefined;
2321
+ }) | undefined;
2322
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2323
+ } | {
2324
+ name: string;
2325
+ type: "scheduled";
2326
+ config: {
2327
+ transition: string;
2328
+ delayMs: number;
2329
+ timeoutMs?: number | undefined;
2330
+ };
2331
+ })[] | undefined;
2332
+ }[];
2333
+ }>;
2334
+ desc?: string | undefined;
2335
+ criterion?: Criterion | undefined;
2336
+ }>, "many">;
2337
+ }, "strip", z.ZodTypeAny, {
2338
+ workflows: {
2339
+ version: string;
2340
+ active: boolean;
2341
+ name: string;
2342
+ initialState: string;
2343
+ states: Record<string, {
2344
+ transitions: {
2345
+ name: string;
2346
+ next: string;
2347
+ manual: boolean;
2348
+ disabled: boolean;
2349
+ criterion?: Criterion | undefined;
2350
+ processors?: ({
2351
+ name: string;
2352
+ type: "externalized";
2353
+ config?: ({
2354
+ attachEntity?: boolean | undefined;
2355
+ calculationNodesTags?: string | undefined;
2356
+ responseTimeoutMs?: number | undefined;
2357
+ retryPolicy?: string | undefined;
2358
+ context?: string | undefined;
2359
+ } & {
2360
+ asyncResult?: boolean | undefined;
2361
+ crossoverToAsyncMs?: number | undefined;
2362
+ }) | undefined;
2363
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2364
+ } | {
2365
+ name: string;
2366
+ type: "scheduled";
2367
+ config: {
2368
+ transition: string;
2369
+ delayMs: number;
2370
+ timeoutMs?: number | undefined;
2371
+ };
2372
+ })[] | undefined;
2373
+ }[];
2374
+ }>;
2375
+ desc?: string | undefined;
2376
+ criterion?: Criterion | undefined;
2377
+ }[];
2378
+ entityName: string;
2379
+ modelVersion: number;
2380
+ }, {
2381
+ workflows: {
2382
+ version: string;
2383
+ active: boolean;
2384
+ name: string;
2385
+ initialState: string;
2386
+ states: Record<string, {
2387
+ transitions: {
2388
+ name: string;
2389
+ next: string;
2390
+ manual: boolean;
2391
+ disabled: boolean;
2392
+ criterion?: Criterion | undefined;
2393
+ processors?: ({
2394
+ name: string;
2395
+ type: "externalized";
2396
+ config?: ({
2397
+ attachEntity?: boolean | undefined;
2398
+ calculationNodesTags?: string | undefined;
2399
+ responseTimeoutMs?: number | undefined;
2400
+ retryPolicy?: string | undefined;
2401
+ context?: string | undefined;
2402
+ } & {
2403
+ asyncResult?: boolean | undefined;
2404
+ crossoverToAsyncMs?: number | undefined;
2405
+ }) | undefined;
2406
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2407
+ } | {
2408
+ name: string;
2409
+ type: "scheduled";
2410
+ config: {
2411
+ transition: string;
2412
+ delayMs: number;
2413
+ timeoutMs?: number | undefined;
2414
+ };
2415
+ })[] | undefined;
2416
+ }[];
2417
+ }>;
2418
+ desc?: string | undefined;
2419
+ criterion?: Criterion | undefined;
2420
+ }[];
2421
+ entityName: string;
2422
+ modelVersion: number;
2423
+ }>;
2424
+
2425
+ declare class SchemaError extends Error {
2426
+ readonly path?: (string | number)[] | undefined;
2427
+ constructor(message: string, path?: (string | number)[] | undefined);
2428
+ }
2429
+ declare class ParseJsonError extends Error {
2430
+ constructor(message: string);
2431
+ }
2432
+
2433
+ /**
2434
+ * Rewrite `operatorType` → `operation` in-place on a deep-cloned JSON tree.
2435
+ * If both are present and agree, drop `operatorType`.
2436
+ * If both are present and disagree, throw SchemaError.
2437
+ *
2438
+ * Only applies to criterion-shaped nodes (type: simple | lifecycle | array).
2439
+ */
2440
+ declare function normalizeOperatorAlias(raw: unknown): unknown;
2441
+
2442
+ interface ParseResult<T> {
2443
+ ok: boolean;
2444
+ value?: T;
2445
+ document?: WorkflowEditorDocument;
2446
+ issues: ValidationIssue[];
2447
+ }
2448
+ /**
2449
+ * Parse a Cyoda import-payload JSON string into a WorkflowEditorDocument.
2450
+ * Pipeline: JSON.parse → operator-alias normalisation → Zod → input normalisation
2451
+ * → assignSyntheticIds → semantic validation.
2452
+ */
2453
+ declare function parseImportPayload(json: string, prior?: EditorMetadata): ParseResult<ImportPayload>;
2454
+
2455
+ declare function parseExportPayload(json: string, prior?: EditorMetadata): ParseResult<ExportPayload>;
2456
+
2457
+ declare function parseEditorDocument(json: string): ParseResult<WorkflowEditorDocument>;
2458
+
2459
+ /**
2460
+ * Input normalization (spec §8.1) — runs after schema parse.
2461
+ * Mutates a deep-cloned structure; return the normalized form.
2462
+ *
2463
+ * 1. Drop empty optional containers (processors: [], criterion: {} already rejected by schema).
2464
+ * 2. Trim whitespace on name fields.
2465
+ * 3. Coerce numeric fields to integers — already enforced by Zod int().
2466
+ * 4. Coerce empty desc to undefined.
2467
+ */
2468
+ declare function normalizeWorkflowInput(workflow: Workflow): Workflow;
2469
+ declare function normalizeCriterion(criterion: Criterion): Criterion;
2470
+ declare function normalizeProcessor(p: Processor): Processor;
2471
+
2472
+ /**
2473
+ * Output normalization (spec §8.2) — deterministic shaping for serialization.
2474
+ * Returns plain objects in the exact keys the serializer will emit.
2475
+ */
2476
+ declare function outputWorkflow(w: Workflow): Record<string, unknown>;
2477
+ declare function outputTransition(t: Transition): Record<string, unknown>;
2478
+ declare function outputCriterion(c: Criterion): Record<string, unknown>;
2479
+ declare function outputProcessor(p: Processor): Record<string, unknown>;
2480
+ declare function outputFunctionConfig(cfg: NonNullable<Criterion extends {
2481
+ type: "function";
2482
+ } ? never : never> | FunctionConfig): Record<string, unknown>;
2483
+
2484
+ /**
2485
+ * Serialize an editor document as an ImportPayload JSON string.
2486
+ * Import payloads have keys ordered: importMode, workflows.
2487
+ */
2488
+ declare function serializeImportPayload(doc: WorkflowEditorDocument): string;
2489
+ /**
2490
+ * Serialize an editor document as an ExportPayload JSON string.
2491
+ * Export payloads have keys ordered: entityName, modelVersion, workflows.
2492
+ *
2493
+ * If the caller provides an `entity` override, it is used; otherwise the
2494
+ * session's entity is required (else throws).
2495
+ */
2496
+ declare function serializeExportPayload(doc: WorkflowEditorDocument, entity?: EntityIdentity): string;
2497
+ /**
2498
+ * Serialize the full editor document (session + metadata) for in-app persistence.
2499
+ * Not for export to Cyoda.
2500
+ */
2501
+ declare function serializeEditorDocument(doc: WorkflowEditorDocument): string;
2502
+
2503
+ /**
2504
+ * Deterministic pretty stringify — 2-space indent, LF line endings, trailing newline.
2505
+ * Assumes input object has its keys in the desired emission order; we preserve
2506
+ * insertion order (as V8 does for string keys).
2507
+ */
2508
+ declare function prettyStringify(value: unknown): string;
2509
+
2510
+ /**
2511
+ * Assign synthetic UUIDs to every addressable element. When `prior` is
2512
+ * provided, reuse IDs per spec §6.2:
2513
+ * - workflows reused by name;
2514
+ * - states reused by (workflow, stateCode);
2515
+ * - transitions reused by (workflow, state, ordinal-at-parse-time);
2516
+ * - processors reused by (transitionUuid, ordinal-at-parse-time).
2517
+ * Anything without a match is minted fresh.
2518
+ */
2519
+ declare function assignSyntheticIds(session: WorkflowSession, prior?: EditorMetadata): EditorMetadata;
2520
+ declare function mintCriterionIds(c: Criterion, host: HostRef, path: string[], ids: SyntheticIdMap): void;
2521
+
2522
+ type LookupResult = {
2523
+ kind: "workflow";
2524
+ workflow: Workflow;
2525
+ } | {
2526
+ kind: "state";
2527
+ workflow: Workflow;
2528
+ state: State;
2529
+ stateCode: string;
2530
+ } | {
2531
+ kind: "transition";
2532
+ workflow: Workflow;
2533
+ state: State;
2534
+ transition: Transition;
2535
+ } | {
2536
+ kind: "processor";
2537
+ transition: Transition;
2538
+ processor: Processor;
2539
+ } | {
2540
+ kind: "criterion";
2541
+ criterion: Criterion;
2542
+ parent: {
2543
+ host: HostRef;
2544
+ path: string[];
2545
+ };
2546
+ } | null;
2547
+ declare function lookupById(doc: WorkflowEditorDocument, uuid: string): LookupResult;
2548
+
2549
+ type IdRef = {
2550
+ kind: "workflow";
2551
+ workflow: string;
2552
+ } | {
2553
+ kind: "state";
2554
+ workflow: string;
2555
+ state: string;
2556
+ } | {
2557
+ kind: "transition";
2558
+ workflow: string;
2559
+ state: string;
2560
+ transitionName: string;
2561
+ ordinal: number;
2562
+ } | {
2563
+ kind: "processor";
2564
+ transitionUuid: string;
2565
+ processorName: string;
2566
+ ordinal: number;
2567
+ } | {
2568
+ kind: "criterion";
2569
+ host: HostRef;
2570
+ path: string[];
2571
+ };
2572
+ /**
2573
+ * Resolve an address-style reference to a synthetic UUID using the current metadata.
2574
+ * Returns `null` if no such ID exists.
2575
+ *
2576
+ * Transition lookups use (workflow, state) + ordinal: we return the Nth
2577
+ * transition UUID registered for that state (in insertion order).
2578
+ */
2579
+ declare function idFor(meta: EditorMetadata, ref: IdRef): string | null;
2580
+
2581
+ /**
2582
+ * Full semantic validation over a workflow session.
2583
+ * Returns all issues found; never throws.
2584
+ */
2585
+ declare function validateSemantics(session: WorkflowSession, doc?: WorkflowEditorDocument): ValidationIssue[];
2586
+
2587
+ /**
2588
+ * Convert a ZodError into ValidationIssue[] with `severity: "error"`.
2589
+ * The `code` is "schema-" + Zod's own error code; path is embedded in detail.
2590
+ */
2591
+ declare function zodErrorToIssues(err: ZodError): ValidationIssue[];
2592
+
2593
+ /**
2594
+ * Validate a raw payload against the ImportPayload schema. Returns any issues.
2595
+ */
2596
+ declare function validateImportSchema(raw: unknown): ValidationIssue[];
2597
+ /**
2598
+ * Validate a raw payload against the ExportPayload schema. Returns any issues.
2599
+ */
2600
+ declare function validateExportSchema(raw: unknown): ValidationIssue[];
2601
+ /**
2602
+ * Combined schema + semantic validation over a document.
2603
+ */
2604
+ declare function validateAll(doc: WorkflowEditorDocument): ValidationIssue[];
2605
+ /**
2606
+ * Combined schema + semantic validation over a session (without metadata).
2607
+ */
2608
+ declare function validateSession(session: WorkflowSession): ValidationIssue[];
2609
+
2610
+ /**
2611
+ * Apply a patch to a document, returning a new document.
2612
+ * - Refreshes synthetic IDs for the new session.
2613
+ * - Bumps revision.
2614
+ * - Re-runs semantic validation (issues stored separately; doc itself is the
2615
+ * canonical source, issues are computed via validateAll by callers).
2616
+ */
2617
+ declare function applyPatch(doc: WorkflowEditorDocument, patch: DomainPatch): WorkflowEditorDocument;
2618
+ /**
2619
+ * Convenience: apply multiple patches in sequence.
2620
+ */
2621
+ declare function applyPatches(doc: WorkflowEditorDocument, patches: DomainPatch[]): WorkflowEditorDocument;
2622
+ declare function validateAfterPatch(doc: WorkflowEditorDocument): ValidationIssue[];
2623
+
2624
+ /**
2625
+ * Produce the inverse of `patch` relative to the pre-apply document `doc`.
2626
+ * Applying `patch` to `doc`, then applying `invertPatch(doc, patch)` to the
2627
+ * result, returns a document equal to `doc` modulo `meta.revision`.
2628
+ *
2629
+ * Complex cascading operations (removeState, removeWorkflow, renameWorkflow,
2630
+ * replaceSession) invert via a captured-slice `replaceSession` — this is the
2631
+ * simplest provably correct inverse, at the cost of coarser undo grain.
2632
+ */
2633
+ declare function invertPatch(doc: WorkflowEditorDocument, patch: DomainPatch): DomainPatch;
2634
+
2635
+ type MigrationFn = (session: WorkflowSession) => WorkflowSession;
2636
+ interface MigrationEntry {
2637
+ from: string;
2638
+ to: string;
2639
+ migrate: MigrationFn;
2640
+ }
2641
+ declare function registerMigration(entry: MigrationEntry): void;
2642
+ declare function listMigrations(): readonly MigrationEntry[];
2643
+ declare function findMigrationPath(from: string, to: string): MigrationEntry[] | null;
2644
+ declare function migrateSession(session: WorkflowSession, from: string, to: string): WorkflowSession;
2645
+
2646
+ export { type ArrayCriterion, ArrayCriterionSchema, type ConcurrencyToken, type Criterion, type CriterionPointer, CriterionSchema, type DomainPatch, type EdgeAnchor, type EdgeAnchorPair, type EditorMetadata, type EditorViewport, type EntityFieldHintProvider, type EntityIdentity, type ExecutionMode, ExecutionModeSchema, type ExportPayload, ExportPayloadSchema, type ExportResult, type ExternalizedProcessor, type ExternalizedProcessorConfig, ExternalizedProcessorSchema, type FieldHint, type FunctionConfig, FunctionConfigSchema, type FunctionCriterion, FunctionCriterionSchema, type GroupCriterion, GroupCriterionSchema, type HostRef, type IdRef, type ImportMode, type ImportPayload, ImportPayloadSchema, type ImportResult, type JsonValue, type LifecycleCriterion, LifecycleCriterionSchema, type LookupResult, type MigrationEntry, type MigrationFn, NAME_REGEX, NameSchema, OPERATOR_TYPES, OperatorEnum, type OperatorType, ParseJsonError, type ParseResult, type Processor, type ProcessorPointer, ProcessorSchema, type SaveStatus, type ScheduledProcessor, ScheduledProcessorSchema, SchemaError, type Severity, type SimpleCriterion, SimpleCriterionSchema, type State, type StateCode, type StatePointer, StateSchema, type SyntheticIdMap, type Transition, type TransitionName, type TransitionPointer, TransitionSchema, type ValidationIssue, type Workflow, type WorkflowApi, WorkflowApiConflictError, WorkflowApiTransportError, type WorkflowEditorDocument, WorkflowSchema, type WorkflowSession, type WorkflowUiMeta, applyPatch, applyPatches, assignSyntheticIds, findMigrationPath, idFor, invertPatch, listMigrations, lookupById, migrateSession, mintCriterionIds, normalizeCriterion, normalizeOperatorAlias, normalizeProcessor, normalizeWorkflowInput, outputCriterion, outputFunctionConfig, outputProcessor, outputTransition, outputWorkflow, parseEditorDocument, parseExportPayload, parseImportPayload, prettyStringify, registerMigration, serializeEditorDocument, serializeExportPayload, serializeImportPayload, validateAfterPatch, validateAll, validateExportSchema, validateImportSchema, validateSemantics, validateSession, zodErrorToIssues };