@miragon/event-storming-schema-model 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.
- package/README.md +38 -0
- package/dist/index.cjs +273 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +480 -0
- package/dist/index.d.ts +480 -0
- package/dist/index.js +256 -0
- package/dist/index.js.map +1 -0
- package/package.json +43 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Event Storming metamodel.
|
|
5
|
+
*
|
|
6
|
+
* All interfaces are `readonly` and serve purely as the serialization/interface format.
|
|
7
|
+
* The runtime source of truth while editing lives in the mutable diagram-js DI properties
|
|
8
|
+
* (@miragon/event-storming-renderer). `exportMap()` builds an `EventStormingBoard` from
|
|
9
|
+
* those properties.
|
|
10
|
+
*
|
|
11
|
+
* Coordinates are board units = pixels, unbounded (may be negative). An element's
|
|
12
|
+
* `position` is its CENTER — the single source of positional truth end-to-end; the
|
|
13
|
+
* renderer converts center <-> diagram-js top-left via the per-kind width/height.
|
|
14
|
+
*/
|
|
15
|
+
/** Position in board pixels. Unbounded — the canvas is free. */
|
|
16
|
+
interface Coordinate {
|
|
17
|
+
readonly x: number;
|
|
18
|
+
readonly y: number;
|
|
19
|
+
}
|
|
20
|
+
type ElementType = 'event' | 'command' | 'actor' | 'aggregate' | 'policy' | 'readmodel' | 'external' | 'hotspot' | 'note' | 'drawing';
|
|
21
|
+
interface BoardElementBase {
|
|
22
|
+
readonly id: string;
|
|
23
|
+
readonly elementType: ElementType;
|
|
24
|
+
readonly label: string;
|
|
25
|
+
/** Element CENTER in board pixels. */
|
|
26
|
+
readonly position: Coordinate;
|
|
27
|
+
/**
|
|
28
|
+
* Optional element color override (CSS color, typically hex from the renderer's palette).
|
|
29
|
+
* Serialized in the DSL as the project extension `(color …)` after the coordinates.
|
|
30
|
+
*/
|
|
31
|
+
readonly color?: string;
|
|
32
|
+
}
|
|
33
|
+
/** Orange sticky: something that happened in the domain, past tense. */
|
|
34
|
+
interface DomainEventElement extends BoardElementBase {
|
|
35
|
+
readonly elementType: 'event';
|
|
36
|
+
}
|
|
37
|
+
/** Blue sticky: an intent/action that triggers a domain event. */
|
|
38
|
+
interface CommandElement extends BoardElementBase {
|
|
39
|
+
readonly elementType: 'command';
|
|
40
|
+
}
|
|
41
|
+
/** Small yellow sticky: the person issuing commands. */
|
|
42
|
+
interface ActorElement extends BoardElementBase {
|
|
43
|
+
readonly elementType: 'actor';
|
|
44
|
+
/**
|
|
45
|
+
* Pinning: id of the host sticky (a HOST_STICKY_KINDS element) this sticky is attached to
|
|
46
|
+
* and moves with. `position` stays this element's own absolute center — attachedTo adds
|
|
47
|
+
* behavior, it never changes how coordinates are stored. DSL: the `(on <Host Name>)` suffix.
|
|
48
|
+
*/
|
|
49
|
+
readonly attachedTo?: string;
|
|
50
|
+
}
|
|
51
|
+
/** Large yellow sticky: the consistency boundary that handles commands and emits events. */
|
|
52
|
+
interface AggregateElement extends BoardElementBase {
|
|
53
|
+
readonly elementType: 'aggregate';
|
|
54
|
+
}
|
|
55
|
+
/** Lilac sticky: reactive logic — "whenever X happens, do Y". */
|
|
56
|
+
interface PolicyElement extends BoardElementBase {
|
|
57
|
+
readonly elementType: 'policy';
|
|
58
|
+
}
|
|
59
|
+
/** Green sticky: information a user looks at to make a decision. */
|
|
60
|
+
interface ReadModelElement extends BoardElementBase {
|
|
61
|
+
readonly elementType: 'readmodel';
|
|
62
|
+
}
|
|
63
|
+
/** Pink sticky: a third-party system outside the team's control. */
|
|
64
|
+
interface ExternalSystemElement extends BoardElementBase {
|
|
65
|
+
readonly elementType: 'external';
|
|
66
|
+
}
|
|
67
|
+
/** Red sticky: an open question, conflict or risk spotted during the workshop. */
|
|
68
|
+
interface HotspotElement extends BoardElementBase {
|
|
69
|
+
readonly elementType: 'hotspot';
|
|
70
|
+
/** Pinning: id of the host sticky this sticky is attached to (see ActorElement.attachedTo). */
|
|
71
|
+
readonly attachedTo?: string;
|
|
72
|
+
}
|
|
73
|
+
type NoteAlignHorizontal = 'left' | 'center' | 'right';
|
|
74
|
+
type NoteAlignVertical = 'top' | 'middle' | 'bottom';
|
|
75
|
+
/** Per-note text alignment. An absent axis means the default: left / top. */
|
|
76
|
+
interface NoteAlign {
|
|
77
|
+
readonly horizontal?: NoteAlignHorizontal;
|
|
78
|
+
readonly vertical?: NoteAlignVertical;
|
|
79
|
+
}
|
|
80
|
+
/** Free-text note; auto-sizes to its text unless a manual `size` is set. */
|
|
81
|
+
interface NoteElement extends BoardElementBase {
|
|
82
|
+
readonly elementType: 'note';
|
|
83
|
+
/**
|
|
84
|
+
* Manual size in board pixels (the user resized the note by hand). Absent = auto-size
|
|
85
|
+
* from the text — that decision lives in the renderer, the model only carries the
|
|
86
|
+
* override. DSL: the `(size <w>x<h>)` suffix.
|
|
87
|
+
*/
|
|
88
|
+
readonly size?: {
|
|
89
|
+
readonly width: number;
|
|
90
|
+
readonly height: number;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Text alignment inside the note box. Absent (object or axis) = the default left/top —
|
|
94
|
+
* rendering lives in the renderer, the model only carries the override. DSL: the
|
|
95
|
+
* `(align <horizontal> <vertical>)` suffix.
|
|
96
|
+
*/
|
|
97
|
+
readonly align?: NoteAlign;
|
|
98
|
+
/** Pinning: id of the host sticky this note is attached to (see ActorElement.attachedTo). */
|
|
99
|
+
readonly attachedTo?: string;
|
|
100
|
+
}
|
|
101
|
+
type DrawingStrokeStyle = 'solid' | 'dashed' | 'dotted';
|
|
102
|
+
/**
|
|
103
|
+
* Freeform polyline/polygon (project extension, Excalidraw-style annotation drawing).
|
|
104
|
+
* `position` mirrors the first point; `points` are absolute board pixels.
|
|
105
|
+
*/
|
|
106
|
+
interface DrawingElement extends BoardElementBase {
|
|
107
|
+
readonly elementType: 'drawing';
|
|
108
|
+
readonly points: readonly Coordinate[];
|
|
109
|
+
/** true = closed polygon, false/absent = open polyline. */
|
|
110
|
+
readonly closed?: boolean;
|
|
111
|
+
readonly strokeStyle?: DrawingStrokeStyle;
|
|
112
|
+
}
|
|
113
|
+
type BoardElement = DomainEventElement | CommandElement | ActorElement | AggregateElement | PolicyElement | ReadModelElement | ExternalSystemElement | HotspotElement | NoteElement | DrawingElement;
|
|
114
|
+
/** The single edge kind: a directed arrow between two stickies. */
|
|
115
|
+
interface Arrow {
|
|
116
|
+
readonly id: string;
|
|
117
|
+
readonly edgeType: 'arrow';
|
|
118
|
+
/** BoardElement.id of the source sticky. */
|
|
119
|
+
readonly from: string;
|
|
120
|
+
/** BoardElement.id of the target sticky. */
|
|
121
|
+
readonly to: string;
|
|
122
|
+
/** Annotation text after `;`, e.g. `Order Placed -> Ship Order; async`. */
|
|
123
|
+
readonly label?: string;
|
|
124
|
+
}
|
|
125
|
+
type BoardEdge = Arrow;
|
|
126
|
+
/**
|
|
127
|
+
* Workshop granularity of the board — big picture, process modelling or software design.
|
|
128
|
+
* Filters which sticky kinds the creation surfaces offer; NOT a validation rule (elements
|
|
129
|
+
* of any kind stay valid and editable on every level).
|
|
130
|
+
*/
|
|
131
|
+
type BoardLevel = 'big-picture' | 'process' | 'design';
|
|
132
|
+
interface BoardConfig {
|
|
133
|
+
readonly title: string;
|
|
134
|
+
readonly style?: 'classic' | 'dark';
|
|
135
|
+
/** Workshop level; absent means `design` (everything available). */
|
|
136
|
+
readonly level?: BoardLevel;
|
|
137
|
+
}
|
|
138
|
+
/** Root object. Domain and layout are separated logically (not physically). */
|
|
139
|
+
interface EventStormingBoard {
|
|
140
|
+
readonly schemaVersion: number;
|
|
141
|
+
readonly config: BoardConfig;
|
|
142
|
+
readonly elements: readonly BoardElement[];
|
|
143
|
+
readonly edges: readonly BoardEdge[];
|
|
144
|
+
/** Preserve unknown/future DSL lines losslessly (round-trip fidelity). */
|
|
145
|
+
readonly rawPassthrough?: readonly string[];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** Pure layout helpers for the free Event Storming canvas (no persistence, no DOM). */
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Default framing for an empty board in board pixels. Single source of truth for the
|
|
152
|
+
* renderer's board-bounds service (fitView and SVG export fall back to it when the
|
|
153
|
+
* board has no elements).
|
|
154
|
+
*/
|
|
155
|
+
declare const DEFAULT_BOARD_SIZE: {
|
|
156
|
+
readonly width: 1080;
|
|
157
|
+
readonly height: 680;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Elements in timeline order: sorted by `position.x`, then `position.y`, then `id`.
|
|
161
|
+
* Pure and deterministic — mirrors how a facilitator reads a board left to right.
|
|
162
|
+
*/
|
|
163
|
+
declare function sortByTimeline(board: EventStormingBoard): BoardElement[];
|
|
164
|
+
|
|
165
|
+
/** Workshop-level constants (DOM-free single source of truth for all creation surfaces). */
|
|
166
|
+
|
|
167
|
+
/** Effective level when `config.level` is absent — everything available. */
|
|
168
|
+
declare const DEFAULT_BOARD_LEVEL: BoardLevel;
|
|
169
|
+
/**
|
|
170
|
+
* Sticky kinds offered per level (palette, typed append, change-type popup).
|
|
171
|
+
* `note` and `drawing` are annotations — always available, hence not listed here.
|
|
172
|
+
*/
|
|
173
|
+
declare const LEVEL_STICKY_KINDS: Record<BoardLevel, readonly ElementType[]>;
|
|
174
|
+
|
|
175
|
+
/** Attachment (pinning) constants — DOM-free single source of truth for model, DSL and renderer. */
|
|
176
|
+
/** Element kinds that can be pinned onto a host sticky and then move with it. */
|
|
177
|
+
declare const ATTACHABLE_STICKY_KINDS: readonly ["actor", "hotspot", "note"];
|
|
178
|
+
/**
|
|
179
|
+
* Sticky kinds that can carry attachments. Attachable kinds and drawings are never
|
|
180
|
+
* hosts — so attach chains cannot exist.
|
|
181
|
+
*/
|
|
182
|
+
declare const HOST_STICKY_KINDS: readonly ["event", "command", "aggregate", "policy", "readmodel", "external"];
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Validates arbitrary data against the schema plus additional cross-field invariants
|
|
186
|
+
* (unique IDs, edge endpoints exist and are sticky kinds). Throws on violation.
|
|
187
|
+
*/
|
|
188
|
+
declare function validateBoard(data: unknown): EventStormingBoard;
|
|
189
|
+
declare function loadBoard(data: unknown): EventStormingBoard;
|
|
190
|
+
declare function parseBoardJSON(json: string): EventStormingBoard;
|
|
191
|
+
/**
|
|
192
|
+
* Deterministic serialization: stable (alphabetical) key order, elements/edges sorted by `id`,
|
|
193
|
+
* coordinates rounded to 3 decimal places. Produces clean Git diffs and reliable change
|
|
194
|
+
* detection.
|
|
195
|
+
*/
|
|
196
|
+
declare function serializeBoard(board: EventStormingBoard): string;
|
|
197
|
+
declare function createEmptyBoard(title?: string): EventStormingBoard;
|
|
198
|
+
|
|
199
|
+
declare const boardElementSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
200
|
+
elementType: z.ZodLiteral<"event">;
|
|
201
|
+
id: z.ZodString;
|
|
202
|
+
label: z.ZodString;
|
|
203
|
+
position: z.ZodObject<{
|
|
204
|
+
x: z.ZodNumber;
|
|
205
|
+
y: z.ZodNumber;
|
|
206
|
+
}, z.core.$strip>;
|
|
207
|
+
color: z.ZodOptional<z.ZodString>;
|
|
208
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
209
|
+
elementType: z.ZodLiteral<"command">;
|
|
210
|
+
id: z.ZodString;
|
|
211
|
+
label: z.ZodString;
|
|
212
|
+
position: z.ZodObject<{
|
|
213
|
+
x: z.ZodNumber;
|
|
214
|
+
y: z.ZodNumber;
|
|
215
|
+
}, z.core.$strip>;
|
|
216
|
+
color: z.ZodOptional<z.ZodString>;
|
|
217
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
218
|
+
elementType: z.ZodLiteral<"actor">;
|
|
219
|
+
attachedTo: z.ZodOptional<z.ZodString>;
|
|
220
|
+
id: z.ZodString;
|
|
221
|
+
label: z.ZodString;
|
|
222
|
+
position: z.ZodObject<{
|
|
223
|
+
x: z.ZodNumber;
|
|
224
|
+
y: z.ZodNumber;
|
|
225
|
+
}, z.core.$strip>;
|
|
226
|
+
color: z.ZodOptional<z.ZodString>;
|
|
227
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
228
|
+
elementType: z.ZodLiteral<"aggregate">;
|
|
229
|
+
id: z.ZodString;
|
|
230
|
+
label: z.ZodString;
|
|
231
|
+
position: z.ZodObject<{
|
|
232
|
+
x: z.ZodNumber;
|
|
233
|
+
y: z.ZodNumber;
|
|
234
|
+
}, z.core.$strip>;
|
|
235
|
+
color: z.ZodOptional<z.ZodString>;
|
|
236
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
237
|
+
elementType: z.ZodLiteral<"policy">;
|
|
238
|
+
id: z.ZodString;
|
|
239
|
+
label: z.ZodString;
|
|
240
|
+
position: z.ZodObject<{
|
|
241
|
+
x: z.ZodNumber;
|
|
242
|
+
y: z.ZodNumber;
|
|
243
|
+
}, z.core.$strip>;
|
|
244
|
+
color: z.ZodOptional<z.ZodString>;
|
|
245
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
246
|
+
elementType: z.ZodLiteral<"readmodel">;
|
|
247
|
+
id: z.ZodString;
|
|
248
|
+
label: z.ZodString;
|
|
249
|
+
position: z.ZodObject<{
|
|
250
|
+
x: z.ZodNumber;
|
|
251
|
+
y: z.ZodNumber;
|
|
252
|
+
}, z.core.$strip>;
|
|
253
|
+
color: z.ZodOptional<z.ZodString>;
|
|
254
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
255
|
+
elementType: z.ZodLiteral<"external">;
|
|
256
|
+
id: z.ZodString;
|
|
257
|
+
label: z.ZodString;
|
|
258
|
+
position: z.ZodObject<{
|
|
259
|
+
x: z.ZodNumber;
|
|
260
|
+
y: z.ZodNumber;
|
|
261
|
+
}, z.core.$strip>;
|
|
262
|
+
color: z.ZodOptional<z.ZodString>;
|
|
263
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
264
|
+
elementType: z.ZodLiteral<"hotspot">;
|
|
265
|
+
attachedTo: z.ZodOptional<z.ZodString>;
|
|
266
|
+
id: z.ZodString;
|
|
267
|
+
label: z.ZodString;
|
|
268
|
+
position: z.ZodObject<{
|
|
269
|
+
x: z.ZodNumber;
|
|
270
|
+
y: z.ZodNumber;
|
|
271
|
+
}, z.core.$strip>;
|
|
272
|
+
color: z.ZodOptional<z.ZodString>;
|
|
273
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
274
|
+
elementType: z.ZodLiteral<"note">;
|
|
275
|
+
size: z.ZodOptional<z.ZodObject<{
|
|
276
|
+
width: z.ZodNumber;
|
|
277
|
+
height: z.ZodNumber;
|
|
278
|
+
}, z.core.$strip>>;
|
|
279
|
+
align: z.ZodOptional<z.ZodObject<{
|
|
280
|
+
horizontal: z.ZodOptional<z.ZodEnum<{
|
|
281
|
+
left: "left";
|
|
282
|
+
center: "center";
|
|
283
|
+
right: "right";
|
|
284
|
+
}>>;
|
|
285
|
+
vertical: z.ZodOptional<z.ZodEnum<{
|
|
286
|
+
top: "top";
|
|
287
|
+
middle: "middle";
|
|
288
|
+
bottom: "bottom";
|
|
289
|
+
}>>;
|
|
290
|
+
}, z.core.$strip>>;
|
|
291
|
+
attachedTo: z.ZodOptional<z.ZodString>;
|
|
292
|
+
id: z.ZodString;
|
|
293
|
+
label: z.ZodString;
|
|
294
|
+
position: z.ZodObject<{
|
|
295
|
+
x: z.ZodNumber;
|
|
296
|
+
y: z.ZodNumber;
|
|
297
|
+
}, z.core.$strip>;
|
|
298
|
+
color: z.ZodOptional<z.ZodString>;
|
|
299
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
300
|
+
elementType: z.ZodLiteral<"drawing">;
|
|
301
|
+
points: z.ZodArray<z.ZodObject<{
|
|
302
|
+
x: z.ZodNumber;
|
|
303
|
+
y: z.ZodNumber;
|
|
304
|
+
}, z.core.$strip>>;
|
|
305
|
+
closed: z.ZodOptional<z.ZodBoolean>;
|
|
306
|
+
strokeStyle: z.ZodOptional<z.ZodEnum<{
|
|
307
|
+
solid: "solid";
|
|
308
|
+
dashed: "dashed";
|
|
309
|
+
dotted: "dotted";
|
|
310
|
+
}>>;
|
|
311
|
+
id: z.ZodString;
|
|
312
|
+
label: z.ZodString;
|
|
313
|
+
position: z.ZodObject<{
|
|
314
|
+
x: z.ZodNumber;
|
|
315
|
+
y: z.ZodNumber;
|
|
316
|
+
}, z.core.$strip>;
|
|
317
|
+
color: z.ZodOptional<z.ZodString>;
|
|
318
|
+
}, z.core.$strip>], "elementType">;
|
|
319
|
+
declare const boardEdgeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
320
|
+
id: z.ZodString;
|
|
321
|
+
edgeType: z.ZodLiteral<"arrow">;
|
|
322
|
+
from: z.ZodString;
|
|
323
|
+
to: z.ZodString;
|
|
324
|
+
label: z.ZodOptional<z.ZodString>;
|
|
325
|
+
}, z.core.$strip>], "edgeType">;
|
|
326
|
+
declare const eventStormingBoardSchema: z.ZodObject<{
|
|
327
|
+
schemaVersion: z.ZodNumber;
|
|
328
|
+
config: z.ZodObject<{
|
|
329
|
+
title: z.ZodString;
|
|
330
|
+
style: z.ZodOptional<z.ZodEnum<{
|
|
331
|
+
classic: "classic";
|
|
332
|
+
dark: "dark";
|
|
333
|
+
}>>;
|
|
334
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
335
|
+
"big-picture": "big-picture";
|
|
336
|
+
process: "process";
|
|
337
|
+
design: "design";
|
|
338
|
+
}>>;
|
|
339
|
+
}, z.core.$strip>;
|
|
340
|
+
elements: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
341
|
+
elementType: z.ZodLiteral<"event">;
|
|
342
|
+
id: z.ZodString;
|
|
343
|
+
label: z.ZodString;
|
|
344
|
+
position: z.ZodObject<{
|
|
345
|
+
x: z.ZodNumber;
|
|
346
|
+
y: z.ZodNumber;
|
|
347
|
+
}, z.core.$strip>;
|
|
348
|
+
color: z.ZodOptional<z.ZodString>;
|
|
349
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
350
|
+
elementType: z.ZodLiteral<"command">;
|
|
351
|
+
id: z.ZodString;
|
|
352
|
+
label: z.ZodString;
|
|
353
|
+
position: z.ZodObject<{
|
|
354
|
+
x: z.ZodNumber;
|
|
355
|
+
y: z.ZodNumber;
|
|
356
|
+
}, z.core.$strip>;
|
|
357
|
+
color: z.ZodOptional<z.ZodString>;
|
|
358
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
359
|
+
elementType: z.ZodLiteral<"actor">;
|
|
360
|
+
attachedTo: z.ZodOptional<z.ZodString>;
|
|
361
|
+
id: z.ZodString;
|
|
362
|
+
label: z.ZodString;
|
|
363
|
+
position: z.ZodObject<{
|
|
364
|
+
x: z.ZodNumber;
|
|
365
|
+
y: z.ZodNumber;
|
|
366
|
+
}, z.core.$strip>;
|
|
367
|
+
color: z.ZodOptional<z.ZodString>;
|
|
368
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
369
|
+
elementType: z.ZodLiteral<"aggregate">;
|
|
370
|
+
id: z.ZodString;
|
|
371
|
+
label: z.ZodString;
|
|
372
|
+
position: z.ZodObject<{
|
|
373
|
+
x: z.ZodNumber;
|
|
374
|
+
y: z.ZodNumber;
|
|
375
|
+
}, z.core.$strip>;
|
|
376
|
+
color: z.ZodOptional<z.ZodString>;
|
|
377
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
378
|
+
elementType: z.ZodLiteral<"policy">;
|
|
379
|
+
id: z.ZodString;
|
|
380
|
+
label: z.ZodString;
|
|
381
|
+
position: z.ZodObject<{
|
|
382
|
+
x: z.ZodNumber;
|
|
383
|
+
y: z.ZodNumber;
|
|
384
|
+
}, z.core.$strip>;
|
|
385
|
+
color: z.ZodOptional<z.ZodString>;
|
|
386
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
387
|
+
elementType: z.ZodLiteral<"readmodel">;
|
|
388
|
+
id: z.ZodString;
|
|
389
|
+
label: z.ZodString;
|
|
390
|
+
position: z.ZodObject<{
|
|
391
|
+
x: z.ZodNumber;
|
|
392
|
+
y: z.ZodNumber;
|
|
393
|
+
}, z.core.$strip>;
|
|
394
|
+
color: z.ZodOptional<z.ZodString>;
|
|
395
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
396
|
+
elementType: z.ZodLiteral<"external">;
|
|
397
|
+
id: z.ZodString;
|
|
398
|
+
label: z.ZodString;
|
|
399
|
+
position: z.ZodObject<{
|
|
400
|
+
x: z.ZodNumber;
|
|
401
|
+
y: z.ZodNumber;
|
|
402
|
+
}, z.core.$strip>;
|
|
403
|
+
color: z.ZodOptional<z.ZodString>;
|
|
404
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
405
|
+
elementType: z.ZodLiteral<"hotspot">;
|
|
406
|
+
attachedTo: z.ZodOptional<z.ZodString>;
|
|
407
|
+
id: z.ZodString;
|
|
408
|
+
label: z.ZodString;
|
|
409
|
+
position: z.ZodObject<{
|
|
410
|
+
x: z.ZodNumber;
|
|
411
|
+
y: z.ZodNumber;
|
|
412
|
+
}, z.core.$strip>;
|
|
413
|
+
color: z.ZodOptional<z.ZodString>;
|
|
414
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
415
|
+
elementType: z.ZodLiteral<"note">;
|
|
416
|
+
size: z.ZodOptional<z.ZodObject<{
|
|
417
|
+
width: z.ZodNumber;
|
|
418
|
+
height: z.ZodNumber;
|
|
419
|
+
}, z.core.$strip>>;
|
|
420
|
+
align: z.ZodOptional<z.ZodObject<{
|
|
421
|
+
horizontal: z.ZodOptional<z.ZodEnum<{
|
|
422
|
+
left: "left";
|
|
423
|
+
center: "center";
|
|
424
|
+
right: "right";
|
|
425
|
+
}>>;
|
|
426
|
+
vertical: z.ZodOptional<z.ZodEnum<{
|
|
427
|
+
top: "top";
|
|
428
|
+
middle: "middle";
|
|
429
|
+
bottom: "bottom";
|
|
430
|
+
}>>;
|
|
431
|
+
}, z.core.$strip>>;
|
|
432
|
+
attachedTo: z.ZodOptional<z.ZodString>;
|
|
433
|
+
id: z.ZodString;
|
|
434
|
+
label: z.ZodString;
|
|
435
|
+
position: z.ZodObject<{
|
|
436
|
+
x: z.ZodNumber;
|
|
437
|
+
y: z.ZodNumber;
|
|
438
|
+
}, z.core.$strip>;
|
|
439
|
+
color: z.ZodOptional<z.ZodString>;
|
|
440
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
441
|
+
elementType: z.ZodLiteral<"drawing">;
|
|
442
|
+
points: z.ZodArray<z.ZodObject<{
|
|
443
|
+
x: z.ZodNumber;
|
|
444
|
+
y: z.ZodNumber;
|
|
445
|
+
}, z.core.$strip>>;
|
|
446
|
+
closed: z.ZodOptional<z.ZodBoolean>;
|
|
447
|
+
strokeStyle: z.ZodOptional<z.ZodEnum<{
|
|
448
|
+
solid: "solid";
|
|
449
|
+
dashed: "dashed";
|
|
450
|
+
dotted: "dotted";
|
|
451
|
+
}>>;
|
|
452
|
+
id: z.ZodString;
|
|
453
|
+
label: z.ZodString;
|
|
454
|
+
position: z.ZodObject<{
|
|
455
|
+
x: z.ZodNumber;
|
|
456
|
+
y: z.ZodNumber;
|
|
457
|
+
}, z.core.$strip>;
|
|
458
|
+
color: z.ZodOptional<z.ZodString>;
|
|
459
|
+
}, z.core.$strip>], "elementType">>;
|
|
460
|
+
edges: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
461
|
+
id: z.ZodString;
|
|
462
|
+
edgeType: z.ZodLiteral<"arrow">;
|
|
463
|
+
from: z.ZodString;
|
|
464
|
+
to: z.ZodString;
|
|
465
|
+
label: z.ZodOptional<z.ZodString>;
|
|
466
|
+
}, z.core.$strip>], "edgeType">>;
|
|
467
|
+
rawPassthrough: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
468
|
+
}, z.core.$strip>;
|
|
469
|
+
type EventStormingBoardInput = z.input<typeof eventStormingBoardSchema>;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Schema migrations as an ordered chain of pure functions.
|
|
473
|
+
* `migrate(json)` reads `schemaVersion`, applies all necessary steps and returns the
|
|
474
|
+
* object raised to the current version (not yet validated).
|
|
475
|
+
*/
|
|
476
|
+
declare const CURRENT_SCHEMA_VERSION = 1;
|
|
477
|
+
type Json = Record<string, unknown>;
|
|
478
|
+
declare function migrate(input: unknown): Json;
|
|
479
|
+
|
|
480
|
+
export { ATTACHABLE_STICKY_KINDS, type ActorElement, type AggregateElement, type Arrow, type BoardConfig, type BoardEdge, type BoardElement, type BoardElementBase, type BoardLevel, CURRENT_SCHEMA_VERSION, type CommandElement, type Coordinate, DEFAULT_BOARD_LEVEL, DEFAULT_BOARD_SIZE, type DomainEventElement, type DrawingElement, type DrawingStrokeStyle, type ElementType, type EventStormingBoard, type EventStormingBoardInput, type ExternalSystemElement, HOST_STICKY_KINDS, type HotspotElement, LEVEL_STICKY_KINDS, type NoteAlign, type NoteAlignHorizontal, type NoteAlignVertical, type NoteElement, type PolicyElement, type ReadModelElement, boardEdgeSchema, boardElementSchema, createEmptyBoard, eventStormingBoardSchema, loadBoard, migrate, parseBoardJSON, serializeBoard, sortByTimeline, validateBoard };
|