@bpmnkit/core 1.0.0 → 1.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.
Files changed (64) hide show
  1. package/README.md +25 -3
  2. package/dist/bpmn/agentic.js +3 -1
  3. package/dist/bpmn/auto-layout.js +184 -15
  4. package/dist/bpmn/bpmn-builder.js +69 -7
  5. package/dist/bpmn/bpmn-model.d.ts +78 -0
  6. package/dist/bpmn/bpmn-parser.js +195 -37
  7. package/dist/bpmn/bpmn-serializer.js +121 -72
  8. package/dist/bpmn/bpmnlint.d.ts +153 -0
  9. package/dist/bpmn/bpmnlint.js +364 -0
  10. package/dist/bpmn/camunda-compat-data.d.ts +165 -0
  11. package/dist/bpmn/camunda-compat-data.js +423 -0
  12. package/dist/bpmn/camunda-compat-feel.d.ts +68 -0
  13. package/dist/bpmn/camunda-compat-feel.js +338 -0
  14. package/dist/bpmn/camunda-compat.d.ts +120 -0
  15. package/dist/bpmn/camunda-compat.js +1677 -0
  16. package/dist/bpmn/camunda7/juel.d.ts +41 -0
  17. package/dist/bpmn/camunda7/juel.js +333 -0
  18. package/dist/bpmn/camunda7/migrate.d.ts +72 -0
  19. package/dist/bpmn/camunda7/migrate.js +1152 -0
  20. package/dist/bpmn/full-operations.js +5 -2
  21. package/dist/bpmn/label-style.d.ts +51 -0
  22. package/dist/bpmn/label-style.js +116 -0
  23. package/dist/bpmn/lint.d.ts +23 -3
  24. package/dist/bpmn/lint.js +47 -10
  25. package/dist/bpmn/optimize/bpmnlint-rules.d.ts +31 -0
  26. package/dist/bpmn/optimize/bpmnlint-rules.js +916 -0
  27. package/dist/bpmn/optimize/deploy.d.ts +8 -2
  28. package/dist/bpmn/optimize/deploy.js +16 -3
  29. package/dist/bpmn/optimize/index.js +11 -2
  30. package/dist/bpmn/optimize/types.d.ts +14 -0
  31. package/dist/bpmn/optimize/variable-flow.js +4 -1
  32. package/dist/bpmn/process-types.d.ts +112 -0
  33. package/dist/bpmn/process-types.js +490 -0
  34. package/dist/bpmn/svg.js +51 -22
  35. package/dist/doc/docx.d.ts +20 -0
  36. package/dist/doc/docx.js +253 -0
  37. package/dist/doc/html.d.ts +21 -0
  38. package/dist/doc/html.js +303 -0
  39. package/dist/doc/index.d.ts +7 -0
  40. package/dist/doc/index.js +5 -0
  41. package/dist/doc/markdown.d.ts +11 -0
  42. package/dist/doc/markdown.js +160 -0
  43. package/dist/doc/model.d.ts +129 -0
  44. package/dist/doc/model.js +617 -0
  45. package/dist/doc/zip.d.ts +5 -0
  46. package/dist/doc/zip.js +75 -0
  47. package/dist/index.d.ts +16 -0
  48. package/dist/index.js +8 -0
  49. package/dist/layout/annotations.d.ts +4 -2
  50. package/dist/layout/annotations.js +31 -2
  51. package/dist/layout/collaboration/ordering.d.ts +8 -0
  52. package/dist/layout/collaboration/ordering.js +57 -18
  53. package/dist/layout/orthogonal.d.ts +32 -0
  54. package/dist/layout/orthogonal.js +367 -0
  55. package/dist/layout/repair.d.ts +31 -0
  56. package/dist/layout/repair.js +220 -0
  57. package/dist/layout/semantic/route.js +45 -3
  58. package/dist/node/bpmnlint.d.ts +109 -0
  59. package/dist/node/bpmnlint.js +198 -0
  60. package/dist/node/index.d.ts +2 -0
  61. package/dist/node/index.js +1 -0
  62. package/dist/xml/xml-patch.d.ts +21 -0
  63. package/dist/xml/xml-patch.js +27 -1
  64. package/package.json +2 -2
@@ -17,6 +17,8 @@ export interface BpmnBounds {
17
17
  export interface BpmnWaypoint {
18
18
  x: number;
19
19
  y: number;
20
+ /** Attributes other than `x` / `y` (e.g. `xsi:type`), kept for round-trip. */
21
+ unknownAttributes?: Record<string, string>;
20
22
  }
21
23
  /** Event definition for timer-based events. Use `timeDuration`, `timeDate`, or `timeCycle`. */
22
24
  export interface BpmnTimerEventDefinition {
@@ -28,58 +30,80 @@ export interface BpmnTimerEventDefinition {
28
30
  timeDateAttributes?: Record<string, string>;
29
31
  timeCycle?: string;
30
32
  timeCycleAttributes?: Record<string, string>;
33
+ /** Attributes the SDK does not model (e.g. `camunda:type`), kept for round-trip. */
34
+ unknownAttributes?: Record<string, string>;
31
35
  }
32
36
  /** Event definition for error boundary / end events. */
33
37
  export interface BpmnErrorEventDefinition {
34
38
  type: "error";
35
39
  id?: string;
36
40
  errorRef?: string;
41
+ /** Attributes the SDK does not model (e.g. `camunda:type`), kept for round-trip. */
42
+ unknownAttributes?: Record<string, string>;
37
43
  }
38
44
  /** Event definition for escalation events. */
39
45
  export interface BpmnEscalationEventDefinition {
40
46
  type: "escalation";
41
47
  id?: string;
42
48
  escalationRef?: string;
49
+ /** Attributes the SDK does not model (e.g. `camunda:type`), kept for round-trip. */
50
+ unknownAttributes?: Record<string, string>;
43
51
  }
44
52
  /** Event definition for message events (receive / send). */
45
53
  export interface BpmnMessageEventDefinition {
46
54
  type: "message";
47
55
  id?: string;
48
56
  messageRef?: string;
57
+ /** Attributes the SDK does not model (e.g. `camunda:type`), kept for round-trip. */
58
+ unknownAttributes?: Record<string, string>;
49
59
  }
50
60
  /** Event definition for signal catch / throw events. */
51
61
  export interface BpmnSignalEventDefinition {
52
62
  type: "signal";
53
63
  id?: string;
54
64
  signalRef?: string;
65
+ /** Attributes the SDK does not model (e.g. `camunda:type`), kept for round-trip. */
66
+ unknownAttributes?: Record<string, string>;
55
67
  }
56
68
  /** Event definition for conditional catch events. */
57
69
  export interface BpmnConditionalEventDefinition {
58
70
  type: "conditional";
59
71
  id?: string;
60
72
  condition?: string;
73
+ /** Attributes of the `<condition>` element, e.g. `xsi:type` and `language`. */
74
+ conditionAttributes?: Record<string, string>;
75
+ /** Attributes the SDK does not model (e.g. `camunda:type`), kept for round-trip. */
76
+ unknownAttributes?: Record<string, string>;
61
77
  }
62
78
  /** Event definition for link catch / throw events. */
63
79
  export interface BpmnLinkEventDefinition {
64
80
  type: "link";
65
81
  id?: string;
66
82
  name?: string;
83
+ /** Attributes the SDK does not model (e.g. `camunda:type`), kept for round-trip. */
84
+ unknownAttributes?: Record<string, string>;
67
85
  }
68
86
  /** Event definition for cancel boundary events (transaction scope). */
69
87
  export interface BpmnCancelEventDefinition {
70
88
  type: "cancel";
71
89
  id?: string;
90
+ /** Attributes the SDK does not model (e.g. `camunda:type`), kept for round-trip. */
91
+ unknownAttributes?: Record<string, string>;
72
92
  }
73
93
  /** Event definition for terminate end events. */
74
94
  export interface BpmnTerminateEventDefinition {
75
95
  type: "terminate";
76
96
  id?: string;
97
+ /** Attributes the SDK does not model (e.g. `camunda:type`), kept for round-trip. */
98
+ unknownAttributes?: Record<string, string>;
77
99
  }
78
100
  /** Event definition for compensation boundary / throw events. */
79
101
  export interface BpmnCompensateEventDefinition {
80
102
  type: "compensate";
81
103
  id?: string;
82
104
  activityRef?: string;
105
+ /** Attributes the SDK does not model (e.g. `camunda:type`), kept for round-trip. */
106
+ unknownAttributes?: Record<string, string>;
83
107
  }
84
108
  /**
85
109
  * Discriminated union of all BPMN event definition types.
@@ -88,6 +112,7 @@ export interface BpmnCompensateEventDefinition {
88
112
  export type BpmnEventDefinition = BpmnTimerEventDefinition | BpmnErrorEventDefinition | BpmnEscalationEventDefinition | BpmnMessageEventDefinition | BpmnSignalEventDefinition | BpmnConditionalEventDefinition | BpmnLinkEventDefinition | BpmnCancelEventDefinition | BpmnTerminateEventDefinition | BpmnCompensateEventDefinition;
89
113
  /** Multi-instance loop configuration attached to a task or sub-process. */
90
114
  export interface BpmnMultiInstanceLoopCharacteristics {
115
+ id?: string;
91
116
  /** When true, iterations run one at a time (sequential). When false or absent, runs in parallel. */
92
117
  isSequential?: boolean;
93
118
  /** How many instances to create. Losing this turns a bounded loop into an unbounded one. */
@@ -100,6 +125,8 @@ export interface BpmnMultiInstanceLoopCharacteristics {
100
125
  * modelled ones so a round trip cannot silently discard them.
101
126
  */
102
127
  unknownChildren?: XmlElement[];
128
+ /** Attributes the SDK does not model (e.g. `camunda:collection`), kept for round-trip. */
129
+ unknownAttributes?: Record<string, string>;
103
130
  }
104
131
  /** A FEEL condition expression on a sequence flow outgoing from a gateway. */
105
132
  export interface BpmnConditionExpression {
@@ -112,6 +139,8 @@ interface BpmnFlowNodeBase {
112
139
  incoming: string[];
113
140
  outgoing: string[];
114
141
  documentation?: string;
142
+ /** Attributes of the `<documentation>` element (`id`, `textFormat`), kept for round-trip. */
143
+ documentationAttributes?: Record<string, string>;
115
144
  extensionElements: XmlElement[];
116
145
  unknownAttributes: Record<string, string>;
117
146
  isForCompensation?: boolean;
@@ -294,9 +323,14 @@ export interface BpmnSequenceFlow {
294
323
  name?: string;
295
324
  sourceRef: string;
296
325
  targetRef: string;
326
+ documentation?: string;
327
+ /** Attributes of the `<documentation>` element (`id`, `textFormat`), kept for round-trip. */
328
+ documentationAttributes?: Record<string, string>;
297
329
  conditionExpression?: BpmnConditionExpression;
298
330
  extensionElements: XmlElement[];
299
331
  unknownAttributes: Record<string, string>;
332
+ /** Children the SDK does not model, kept verbatim so a round trip keeps them. */
333
+ unknownChildren?: XmlElement[];
300
334
  }
301
335
  /**
302
336
  * A `bpmn:property` on a flow node. Modellers emit one per data input
@@ -314,6 +348,11 @@ export interface BpmnProperty {
314
348
  */
315
349
  export interface BpmnDataAssociation {
316
350
  id?: string;
351
+ documentation?: string;
352
+ /** Attributes of the `<documentation>` element (`id`, `textFormat`), kept for round-trip. */
353
+ documentationAttributes?: Record<string, string>;
354
+ /** Vendor extensions carried on the association, kept verbatim. */
355
+ extensionElements?: XmlElement[];
317
356
  /** Ids named by `<bpmn:sourceRef>` child elements. */
318
357
  sourceRefs: string[];
319
358
  /** Id named by the `<bpmn:targetRef>` child element. */
@@ -330,6 +369,8 @@ export interface BpmnTextAnnotation {
330
369
  id: string;
331
370
  text?: string;
332
371
  documentation?: string;
372
+ /** Attributes of the `<documentation>` element (`id`, `textFormat`), kept for round-trip. */
373
+ documentationAttributes?: Record<string, string>;
333
374
  extensionElements?: XmlElement[];
334
375
  unknownAttributes: Record<string, string>;
335
376
  }
@@ -340,6 +381,8 @@ export interface BpmnAssociation {
340
381
  targetRef: string;
341
382
  associationDirection?: string;
342
383
  documentation?: string;
384
+ /** Attributes of the `<documentation>` element (`id`, `textFormat`), kept for round-trip. */
385
+ documentationAttributes?: Record<string, string>;
343
386
  extensionElements?: XmlElement[];
344
387
  unknownAttributes: Record<string, string>;
345
388
  }
@@ -349,6 +392,8 @@ export interface BpmnGroup {
349
392
  /** Id of the `categoryValue` supplying the group's label, if any. */
350
393
  categoryValueRef?: string;
351
394
  documentation?: string;
395
+ /** Attributes of the `<documentation>` element (`id`, `textFormat`), kept for round-trip. */
396
+ documentationAttributes?: Record<string, string>;
352
397
  extensionElements?: XmlElement[];
353
398
  unknownAttributes: Record<string, string>;
354
399
  }
@@ -372,6 +417,8 @@ export interface BpmnLane {
372
417
  flowNodeRefs: string[];
373
418
  childLaneSet?: BpmnLaneSet;
374
419
  documentation?: string;
420
+ /** Attributes of the `<documentation>` element (`id`, `textFormat`), kept for round-trip. */
421
+ documentationAttributes?: Record<string, string>;
375
422
  extensionElements?: XmlElement[];
376
423
  unknownAttributes: Record<string, string>;
377
424
  }
@@ -395,6 +442,8 @@ export interface BpmnProcess {
395
442
  name?: string;
396
443
  isExecutable?: boolean;
397
444
  documentation?: string;
445
+ /** Attributes of the `<documentation>` element (`id`, `textFormat`), kept for round-trip. */
446
+ documentationAttributes?: Record<string, string>;
398
447
  extensionElements: XmlElement[];
399
448
  flowElements: BpmnFlowElement[];
400
449
  sequenceFlows: BpmnSequenceFlow[];
@@ -415,6 +464,8 @@ export interface BpmnParticipant {
415
464
  name?: string;
416
465
  processRef?: string;
417
466
  documentation?: string;
467
+ /** Attributes of the `<documentation>` element (`id`, `textFormat`), kept for round-trip. */
468
+ documentationAttributes?: Record<string, string>;
418
469
  extensionElements?: XmlElement[];
419
470
  unknownAttributes: Record<string, string>;
420
471
  }
@@ -427,12 +478,15 @@ export interface BpmnMessageFlow {
427
478
  /** Id of the {@link BpmnMessage} carried by this flow. */
428
479
  messageRef?: string;
429
480
  documentation?: string;
481
+ /** Attributes of the `<documentation>` element (`id`, `textFormat`), kept for round-trip. */
482
+ documentationAttributes?: Record<string, string>;
430
483
  extensionElements?: XmlElement[];
431
484
  unknownAttributes: Record<string, string>;
432
485
  }
433
486
  /** A BPMN collaboration element grouping multiple participants and their message flows. */
434
487
  export interface BpmnCollaboration {
435
488
  id: string;
489
+ name?: string;
436
490
  participants: BpmnParticipant[];
437
491
  messageFlows: BpmnMessageFlow[];
438
492
  textAnnotations: BpmnTextAnnotation[];
@@ -452,6 +506,8 @@ export interface BpmnError {
452
506
  name?: string;
453
507
  errorCode?: string;
454
508
  documentation?: string;
509
+ /** Attributes of the `<documentation>` element (`id`, `textFormat`), kept for round-trip. */
510
+ documentationAttributes?: Record<string, string>;
455
511
  extensionElements?: XmlElement[];
456
512
  unknownAttributes?: Record<string, string>;
457
513
  }
@@ -461,6 +517,8 @@ export interface BpmnEscalation {
461
517
  name?: string;
462
518
  escalationCode?: string;
463
519
  documentation?: string;
520
+ /** Attributes of the `<documentation>` element (`id`, `textFormat`), kept for round-trip. */
521
+ documentationAttributes?: Record<string, string>;
464
522
  extensionElements?: XmlElement[];
465
523
  unknownAttributes?: Record<string, string>;
466
524
  }
@@ -469,6 +527,8 @@ export interface BpmnMessage {
469
527
  id: string;
470
528
  name?: string;
471
529
  documentation?: string;
530
+ /** Attributes of the `<documentation>` element (`id`, `textFormat`), kept for round-trip. */
531
+ documentationAttributes?: Record<string, string>;
472
532
  /**
473
533
  * Carries `zeebe:subscription`, whose `correlationKey` is what Camunda 8
474
534
  * correlates published messages on.
@@ -481,12 +541,19 @@ export interface BpmnSignal {
481
541
  id: string;
482
542
  name?: string;
483
543
  documentation?: string;
544
+ /** Attributes of the `<documentation>` element (`id`, `textFormat`), kept for round-trip. */
545
+ documentationAttributes?: Record<string, string>;
484
546
  extensionElements?: XmlElement[];
485
547
  unknownAttributes?: Record<string, string>;
486
548
  }
487
549
  /** Optional label positioning information for a BPMNDi shape or edge. */
488
550
  export interface BpmnDiLabel {
489
551
  bounds?: BpmnBounds;
552
+ /**
553
+ * The `BPMNLabel` element's own attributes — `labelStyle`, `id`, vendor colour
554
+ * and position hints — kept for round-trip.
555
+ */
556
+ unknownAttributes?: Record<string, string>;
490
557
  }
491
558
  /** BPMNDi layout shape — binds a flow element to its visual bounds on the canvas. */
492
559
  export interface BpmnDiShape {
@@ -509,15 +576,24 @@ export interface BpmnDiEdge {
509
576
  }
510
577
  /** The drawing plane for a BPMNDiagram — holds all shapes and edges. */
511
578
  export interface BpmnDiPlane {
579
+ /** Empty when the source omitted it — BPMN DI makes it optional. */
512
580
  id: string;
581
+ /** Empty when the source omitted it — BPMN DI makes it optional. */
513
582
  bpmnElement: string;
514
583
  shapes: BpmnDiShape[];
515
584
  edges: BpmnDiEdge[];
585
+ /** Attributes other than `id` / `bpmnElement`, kept for round-trip. */
586
+ unknownAttributes?: Record<string, string>;
516
587
  }
517
588
  /** A BPMNDiagram element grouping the visual layout for one process. */
518
589
  export interface BpmnDiagram {
590
+ /** Empty when the source omitted it — BPMN DI makes it optional. */
519
591
  id: string;
520
592
  plane: BpmnDiPlane;
593
+ /** Attributes other than `id` — `name`, `documentation`, `resolution` — kept for round-trip. */
594
+ unknownAttributes?: Record<string, string>;
595
+ /** Children other than the plane — `BPMNLabelStyle` definitions — kept verbatim. */
596
+ unknownChildren?: XmlElement[];
521
597
  }
522
598
  /**
523
599
  * The root object of a parsed BPMN document — equivalent to `<bpmn:definitions>`.
@@ -543,6 +619,8 @@ export interface BpmnDefinitions {
543
619
  /** Namespace-qualified attributes not directly modeled */
544
620
  unknownAttributes: Record<string, string>;
545
621
  documentation?: string;
622
+ /** Attributes of the `<documentation>` element (`id`, `textFormat`), kept for round-trip. */
623
+ documentationAttributes?: Record<string, string>;
546
624
  /** Root-level category containers supplying {@link BpmnGroup} labels. */
547
625
  categories?: BpmnCategory[];
548
626
  errors: BpmnError[];