@cyoda/workflow-core 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -47,11 +47,12 @@ interface FunctionConfig {
47
47
  }
48
48
 
49
49
  type Processor = ExternalizedProcessor | ScheduledProcessor;
50
- type ExecutionMode = "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX";
50
+ type ExecutionMode = "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH";
51
51
  interface ExternalizedProcessor {
52
52
  type: "externalized";
53
53
  name: string;
54
54
  executionMode?: ExecutionMode;
55
+ startNewTxOnDispatch?: boolean;
55
56
  config?: ExternalizedProcessorConfig;
56
57
  }
57
58
  interface ScheduledProcessor {
@@ -180,11 +181,27 @@ type HostRef = {
180
181
  * Editor-only anchor side for an edge endpoint. Lives in WorkflowUiMeta and
181
182
  * is never serialised into exported Cyoda JSON.
182
183
  */
183
- type EdgeAnchor = "top" | "right" | "bottom" | "left";
184
+ type EdgeAnchor = "top-left" | "top" | "top-right" | "right-top" | "right" | "right-bottom" | "bottom-left" | "bottom" | "bottom-right" | "left-top" | "left" | "left-bottom";
184
185
  interface EdgeAnchorPair {
185
186
  source?: EdgeAnchor;
186
187
  target?: EdgeAnchor;
187
188
  }
189
+ interface CommentMeta {
190
+ id: string;
191
+ text: string;
192
+ x: number;
193
+ y: number;
194
+ attachedTo?: {
195
+ kind: "state";
196
+ stateCode: string;
197
+ } | {
198
+ kind: "transition";
199
+ sourceState: string;
200
+ transitionName: string;
201
+ } | {
202
+ kind: "free";
203
+ };
204
+ }
188
205
  interface WorkflowUiMeta {
189
206
  layout?: {
190
207
  nodes: Record<StateCode, {
@@ -207,6 +224,11 @@ interface WorkflowUiMeta {
207
224
  * affordances and are never serialised into exported Cyoda JSON.
208
225
  */
209
226
  viewports?: Partial<Record<"vertical" | "horizontal", EditorViewport>>;
227
+ /**
228
+ * Canvas comments, keyed by comment id. Editor-only; never serialised into
229
+ * exported Cyoda JSON.
230
+ */
231
+ comments?: Record<string, CommentMeta>;
210
232
  }
211
233
 
212
234
  type DomainPatch = {
@@ -262,6 +284,12 @@ type DomainPatch = {
262
284
  fromState: StateCode;
263
285
  transitionUuid: string;
264
286
  toIndex: number;
287
+ } | {
288
+ op: "moveTransitionSource";
289
+ workflow: string;
290
+ fromState: StateCode;
291
+ toState: StateCode;
292
+ transitionName: string;
265
293
  } | {
266
294
  op: "addProcessor";
267
295
  transitionUuid: string;
@@ -303,8 +331,83 @@ type DomainPatch = {
303
331
  op: "setEdgeAnchors";
304
332
  transitionUuid: string;
305
333
  anchors: EdgeAnchorPair | null;
334
+ }
335
+ /**
336
+ * UI-only: persist a manual node position for a state.
337
+ * Writes to `meta.workflowUi[workflow].layout.nodes[stateCode]`.
338
+ * Does not touch `session.workflows`.
339
+ */
340
+ | {
341
+ op: "setNodePosition";
342
+ workflow: string;
343
+ stateCode: StateCode;
344
+ x: number;
345
+ y: number;
346
+ pinned?: boolean;
347
+ }
348
+ /**
349
+ * UI-only: remove a manual node position, allowing auto-layout to take over.
350
+ */
351
+ | {
352
+ op: "removeNodePosition";
353
+ workflow: string;
354
+ stateCode: StateCode;
355
+ }
356
+ /**
357
+ * UI-only: clear all manual node positions for a workflow (full layout reset).
358
+ */
359
+ | {
360
+ op: "resetLayout";
361
+ workflow: string;
362
+ }
363
+ /**
364
+ * UI-only: add a canvas comment.
365
+ * Writes to `meta.workflowUi[workflow].comments[comment.id]`.
366
+ */
367
+ | {
368
+ op: "addComment";
369
+ workflow: string;
370
+ comment: CommentMeta;
371
+ }
372
+ /**
373
+ * UI-only: update fields on an existing canvas comment.
374
+ */
375
+ | {
376
+ op: "updateComment";
377
+ workflow: string;
378
+ commentId: string;
379
+ updates: Partial<CommentMeta>;
380
+ }
381
+ /**
382
+ * UI-only: remove a canvas comment.
383
+ */
384
+ | {
385
+ op: "removeComment";
386
+ workflow: string;
387
+ commentId: string;
306
388
  };
307
389
 
390
+ /**
391
+ * A group of patches that form a single logical user action and therefore a
392
+ * single undo step. The caller is responsible for pre-computing both the
393
+ * forward `patches` and their exact `inverses` (in forward order — the undo
394
+ * machinery reverses and applies them in reverse order at undo time).
395
+ */
396
+ interface PatchTransaction {
397
+ summary: string;
398
+ patches: DomainPatch[];
399
+ inverses: DomainPatch[];
400
+ /** Selection to restore after the transaction is undone. */
401
+ selectionAfter?: unknown;
402
+ }
403
+ /**
404
+ * Thrown by applyPatch when a patch would create a name collision or other
405
+ * integrity violation.
406
+ */
407
+ declare class PatchConflictError extends Error {
408
+ constructor(message: string);
409
+ }
410
+
308
411
  /**
309
412
  * Opaque concurrency token returned by `exportWorkflows` and echoed back
310
413
  * on `importWorkflows` to enable 409 detection (spec §17.4).
@@ -564,11 +667,12 @@ declare const FunctionCriterionSchema: z.ZodLazy<z.ZodObject<{
564
667
  type: "function";
565
668
  }>>;
566
669
 
567
- declare const ExecutionModeSchema: z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX"]>;
670
+ declare const ExecutionModeSchema: z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX", "COMMIT_BEFORE_DISPATCH"]>;
568
671
  declare const ExternalizedProcessorSchema: z.ZodObject<{
569
672
  type: z.ZodLiteral<"externalized">;
570
673
  name: z.ZodString;
571
- executionMode: z.ZodOptional<z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX"]>>;
674
+ executionMode: z.ZodOptional<z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX", "COMMIT_BEFORE_DISPATCH"]>>;
675
+ startNewTxOnDispatch: z.ZodOptional<z.ZodBoolean>;
572
676
  config: z.ZodOptional<z.ZodIntersection<z.ZodObject<{
573
677
  attachEntity: z.ZodOptional<z.ZodBoolean>;
574
678
  calculationNodesTags: z.ZodOptional<z.ZodString>;
@@ -610,7 +714,8 @@ declare const ExternalizedProcessorSchema: z.ZodObject<{
610
714
  asyncResult?: boolean | undefined;
611
715
  crossoverToAsyncMs?: number | undefined;
612
716
  }) | undefined;
613
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
717
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
718
+ startNewTxOnDispatch?: boolean | undefined;
614
719
  }, {
615
720
  name: string;
616
721
  type: "externalized";
@@ -624,7 +729,8 @@ declare const ExternalizedProcessorSchema: z.ZodObject<{
624
729
  asyncResult?: boolean | undefined;
625
730
  crossoverToAsyncMs?: number | undefined;
626
731
  }) | undefined;
627
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
732
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
733
+ startNewTxOnDispatch?: boolean | undefined;
628
734
  }>;
629
735
  declare const ScheduledProcessorSchema: z.ZodObject<{
630
736
  type: z.ZodLiteral<"scheduled">;
@@ -662,7 +768,8 @@ declare const ScheduledProcessorSchema: z.ZodObject<{
662
768
  declare const ProcessorSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
663
769
  type: z.ZodLiteral<"externalized">;
664
770
  name: z.ZodString;
665
- executionMode: z.ZodOptional<z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX"]>>;
771
+ executionMode: z.ZodOptional<z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX", "COMMIT_BEFORE_DISPATCH"]>>;
772
+ startNewTxOnDispatch: z.ZodOptional<z.ZodBoolean>;
666
773
  config: z.ZodOptional<z.ZodIntersection<z.ZodObject<{
667
774
  attachEntity: z.ZodOptional<z.ZodBoolean>;
668
775
  calculationNodesTags: z.ZodOptional<z.ZodString>;
@@ -704,7 +811,8 @@ declare const ProcessorSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
704
811
  asyncResult?: boolean | undefined;
705
812
  crossoverToAsyncMs?: number | undefined;
706
813
  }) | undefined;
707
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
814
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
815
+ startNewTxOnDispatch?: boolean | undefined;
708
816
  }, {
709
817
  name: string;
710
818
  type: "externalized";
@@ -718,7 +826,8 @@ declare const ProcessorSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
718
826
  asyncResult?: boolean | undefined;
719
827
  crossoverToAsyncMs?: number | undefined;
720
828
  }) | undefined;
721
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
829
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
830
+ startNewTxOnDispatch?: boolean | undefined;
722
831
  }>, z.ZodObject<{
723
832
  type: z.ZodLiteral<"scheduled">;
724
833
  name: z.ZodString;
@@ -757,12 +866,13 @@ declare const TransitionSchema: z.ZodObject<{
757
866
  name: z.ZodString;
758
867
  next: z.ZodString;
759
868
  manual: z.ZodBoolean;
760
- disabled: z.ZodBoolean;
869
+ disabled: z.ZodDefault<z.ZodBoolean>;
761
870
  criterion: z.ZodOptional<z.ZodType<Criterion, z.ZodTypeDef, Criterion>>;
762
871
  processors: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
763
872
  type: z.ZodLiteral<"externalized">;
764
873
  name: z.ZodString;
765
- executionMode: z.ZodOptional<z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX"]>>;
874
+ executionMode: z.ZodOptional<z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX", "COMMIT_BEFORE_DISPATCH"]>>;
875
+ startNewTxOnDispatch: z.ZodOptional<z.ZodBoolean>;
766
876
  config: z.ZodOptional<z.ZodIntersection<z.ZodObject<{
767
877
  attachEntity: z.ZodOptional<z.ZodBoolean>;
768
878
  calculationNodesTags: z.ZodOptional<z.ZodString>;
@@ -804,7 +914,8 @@ declare const TransitionSchema: z.ZodObject<{
804
914
  asyncResult?: boolean | undefined;
805
915
  crossoverToAsyncMs?: number | undefined;
806
916
  }) | undefined;
807
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
917
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
918
+ startNewTxOnDispatch?: boolean | undefined;
808
919
  }, {
809
920
  name: string;
810
921
  type: "externalized";
@@ -818,7 +929,8 @@ declare const TransitionSchema: z.ZodObject<{
818
929
  asyncResult?: boolean | undefined;
819
930
  crossoverToAsyncMs?: number | undefined;
820
931
  }) | undefined;
821
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
932
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
933
+ startNewTxOnDispatch?: boolean | undefined;
822
934
  }>, z.ZodObject<{
823
935
  type: z.ZodLiteral<"scheduled">;
824
936
  name: z.ZodString;
@@ -871,7 +983,8 @@ declare const TransitionSchema: z.ZodObject<{
871
983
  asyncResult?: boolean | undefined;
872
984
  crossoverToAsyncMs?: number | undefined;
873
985
  }) | undefined;
874
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
986
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
987
+ startNewTxOnDispatch?: boolean | undefined;
875
988
  } | {
876
989
  name: string;
877
990
  type: "scheduled";
@@ -885,8 +998,8 @@ declare const TransitionSchema: z.ZodObject<{
885
998
  name: string;
886
999
  next: string;
887
1000
  manual: boolean;
888
- disabled: boolean;
889
1001
  criterion?: Criterion | undefined;
1002
+ disabled?: boolean | undefined;
890
1003
  processors?: ({
891
1004
  name: string;
892
1005
  type: "externalized";
@@ -900,7 +1013,8 @@ declare const TransitionSchema: z.ZodObject<{
900
1013
  asyncResult?: boolean | undefined;
901
1014
  crossoverToAsyncMs?: number | undefined;
902
1015
  }) | undefined;
903
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1016
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1017
+ startNewTxOnDispatch?: boolean | undefined;
904
1018
  } | {
905
1019
  name: string;
906
1020
  type: "scheduled";
@@ -916,12 +1030,13 @@ declare const StateSchema: z.ZodObject<{
916
1030
  name: z.ZodString;
917
1031
  next: z.ZodString;
918
1032
  manual: z.ZodBoolean;
919
- disabled: z.ZodBoolean;
1033
+ disabled: z.ZodDefault<z.ZodBoolean>;
920
1034
  criterion: z.ZodOptional<z.ZodType<Criterion, z.ZodTypeDef, Criterion>>;
921
1035
  processors: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
922
1036
  type: z.ZodLiteral<"externalized">;
923
1037
  name: z.ZodString;
924
- executionMode: z.ZodOptional<z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX"]>>;
1038
+ executionMode: z.ZodOptional<z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX", "COMMIT_BEFORE_DISPATCH"]>>;
1039
+ startNewTxOnDispatch: z.ZodOptional<z.ZodBoolean>;
925
1040
  config: z.ZodOptional<z.ZodIntersection<z.ZodObject<{
926
1041
  attachEntity: z.ZodOptional<z.ZodBoolean>;
927
1042
  calculationNodesTags: z.ZodOptional<z.ZodString>;
@@ -963,7 +1078,8 @@ declare const StateSchema: z.ZodObject<{
963
1078
  asyncResult?: boolean | undefined;
964
1079
  crossoverToAsyncMs?: number | undefined;
965
1080
  }) | undefined;
966
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1081
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1082
+ startNewTxOnDispatch?: boolean | undefined;
967
1083
  }, {
968
1084
  name: string;
969
1085
  type: "externalized";
@@ -977,7 +1093,8 @@ declare const StateSchema: z.ZodObject<{
977
1093
  asyncResult?: boolean | undefined;
978
1094
  crossoverToAsyncMs?: number | undefined;
979
1095
  }) | undefined;
980
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1096
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1097
+ startNewTxOnDispatch?: boolean | undefined;
981
1098
  }>, z.ZodObject<{
982
1099
  type: z.ZodLiteral<"scheduled">;
983
1100
  name: z.ZodString;
@@ -1030,7 +1147,8 @@ declare const StateSchema: z.ZodObject<{
1030
1147
  asyncResult?: boolean | undefined;
1031
1148
  crossoverToAsyncMs?: number | undefined;
1032
1149
  }) | undefined;
1033
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1150
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1151
+ startNewTxOnDispatch?: boolean | undefined;
1034
1152
  } | {
1035
1153
  name: string;
1036
1154
  type: "scheduled";
@@ -1044,8 +1162,8 @@ declare const StateSchema: z.ZodObject<{
1044
1162
  name: string;
1045
1163
  next: string;
1046
1164
  manual: boolean;
1047
- disabled: boolean;
1048
1165
  criterion?: Criterion | undefined;
1166
+ disabled?: boolean | undefined;
1049
1167
  processors?: ({
1050
1168
  name: string;
1051
1169
  type: "externalized";
@@ -1059,7 +1177,8 @@ declare const StateSchema: z.ZodObject<{
1059
1177
  asyncResult?: boolean | undefined;
1060
1178
  crossoverToAsyncMs?: number | undefined;
1061
1179
  }) | undefined;
1062
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1180
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1181
+ startNewTxOnDispatch?: boolean | undefined;
1063
1182
  } | {
1064
1183
  name: string;
1065
1184
  type: "scheduled";
@@ -1090,7 +1209,8 @@ declare const StateSchema: z.ZodObject<{
1090
1209
  asyncResult?: boolean | undefined;
1091
1210
  crossoverToAsyncMs?: number | undefined;
1092
1211
  }) | undefined;
1093
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1212
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1213
+ startNewTxOnDispatch?: boolean | undefined;
1094
1214
  } | {
1095
1215
  name: string;
1096
1216
  type: "scheduled";
@@ -1106,8 +1226,8 @@ declare const StateSchema: z.ZodObject<{
1106
1226
  name: string;
1107
1227
  next: string;
1108
1228
  manual: boolean;
1109
- disabled: boolean;
1110
1229
  criterion?: Criterion | undefined;
1230
+ disabled?: boolean | undefined;
1111
1231
  processors?: ({
1112
1232
  name: string;
1113
1233
  type: "externalized";
@@ -1121,7 +1241,8 @@ declare const StateSchema: z.ZodObject<{
1121
1241
  asyncResult?: boolean | undefined;
1122
1242
  crossoverToAsyncMs?: number | undefined;
1123
1243
  }) | undefined;
1124
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1244
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1245
+ startNewTxOnDispatch?: boolean | undefined;
1125
1246
  } | {
1126
1247
  name: string;
1127
1248
  type: "scheduled";
@@ -1145,12 +1266,13 @@ declare const WorkflowSchema: z.ZodObject<{
1145
1266
  name: z.ZodString;
1146
1267
  next: z.ZodString;
1147
1268
  manual: z.ZodBoolean;
1148
- disabled: z.ZodBoolean;
1269
+ disabled: z.ZodDefault<z.ZodBoolean>;
1149
1270
  criterion: z.ZodOptional<z.ZodType<Criterion, z.ZodTypeDef, Criterion>>;
1150
1271
  processors: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1151
1272
  type: z.ZodLiteral<"externalized">;
1152
1273
  name: z.ZodString;
1153
- executionMode: z.ZodOptional<z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX"]>>;
1274
+ executionMode: z.ZodOptional<z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX", "COMMIT_BEFORE_DISPATCH"]>>;
1275
+ startNewTxOnDispatch: z.ZodOptional<z.ZodBoolean>;
1154
1276
  config: z.ZodOptional<z.ZodIntersection<z.ZodObject<{
1155
1277
  attachEntity: z.ZodOptional<z.ZodBoolean>;
1156
1278
  calculationNodesTags: z.ZodOptional<z.ZodString>;
@@ -1192,7 +1314,8 @@ declare const WorkflowSchema: z.ZodObject<{
1192
1314
  asyncResult?: boolean | undefined;
1193
1315
  crossoverToAsyncMs?: number | undefined;
1194
1316
  }) | undefined;
1195
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1317
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1318
+ startNewTxOnDispatch?: boolean | undefined;
1196
1319
  }, {
1197
1320
  name: string;
1198
1321
  type: "externalized";
@@ -1206,7 +1329,8 @@ declare const WorkflowSchema: z.ZodObject<{
1206
1329
  asyncResult?: boolean | undefined;
1207
1330
  crossoverToAsyncMs?: number | undefined;
1208
1331
  }) | undefined;
1209
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1332
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1333
+ startNewTxOnDispatch?: boolean | undefined;
1210
1334
  }>, z.ZodObject<{
1211
1335
  type: z.ZodLiteral<"scheduled">;
1212
1336
  name: z.ZodString;
@@ -1259,7 +1383,8 @@ declare const WorkflowSchema: z.ZodObject<{
1259
1383
  asyncResult?: boolean | undefined;
1260
1384
  crossoverToAsyncMs?: number | undefined;
1261
1385
  }) | undefined;
1262
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1386
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1387
+ startNewTxOnDispatch?: boolean | undefined;
1263
1388
  } | {
1264
1389
  name: string;
1265
1390
  type: "scheduled";
@@ -1273,8 +1398,8 @@ declare const WorkflowSchema: z.ZodObject<{
1273
1398
  name: string;
1274
1399
  next: string;
1275
1400
  manual: boolean;
1276
- disabled: boolean;
1277
1401
  criterion?: Criterion | undefined;
1402
+ disabled?: boolean | undefined;
1278
1403
  processors?: ({
1279
1404
  name: string;
1280
1405
  type: "externalized";
@@ -1288,7 +1413,8 @@ declare const WorkflowSchema: z.ZodObject<{
1288
1413
  asyncResult?: boolean | undefined;
1289
1414
  crossoverToAsyncMs?: number | undefined;
1290
1415
  }) | undefined;
1291
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1416
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1417
+ startNewTxOnDispatch?: boolean | undefined;
1292
1418
  } | {
1293
1419
  name: string;
1294
1420
  type: "scheduled";
@@ -1319,7 +1445,8 @@ declare const WorkflowSchema: z.ZodObject<{
1319
1445
  asyncResult?: boolean | undefined;
1320
1446
  crossoverToAsyncMs?: number | undefined;
1321
1447
  }) | undefined;
1322
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1448
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1449
+ startNewTxOnDispatch?: boolean | undefined;
1323
1450
  } | {
1324
1451
  name: string;
1325
1452
  type: "scheduled";
@@ -1335,8 +1462,8 @@ declare const WorkflowSchema: z.ZodObject<{
1335
1462
  name: string;
1336
1463
  next: string;
1337
1464
  manual: boolean;
1338
- disabled: boolean;
1339
1465
  criterion?: Criterion | undefined;
1466
+ disabled?: boolean | undefined;
1340
1467
  processors?: ({
1341
1468
  name: string;
1342
1469
  type: "externalized";
@@ -1350,7 +1477,8 @@ declare const WorkflowSchema: z.ZodObject<{
1350
1477
  asyncResult?: boolean | undefined;
1351
1478
  crossoverToAsyncMs?: number | undefined;
1352
1479
  }) | undefined;
1353
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1480
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1481
+ startNewTxOnDispatch?: boolean | undefined;
1354
1482
  } | {
1355
1483
  name: string;
1356
1484
  type: "scheduled";
@@ -1381,7 +1509,8 @@ declare const WorkflowSchema: z.ZodObject<{
1381
1509
  asyncResult?: boolean | undefined;
1382
1510
  crossoverToAsyncMs?: number | undefined;
1383
1511
  }) | undefined;
1384
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1512
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1513
+ startNewTxOnDispatch?: boolean | undefined;
1385
1514
  } | {
1386
1515
  name: string;
1387
1516
  type: "scheduled";
@@ -1397,8 +1526,8 @@ declare const WorkflowSchema: z.ZodObject<{
1397
1526
  name: string;
1398
1527
  next: string;
1399
1528
  manual: boolean;
1400
- disabled: boolean;
1401
1529
  criterion?: Criterion | undefined;
1530
+ disabled?: boolean | undefined;
1402
1531
  processors?: ({
1403
1532
  name: string;
1404
1533
  type: "externalized";
@@ -1412,7 +1541,8 @@ declare const WorkflowSchema: z.ZodObject<{
1412
1541
  asyncResult?: boolean | undefined;
1413
1542
  crossoverToAsyncMs?: number | undefined;
1414
1543
  }) | undefined;
1415
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1544
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1545
+ startNewTxOnDispatch?: boolean | undefined;
1416
1546
  } | {
1417
1547
  name: string;
1418
1548
  type: "scheduled";
@@ -1449,7 +1579,8 @@ declare const WorkflowSchema: z.ZodObject<{
1449
1579
  asyncResult?: boolean | undefined;
1450
1580
  crossoverToAsyncMs?: number | undefined;
1451
1581
  }) | undefined;
1452
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1582
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1583
+ startNewTxOnDispatch?: boolean | undefined;
1453
1584
  } | {
1454
1585
  name: string;
1455
1586
  type: "scheduled";
@@ -1473,8 +1604,8 @@ declare const WorkflowSchema: z.ZodObject<{
1473
1604
  name: string;
1474
1605
  next: string;
1475
1606
  manual: boolean;
1476
- disabled: boolean;
1477
1607
  criterion?: Criterion | undefined;
1608
+ disabled?: boolean | undefined;
1478
1609
  processors?: ({
1479
1610
  name: string;
1480
1611
  type: "externalized";
@@ -1488,7 +1619,8 @@ declare const WorkflowSchema: z.ZodObject<{
1488
1619
  asyncResult?: boolean | undefined;
1489
1620
  crossoverToAsyncMs?: number | undefined;
1490
1621
  }) | undefined;
1491
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1622
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1623
+ startNewTxOnDispatch?: boolean | undefined;
1492
1624
  } | {
1493
1625
  name: string;
1494
1626
  type: "scheduled";
@@ -1518,12 +1650,13 @@ declare const ImportPayloadSchema: z.ZodObject<{
1518
1650
  name: z.ZodString;
1519
1651
  next: z.ZodString;
1520
1652
  manual: z.ZodBoolean;
1521
- disabled: z.ZodBoolean;
1653
+ disabled: z.ZodDefault<z.ZodBoolean>;
1522
1654
  criterion: z.ZodOptional<z.ZodType<Criterion, z.ZodTypeDef, Criterion>>;
1523
1655
  processors: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1524
1656
  type: z.ZodLiteral<"externalized">;
1525
1657
  name: z.ZodString;
1526
- executionMode: z.ZodOptional<z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX"]>>;
1658
+ executionMode: z.ZodOptional<z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX", "COMMIT_BEFORE_DISPATCH"]>>;
1659
+ startNewTxOnDispatch: z.ZodOptional<z.ZodBoolean>;
1527
1660
  config: z.ZodOptional<z.ZodIntersection<z.ZodObject<{
1528
1661
  attachEntity: z.ZodOptional<z.ZodBoolean>;
1529
1662
  calculationNodesTags: z.ZodOptional<z.ZodString>;
@@ -1565,7 +1698,8 @@ declare const ImportPayloadSchema: z.ZodObject<{
1565
1698
  asyncResult?: boolean | undefined;
1566
1699
  crossoverToAsyncMs?: number | undefined;
1567
1700
  }) | undefined;
1568
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1701
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1702
+ startNewTxOnDispatch?: boolean | undefined;
1569
1703
  }, {
1570
1704
  name: string;
1571
1705
  type: "externalized";
@@ -1579,7 +1713,8 @@ declare const ImportPayloadSchema: z.ZodObject<{
1579
1713
  asyncResult?: boolean | undefined;
1580
1714
  crossoverToAsyncMs?: number | undefined;
1581
1715
  }) | undefined;
1582
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1716
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1717
+ startNewTxOnDispatch?: boolean | undefined;
1583
1718
  }>, z.ZodObject<{
1584
1719
  type: z.ZodLiteral<"scheduled">;
1585
1720
  name: z.ZodString;
@@ -1632,7 +1767,8 @@ declare const ImportPayloadSchema: z.ZodObject<{
1632
1767
  asyncResult?: boolean | undefined;
1633
1768
  crossoverToAsyncMs?: number | undefined;
1634
1769
  }) | undefined;
1635
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1770
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1771
+ startNewTxOnDispatch?: boolean | undefined;
1636
1772
  } | {
1637
1773
  name: string;
1638
1774
  type: "scheduled";
@@ -1646,8 +1782,8 @@ declare const ImportPayloadSchema: z.ZodObject<{
1646
1782
  name: string;
1647
1783
  next: string;
1648
1784
  manual: boolean;
1649
- disabled: boolean;
1650
1785
  criterion?: Criterion | undefined;
1786
+ disabled?: boolean | undefined;
1651
1787
  processors?: ({
1652
1788
  name: string;
1653
1789
  type: "externalized";
@@ -1661,7 +1797,8 @@ declare const ImportPayloadSchema: z.ZodObject<{
1661
1797
  asyncResult?: boolean | undefined;
1662
1798
  crossoverToAsyncMs?: number | undefined;
1663
1799
  }) | undefined;
1664
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1800
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1801
+ startNewTxOnDispatch?: boolean | undefined;
1665
1802
  } | {
1666
1803
  name: string;
1667
1804
  type: "scheduled";
@@ -1692,7 +1829,8 @@ declare const ImportPayloadSchema: z.ZodObject<{
1692
1829
  asyncResult?: boolean | undefined;
1693
1830
  crossoverToAsyncMs?: number | undefined;
1694
1831
  }) | undefined;
1695
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1832
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1833
+ startNewTxOnDispatch?: boolean | undefined;
1696
1834
  } | {
1697
1835
  name: string;
1698
1836
  type: "scheduled";
@@ -1708,8 +1846,8 @@ declare const ImportPayloadSchema: z.ZodObject<{
1708
1846
  name: string;
1709
1847
  next: string;
1710
1848
  manual: boolean;
1711
- disabled: boolean;
1712
1849
  criterion?: Criterion | undefined;
1850
+ disabled?: boolean | undefined;
1713
1851
  processors?: ({
1714
1852
  name: string;
1715
1853
  type: "externalized";
@@ -1723,7 +1861,8 @@ declare const ImportPayloadSchema: z.ZodObject<{
1723
1861
  asyncResult?: boolean | undefined;
1724
1862
  crossoverToAsyncMs?: number | undefined;
1725
1863
  }) | undefined;
1726
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1864
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1865
+ startNewTxOnDispatch?: boolean | undefined;
1727
1866
  } | {
1728
1867
  name: string;
1729
1868
  type: "scheduled";
@@ -1754,7 +1893,8 @@ declare const ImportPayloadSchema: z.ZodObject<{
1754
1893
  asyncResult?: boolean | undefined;
1755
1894
  crossoverToAsyncMs?: number | undefined;
1756
1895
  }) | undefined;
1757
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1896
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1897
+ startNewTxOnDispatch?: boolean | undefined;
1758
1898
  } | {
1759
1899
  name: string;
1760
1900
  type: "scheduled";
@@ -1770,8 +1910,8 @@ declare const ImportPayloadSchema: z.ZodObject<{
1770
1910
  name: string;
1771
1911
  next: string;
1772
1912
  manual: boolean;
1773
- disabled: boolean;
1774
1913
  criterion?: Criterion | undefined;
1914
+ disabled?: boolean | undefined;
1775
1915
  processors?: ({
1776
1916
  name: string;
1777
1917
  type: "externalized";
@@ -1785,7 +1925,8 @@ declare const ImportPayloadSchema: z.ZodObject<{
1785
1925
  asyncResult?: boolean | undefined;
1786
1926
  crossoverToAsyncMs?: number | undefined;
1787
1927
  }) | undefined;
1788
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1928
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1929
+ startNewTxOnDispatch?: boolean | undefined;
1789
1930
  } | {
1790
1931
  name: string;
1791
1932
  type: "scheduled";
@@ -1822,7 +1963,8 @@ declare const ImportPayloadSchema: z.ZodObject<{
1822
1963
  asyncResult?: boolean | undefined;
1823
1964
  crossoverToAsyncMs?: number | undefined;
1824
1965
  }) | undefined;
1825
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
1966
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
1967
+ startNewTxOnDispatch?: boolean | undefined;
1826
1968
  } | {
1827
1969
  name: string;
1828
1970
  type: "scheduled";
@@ -1846,8 +1988,8 @@ declare const ImportPayloadSchema: z.ZodObject<{
1846
1988
  name: string;
1847
1989
  next: string;
1848
1990
  manual: boolean;
1849
- disabled: boolean;
1850
1991
  criterion?: Criterion | undefined;
1992
+ disabled?: boolean | undefined;
1851
1993
  processors?: ({
1852
1994
  name: string;
1853
1995
  type: "externalized";
@@ -1861,7 +2003,8 @@ declare const ImportPayloadSchema: z.ZodObject<{
1861
2003
  asyncResult?: boolean | undefined;
1862
2004
  crossoverToAsyncMs?: number | undefined;
1863
2005
  }) | undefined;
1864
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2006
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
2007
+ startNewTxOnDispatch?: boolean | undefined;
1865
2008
  } | {
1866
2009
  name: string;
1867
2010
  type: "scheduled";
@@ -1903,7 +2046,8 @@ declare const ImportPayloadSchema: z.ZodObject<{
1903
2046
  asyncResult?: boolean | undefined;
1904
2047
  crossoverToAsyncMs?: number | undefined;
1905
2048
  }) | undefined;
1906
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2049
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
2050
+ startNewTxOnDispatch?: boolean | undefined;
1907
2051
  } | {
1908
2052
  name: string;
1909
2053
  type: "scheduled";
@@ -1930,8 +2074,8 @@ declare const ImportPayloadSchema: z.ZodObject<{
1930
2074
  name: string;
1931
2075
  next: string;
1932
2076
  manual: boolean;
1933
- disabled: boolean;
1934
2077
  criterion?: Criterion | undefined;
2078
+ disabled?: boolean | undefined;
1935
2079
  processors?: ({
1936
2080
  name: string;
1937
2081
  type: "externalized";
@@ -1945,7 +2089,8 @@ declare const ImportPayloadSchema: z.ZodObject<{
1945
2089
  asyncResult?: boolean | undefined;
1946
2090
  crossoverToAsyncMs?: number | undefined;
1947
2091
  }) | undefined;
1948
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2092
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
2093
+ startNewTxOnDispatch?: boolean | undefined;
1949
2094
  } | {
1950
2095
  name: string;
1951
2096
  type: "scheduled";
@@ -1976,12 +2121,13 @@ declare const ExportPayloadSchema: z.ZodObject<{
1976
2121
  name: z.ZodString;
1977
2122
  next: z.ZodString;
1978
2123
  manual: z.ZodBoolean;
1979
- disabled: z.ZodBoolean;
2124
+ disabled: z.ZodDefault<z.ZodBoolean>;
1980
2125
  criterion: z.ZodOptional<z.ZodType<Criterion, z.ZodTypeDef, Criterion>>;
1981
2126
  processors: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1982
2127
  type: z.ZodLiteral<"externalized">;
1983
2128
  name: z.ZodString;
1984
- executionMode: z.ZodOptional<z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX"]>>;
2129
+ executionMode: z.ZodOptional<z.ZodEnum<["SYNC", "ASYNC_SAME_TX", "ASYNC_NEW_TX", "COMMIT_BEFORE_DISPATCH"]>>;
2130
+ startNewTxOnDispatch: z.ZodOptional<z.ZodBoolean>;
1985
2131
  config: z.ZodOptional<z.ZodIntersection<z.ZodObject<{
1986
2132
  attachEntity: z.ZodOptional<z.ZodBoolean>;
1987
2133
  calculationNodesTags: z.ZodOptional<z.ZodString>;
@@ -2023,7 +2169,8 @@ declare const ExportPayloadSchema: z.ZodObject<{
2023
2169
  asyncResult?: boolean | undefined;
2024
2170
  crossoverToAsyncMs?: number | undefined;
2025
2171
  }) | undefined;
2026
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2172
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
2173
+ startNewTxOnDispatch?: boolean | undefined;
2027
2174
  }, {
2028
2175
  name: string;
2029
2176
  type: "externalized";
@@ -2037,7 +2184,8 @@ declare const ExportPayloadSchema: z.ZodObject<{
2037
2184
  asyncResult?: boolean | undefined;
2038
2185
  crossoverToAsyncMs?: number | undefined;
2039
2186
  }) | undefined;
2040
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2187
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
2188
+ startNewTxOnDispatch?: boolean | undefined;
2041
2189
  }>, z.ZodObject<{
2042
2190
  type: z.ZodLiteral<"scheduled">;
2043
2191
  name: z.ZodString;
@@ -2090,7 +2238,8 @@ declare const ExportPayloadSchema: z.ZodObject<{
2090
2238
  asyncResult?: boolean | undefined;
2091
2239
  crossoverToAsyncMs?: number | undefined;
2092
2240
  }) | undefined;
2093
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2241
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
2242
+ startNewTxOnDispatch?: boolean | undefined;
2094
2243
  } | {
2095
2244
  name: string;
2096
2245
  type: "scheduled";
@@ -2104,8 +2253,8 @@ declare const ExportPayloadSchema: z.ZodObject<{
2104
2253
  name: string;
2105
2254
  next: string;
2106
2255
  manual: boolean;
2107
- disabled: boolean;
2108
2256
  criterion?: Criterion | undefined;
2257
+ disabled?: boolean | undefined;
2109
2258
  processors?: ({
2110
2259
  name: string;
2111
2260
  type: "externalized";
@@ -2119,7 +2268,8 @@ declare const ExportPayloadSchema: z.ZodObject<{
2119
2268
  asyncResult?: boolean | undefined;
2120
2269
  crossoverToAsyncMs?: number | undefined;
2121
2270
  }) | undefined;
2122
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2271
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
2272
+ startNewTxOnDispatch?: boolean | undefined;
2123
2273
  } | {
2124
2274
  name: string;
2125
2275
  type: "scheduled";
@@ -2150,7 +2300,8 @@ declare const ExportPayloadSchema: z.ZodObject<{
2150
2300
  asyncResult?: boolean | undefined;
2151
2301
  crossoverToAsyncMs?: number | undefined;
2152
2302
  }) | undefined;
2153
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2303
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
2304
+ startNewTxOnDispatch?: boolean | undefined;
2154
2305
  } | {
2155
2306
  name: string;
2156
2307
  type: "scheduled";
@@ -2166,8 +2317,8 @@ declare const ExportPayloadSchema: z.ZodObject<{
2166
2317
  name: string;
2167
2318
  next: string;
2168
2319
  manual: boolean;
2169
- disabled: boolean;
2170
2320
  criterion?: Criterion | undefined;
2321
+ disabled?: boolean | undefined;
2171
2322
  processors?: ({
2172
2323
  name: string;
2173
2324
  type: "externalized";
@@ -2181,7 +2332,8 @@ declare const ExportPayloadSchema: z.ZodObject<{
2181
2332
  asyncResult?: boolean | undefined;
2182
2333
  crossoverToAsyncMs?: number | undefined;
2183
2334
  }) | undefined;
2184
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2335
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
2336
+ startNewTxOnDispatch?: boolean | undefined;
2185
2337
  } | {
2186
2338
  name: string;
2187
2339
  type: "scheduled";
@@ -2212,7 +2364,8 @@ declare const ExportPayloadSchema: z.ZodObject<{
2212
2364
  asyncResult?: boolean | undefined;
2213
2365
  crossoverToAsyncMs?: number | undefined;
2214
2366
  }) | undefined;
2215
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2367
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
2368
+ startNewTxOnDispatch?: boolean | undefined;
2216
2369
  } | {
2217
2370
  name: string;
2218
2371
  type: "scheduled";
@@ -2228,8 +2381,8 @@ declare const ExportPayloadSchema: z.ZodObject<{
2228
2381
  name: string;
2229
2382
  next: string;
2230
2383
  manual: boolean;
2231
- disabled: boolean;
2232
2384
  criterion?: Criterion | undefined;
2385
+ disabled?: boolean | undefined;
2233
2386
  processors?: ({
2234
2387
  name: string;
2235
2388
  type: "externalized";
@@ -2243,7 +2396,8 @@ declare const ExportPayloadSchema: z.ZodObject<{
2243
2396
  asyncResult?: boolean | undefined;
2244
2397
  crossoverToAsyncMs?: number | undefined;
2245
2398
  }) | undefined;
2246
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2399
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
2400
+ startNewTxOnDispatch?: boolean | undefined;
2247
2401
  } | {
2248
2402
  name: string;
2249
2403
  type: "scheduled";
@@ -2280,7 +2434,8 @@ declare const ExportPayloadSchema: z.ZodObject<{
2280
2434
  asyncResult?: boolean | undefined;
2281
2435
  crossoverToAsyncMs?: number | undefined;
2282
2436
  }) | undefined;
2283
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2437
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
2438
+ startNewTxOnDispatch?: boolean | undefined;
2284
2439
  } | {
2285
2440
  name: string;
2286
2441
  type: "scheduled";
@@ -2304,8 +2459,8 @@ declare const ExportPayloadSchema: z.ZodObject<{
2304
2459
  name: string;
2305
2460
  next: string;
2306
2461
  manual: boolean;
2307
- disabled: boolean;
2308
2462
  criterion?: Criterion | undefined;
2463
+ disabled?: boolean | undefined;
2309
2464
  processors?: ({
2310
2465
  name: string;
2311
2466
  type: "externalized";
@@ -2319,7 +2474,8 @@ declare const ExportPayloadSchema: z.ZodObject<{
2319
2474
  asyncResult?: boolean | undefined;
2320
2475
  crossoverToAsyncMs?: number | undefined;
2321
2476
  }) | undefined;
2322
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2477
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
2478
+ startNewTxOnDispatch?: boolean | undefined;
2323
2479
  } | {
2324
2480
  name: string;
2325
2481
  type: "scheduled";
@@ -2360,7 +2516,8 @@ declare const ExportPayloadSchema: z.ZodObject<{
2360
2516
  asyncResult?: boolean | undefined;
2361
2517
  crossoverToAsyncMs?: number | undefined;
2362
2518
  }) | undefined;
2363
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2519
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
2520
+ startNewTxOnDispatch?: boolean | undefined;
2364
2521
  } | {
2365
2522
  name: string;
2366
2523
  type: "scheduled";
@@ -2388,8 +2545,8 @@ declare const ExportPayloadSchema: z.ZodObject<{
2388
2545
  name: string;
2389
2546
  next: string;
2390
2547
  manual: boolean;
2391
- disabled: boolean;
2392
2548
  criterion?: Criterion | undefined;
2549
+ disabled?: boolean | undefined;
2393
2550
  processors?: ({
2394
2551
  name: string;
2395
2552
  type: "externalized";
@@ -2403,7 +2560,8 @@ declare const ExportPayloadSchema: z.ZodObject<{
2403
2560
  asyncResult?: boolean | undefined;
2404
2561
  crossoverToAsyncMs?: number | undefined;
2405
2562
  }) | undefined;
2406
- executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | undefined;
2563
+ executionMode?: "SYNC" | "ASYNC_SAME_TX" | "ASYNC_NEW_TX" | "COMMIT_BEFORE_DISPATCH" | undefined;
2564
+ startNewTxOnDispatch?: boolean | undefined;
2407
2565
  } | {
2408
2566
  name: string;
2409
2567
  type: "scheduled";
@@ -2439,6 +2597,14 @@ declare class ParseJsonError extends Error {
2439
2597
  */
2440
2598
  declare function normalizeOperatorAlias(raw: unknown): unknown;
2441
2599
 
2600
+ /** Maximum JSON string length accepted by the parser (5 MB). */
2601
+ declare const MAX_JSON_BYTES: number;
2602
+ /**
2603
+ * Maximum JSON object/array nesting depth accepted before any recursive
2604
+ * processing begins. Prevents stack overflows in `normalizeOperatorAlias`,
2605
+ * Zod's recursive criterion schema, and downstream traversal helpers.
2606
+ */
2607
+ declare const MAX_JSON_OBJECT_DEPTH = 200;
2442
2608
  interface ParseResult<T> {
2443
2609
  ok: boolean;
2444
2610
  value?: T;
@@ -2447,8 +2613,8 @@ interface ParseResult<T> {
2447
2613
  }
2448
2614
  /**
2449
2615
  * Parse a Cyoda import-payload JSON string into a WorkflowEditorDocument.
2450
- * Pipeline: JSON.parse → operator-alias normalisationZod → input normalisation
2451
- * → assignSyntheticIds → semantic validation.
2616
+ * Pipeline: size guard → JSON.parse → depth guardoperator-alias normalisation
2617
+ * → Zod → input normalisation → assignSyntheticIds → semantic validation.
2452
2618
  */
2453
2619
  declare function parseImportPayload(json: string, prior?: EditorMetadata): ParseResult<ImportPayload>;
2454
2620
 
@@ -2466,7 +2632,7 @@ declare function parseEditorDocument(json: string): ParseResult<WorkflowEditorDo
2466
2632
  * 4. Coerce empty desc to undefined.
2467
2633
  */
2468
2634
  declare function normalizeWorkflowInput(workflow: Workflow): Workflow;
2469
- declare function normalizeCriterion(criterion: Criterion): Criterion;
2635
+ declare function normalizeCriterion(criterion: Criterion, depth?: number): Criterion;
2470
2636
  declare function normalizeProcessor(p: Processor): Processor;
2471
2637
 
2472
2638
  /**
@@ -2626,12 +2792,31 @@ declare function validateAfterPatch(doc: WorkflowEditorDocument): ValidationIssu
2626
2792
  * Applying `patch` to `doc`, then applying `invertPatch(doc, patch)` to the
2627
2793
  * result, returns a document equal to `doc` modulo `meta.revision`.
2628
2794
  *
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.
2795
+ * Notes:
2796
+ * - `addTransition` and `addProcessor` cannot determine the newly minted UUID
2797
+ * from the pre-apply doc alone; callers that need exact inverses for these
2798
+ * should use `dispatchTransaction` and supply the inverse explicitly.
2799
+ * - `removeWorkflow`, `renameWorkflow`, and `removeState` invert via a captured
2800
+ * `replaceSession` snapshot — correct but coarse.
2632
2801
  */
2633
2802
  declare function invertPatch(doc: WorkflowEditorDocument, patch: DomainPatch): DomainPatch;
2634
2803
 
2804
+ /**
2805
+ * Apply all patches in a transaction in sequence and return the resulting doc.
2806
+ */
2807
+ declare function applyTransaction(doc: WorkflowEditorDocument, tx: PatchTransaction): WorkflowEditorDocument;
2808
+ /**
2809
+ * Build the inverse of a transaction.
2810
+ *
2811
+ * Convention: `tx.inverses` contains the inverse patches in UNDO-APPLICATION
2812
+ * ORDER (i.e. the last patch is undone first). `invertTransaction` simply uses
2813
+ * `tx.inverses` as the forward patches of the returned transaction.
2814
+ *
2815
+ * If `tx.inverses` is empty, falls back to computing each inverse
2816
+ * individually from `doc` and reversing to get the correct undo order.
2817
+ */
2818
+ declare function invertTransaction(doc: WorkflowEditorDocument, tx: PatchTransaction): PatchTransaction;
2819
+
2635
2820
  type MigrationFn = (session: WorkflowSession) => WorkflowSession;
2636
2821
  interface MigrationEntry {
2637
2822
  from: string;
@@ -2643,4 +2828,30 @@ declare function listMigrations(): readonly MigrationEntry[];
2643
2828
  declare function findMigrationPath(from: string, to: string): MigrationEntry[] | null;
2644
2829
  declare function migrateSession(session: WorkflowSession, from: string, to: string): WorkflowSession;
2645
2830
 
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 };
2831
+ declare const SUPPORTED_SIMPLE_OPERATORS: ReadonlySet<OperatorType>;
2832
+ declare const UNSUPPORTED_OPERATORS: ReadonlySet<OperatorType>;
2833
+ declare const SUPPORTED_GROUP_OPERATORS: readonly ["AND", "OR"];
2834
+ declare const MAX_CRITERION_DEPTH = 50;
2835
+ declare const CRITERION_DEPTH_WARNING_THRESHOLD = 5;
2836
+ type OperatorGroupId = "equality" | "ordering" | "range" | "substring" | "pattern" | "null";
2837
+ interface OperatorGroup {
2838
+ readonly id: OperatorGroupId;
2839
+ readonly label: string;
2840
+ readonly operators: readonly OperatorType[];
2841
+ }
2842
+ declare const OPERATOR_GROUPS: readonly OperatorGroup[];
2843
+ type OperatorValueShape = "scalar" | "range" | "none";
2844
+ declare const OPERATOR_VALUE_SHAPE: Readonly<Record<OperatorType, OperatorValueShape>>;
2845
+
2846
+ type JsonPathRejectReason = "empty" | "missing-root" | "recursive-descent" | "filter-expression" | "malformed";
2847
+ type JsonPathValidationResult = {
2848
+ ok: true;
2849
+ } | {
2850
+ ok: false;
2851
+ reason: JsonPathRejectReason;
2852
+ };
2853
+ declare function validateJsonPathSubset(path: string): JsonPathValidationResult;
2854
+
2855
+ declare function describeCriterion(c: Criterion): string;
2856
+
2857
+ export { type ArrayCriterion, ArrayCriterionSchema, CRITERION_DEPTH_WARNING_THRESHOLD, type CommentMeta, 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 JsonPathRejectReason, type JsonPathValidationResult, type JsonValue, type LifecycleCriterion, LifecycleCriterionSchema, type LookupResult, MAX_CRITERION_DEPTH, MAX_JSON_BYTES, MAX_JSON_OBJECT_DEPTH, type MigrationEntry, type MigrationFn, NAME_REGEX, NameSchema, OPERATOR_GROUPS, OPERATOR_TYPES, OPERATOR_VALUE_SHAPE, OperatorEnum, type OperatorGroup, type OperatorGroupId, type OperatorType, type OperatorValueShape, ParseJsonError, type ParseResult, PatchConflictError, type PatchTransaction, type Processor, type ProcessorPointer, ProcessorSchema, SUPPORTED_GROUP_OPERATORS, SUPPORTED_SIMPLE_OPERATORS, 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, UNSUPPORTED_OPERATORS, type ValidationIssue, type Workflow, type WorkflowApi, WorkflowApiConflictError, WorkflowApiTransportError, type WorkflowEditorDocument, WorkflowSchema, type WorkflowSession, type WorkflowUiMeta, applyPatch, applyPatches, applyTransaction, assignSyntheticIds, describeCriterion, findMigrationPath, idFor, invertPatch, invertTransaction, 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, validateJsonPathSubset, validateSemantics, validateSession, zodErrorToIssues };