eventmodeler 0.4.3 → 0.4.5
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/api/index.d.ts +282 -0
- package/dist/api/index.js +320 -0
- package/dist/cloud/slices/index.d.ts +7 -0
- package/dist/index.js +256 -798
- package/dist/lib/config.d.ts +2 -1
- package/dist/lib/project-config.d.ts +0 -3
- package/dist/lib/project-config.js +1 -8
- package/dist/lib/slice-utils.d.ts +0 -79
- package/dist/lib/slice-utils.js +87 -237
- package/dist/projection.js +0 -146
- package/dist/slices/add-scenario/index.d.ts +0 -2
- package/dist/slices/add-scenario/index.js +120 -318
- package/dist/slices/init/index.d.ts +1 -0
- package/dist/slices/init/index.js +40 -93
- package/dist/slices/whoami/index.d.ts +1 -1
- package/dist/slices/whoami/index.js +19 -10
- package/package.json +5 -2
package/dist/projection.js
CHANGED
|
@@ -78,16 +78,6 @@ function applyEvent(model, event) {
|
|
|
78
78
|
}
|
|
79
79
|
break;
|
|
80
80
|
}
|
|
81
|
-
case 'CommandStickyDuplicated':
|
|
82
|
-
model.commands.set(d.commandStickyId, {
|
|
83
|
-
id: d.commandStickyId,
|
|
84
|
-
name: d.name,
|
|
85
|
-
fields: d.fields,
|
|
86
|
-
position: d.position,
|
|
87
|
-
width: d.width,
|
|
88
|
-
height: d.height,
|
|
89
|
-
});
|
|
90
|
-
break;
|
|
91
81
|
// Event sticky events
|
|
92
82
|
case 'EventStickyPlaced':
|
|
93
83
|
model.events.set(d.eventStickyId, {
|
|
@@ -449,16 +439,6 @@ function applyEvent(model, event) {
|
|
|
449
439
|
}
|
|
450
440
|
break;
|
|
451
441
|
}
|
|
452
|
-
case 'ProcessorDuplicated':
|
|
453
|
-
model.processors.set(d.processorId, {
|
|
454
|
-
id: d.processorId,
|
|
455
|
-
name: d.name,
|
|
456
|
-
fields: d.fields,
|
|
457
|
-
position: d.position,
|
|
458
|
-
width: d.width,
|
|
459
|
-
height: d.height,
|
|
460
|
-
});
|
|
461
|
-
break;
|
|
462
442
|
// Slice events
|
|
463
443
|
case 'SlicePlaced':
|
|
464
444
|
model.slices.set(d.sliceId, {
|
|
@@ -470,16 +450,6 @@ function applyEvent(model, event) {
|
|
|
470
450
|
nodeIds: [],
|
|
471
451
|
});
|
|
472
452
|
break;
|
|
473
|
-
case 'NodesGroupedIntoSlice':
|
|
474
|
-
model.slices.set(d.sliceId, {
|
|
475
|
-
id: d.sliceId,
|
|
476
|
-
name: d.name,
|
|
477
|
-
status: 'created',
|
|
478
|
-
position: d.position,
|
|
479
|
-
size: d.size,
|
|
480
|
-
nodeIds: d.nodeIds,
|
|
481
|
-
});
|
|
482
|
-
break;
|
|
483
453
|
case 'SliceMoved': {
|
|
484
454
|
const slice = model.slices.get(d.sliceId);
|
|
485
455
|
if (slice)
|
|
@@ -548,16 +518,6 @@ function applyEvent(model, event) {
|
|
|
548
518
|
}
|
|
549
519
|
break;
|
|
550
520
|
}
|
|
551
|
-
case 'SliceDuplicated':
|
|
552
|
-
model.slices.set(d.sliceId, {
|
|
553
|
-
id: d.sliceId,
|
|
554
|
-
name: d.name,
|
|
555
|
-
status: d.status,
|
|
556
|
-
position: d.position,
|
|
557
|
-
size: d.size,
|
|
558
|
-
nodeIds: [],
|
|
559
|
-
});
|
|
560
|
-
break;
|
|
561
521
|
// Aggregate events
|
|
562
522
|
case 'AggregatePlaced':
|
|
563
523
|
model.aggregates.set(d.aggregateId, {
|
|
@@ -570,17 +530,6 @@ function applyEvent(model, event) {
|
|
|
570
530
|
aggregateIdFieldType: d.aggregateIdFieldType,
|
|
571
531
|
});
|
|
572
532
|
break;
|
|
573
|
-
case 'EventsGroupedIntoAggregate':
|
|
574
|
-
model.aggregates.set(d.aggregateId, {
|
|
575
|
-
id: d.aggregateId,
|
|
576
|
-
name: d.name,
|
|
577
|
-
position: d.position,
|
|
578
|
-
size: d.size,
|
|
579
|
-
eventIds: d.eventIds,
|
|
580
|
-
aggregateIdFieldName: d.aggregateIdFieldName,
|
|
581
|
-
aggregateIdFieldType: d.aggregateIdFieldType,
|
|
582
|
-
});
|
|
583
|
-
break;
|
|
584
533
|
case 'AggregateMoved': {
|
|
585
534
|
const aggregate = model.aggregates.get(d.aggregateId);
|
|
586
535
|
if (aggregate)
|
|
@@ -622,15 +571,6 @@ function applyEvent(model, event) {
|
|
|
622
571
|
screenIds: [],
|
|
623
572
|
});
|
|
624
573
|
break;
|
|
625
|
-
case 'ScreensGroupedIntoActor':
|
|
626
|
-
model.actors.set(d.actorId, {
|
|
627
|
-
id: d.actorId,
|
|
628
|
-
name: d.name,
|
|
629
|
-
position: d.position,
|
|
630
|
-
size: d.size,
|
|
631
|
-
screenIds: d.screenIds,
|
|
632
|
-
});
|
|
633
|
-
break;
|
|
634
574
|
case 'ActorMoved': {
|
|
635
575
|
const actor = model.actors.get(d.actorId);
|
|
636
576
|
if (actor)
|
|
@@ -756,92 +696,6 @@ function applyEvent(model, event) {
|
|
|
756
696
|
flow.fieldMappings = [];
|
|
757
697
|
break;
|
|
758
698
|
}
|
|
759
|
-
// Quick place events - create node and flow atomically
|
|
760
|
-
case 'CommandQuickPlacedFromScreen':
|
|
761
|
-
model.commands.set(d.commandStickyId, {
|
|
762
|
-
id: d.commandStickyId,
|
|
763
|
-
name: d.name,
|
|
764
|
-
fields: [],
|
|
765
|
-
position: d.position,
|
|
766
|
-
width: d.width,
|
|
767
|
-
height: d.height,
|
|
768
|
-
});
|
|
769
|
-
model.flows.set(d.flowId, {
|
|
770
|
-
id: d.flowId,
|
|
771
|
-
flowType: 'ScreenToCommand',
|
|
772
|
-
sourceId: d.screenId,
|
|
773
|
-
targetId: d.commandStickyId,
|
|
774
|
-
fieldMappings: [],
|
|
775
|
-
});
|
|
776
|
-
break;
|
|
777
|
-
case 'EventQuickPlacedFromCommand':
|
|
778
|
-
model.events.set(d.eventStickyId, {
|
|
779
|
-
id: d.eventStickyId,
|
|
780
|
-
name: d.name,
|
|
781
|
-
fields: [],
|
|
782
|
-
position: d.position,
|
|
783
|
-
width: d.width,
|
|
784
|
-
height: d.height,
|
|
785
|
-
});
|
|
786
|
-
model.flows.set(d.flowId, {
|
|
787
|
-
id: d.flowId,
|
|
788
|
-
flowType: 'CommandToEvent',
|
|
789
|
-
sourceId: d.commandStickyId,
|
|
790
|
-
targetId: d.eventStickyId,
|
|
791
|
-
fieldMappings: [],
|
|
792
|
-
});
|
|
793
|
-
break;
|
|
794
|
-
case 'ReadModelQuickPlacedFromEvent':
|
|
795
|
-
model.readModels.set(d.readModelStickyId, {
|
|
796
|
-
id: d.readModelStickyId,
|
|
797
|
-
name: d.name,
|
|
798
|
-
fields: [],
|
|
799
|
-
position: d.position,
|
|
800
|
-
width: d.width,
|
|
801
|
-
height: d.height,
|
|
802
|
-
});
|
|
803
|
-
model.flows.set(d.flowId, {
|
|
804
|
-
id: d.flowId,
|
|
805
|
-
flowType: 'EventToReadModel',
|
|
806
|
-
sourceId: d.eventStickyId,
|
|
807
|
-
targetId: d.readModelStickyId,
|
|
808
|
-
fieldMappings: [],
|
|
809
|
-
});
|
|
810
|
-
break;
|
|
811
|
-
case 'ScreenQuickPlacedFromReadModel':
|
|
812
|
-
model.screens.set(d.screenId, {
|
|
813
|
-
id: d.screenId,
|
|
814
|
-
name: d.name,
|
|
815
|
-
fields: [],
|
|
816
|
-
position: d.position,
|
|
817
|
-
width: d.width,
|
|
818
|
-
height: d.height,
|
|
819
|
-
});
|
|
820
|
-
model.flows.set(d.flowId, {
|
|
821
|
-
id: d.flowId,
|
|
822
|
-
flowType: 'ReadModelToScreen',
|
|
823
|
-
sourceId: d.readModelStickyId,
|
|
824
|
-
targetId: d.screenId,
|
|
825
|
-
fieldMappings: [],
|
|
826
|
-
});
|
|
827
|
-
break;
|
|
828
|
-
case 'CommandQuickPlacedFromProcessor':
|
|
829
|
-
model.commands.set(d.commandStickyId, {
|
|
830
|
-
id: d.commandStickyId,
|
|
831
|
-
name: d.name,
|
|
832
|
-
fields: [],
|
|
833
|
-
position: d.position,
|
|
834
|
-
width: d.width,
|
|
835
|
-
height: d.height,
|
|
836
|
-
});
|
|
837
|
-
model.flows.set(d.flowId, {
|
|
838
|
-
id: d.flowId,
|
|
839
|
-
flowType: 'ProcessorToCommand',
|
|
840
|
-
sourceId: d.processorId,
|
|
841
|
-
targetId: d.commandStickyId,
|
|
842
|
-
fieldMappings: [],
|
|
843
|
-
});
|
|
844
|
-
break;
|
|
845
699
|
// Field propagation events
|
|
846
700
|
case 'FieldsPropagatedFromCommandToEvent':
|
|
847
701
|
case 'FieldsPropagatedFromEventToCommand':
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { EventModel } from '../../types.js';
|
|
2
1
|
export interface ScenarioInput {
|
|
3
2
|
name: string;
|
|
4
3
|
description?: string;
|
|
@@ -25,5 +24,4 @@ interface EventInput {
|
|
|
25
24
|
fieldValues?: Record<string, unknown>;
|
|
26
25
|
}
|
|
27
26
|
export declare function parseScenarioInput(input: string): ScenarioInput;
|
|
28
|
-
export declare function addScenario(model: EventModel, filePath: string, sliceName: string, input: string): void;
|
|
29
27
|
export {};
|