@miragon/team-topologies-schema-model 0.1.0 → 0.4.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 ADDED
@@ -0,0 +1,172 @@
1
+ # @miragon/team-topologies-schema-model
2
+
3
+ [![npm](https://img.shields.io/npm/v/@miragon/team-topologies-schema-model)](https://www.npmjs.com/package/@miragon/team-topologies-schema-model)
4
+ [![License: MIT](https://img.shields.io/github/license/Miragon/team-topologies-modeler)](https://github.com/Miragon/team-topologies-modeler/blob/main/LICENSE)
5
+
6
+ The **DOM-free core** of the [Team Topologies Modeler](../../README.md): the data model, the notation
7
+ specification, runtime validation, version migrations and deterministic JSON serialization for
8
+ [Team Topologies](https://teamtopologies.com/) diagrams.
9
+
10
+ This package has **no view, no DOM and no diagram-js** — it is plain TypeScript that runs anywhere
11
+ (browser, Node, an edge function, a CLI). The browser renderer
12
+ ([`@miragon/team-topologies-renderer`](../renderer)), the web app and the VS Code extension all build
13
+ on top of it. The DOM-freedom is enforced in CI (ESLint `no-restricted-imports` /
14
+ `no-restricted-globals` **and** `dependency-cruiser`), so a stray `diagram-js`/`window`/`document`
15
+ reference fails the build.
16
+
17
+ ## Install
18
+
19
+ ```bash
20
+ npm install @miragon/team-topologies-schema-model
21
+ ```
22
+
23
+ ## What's inside
24
+
25
+ - **The notation spec** — the four team types and three interaction modes, with their official
26
+ shapes, colours and stroke styles as plain data you can read and render against.
27
+ - **The document model** — a small, stable shape (`TtDocument`) with `version`, `title`, `nodes`,
28
+ `interactions` and `flows`.
29
+ - **Runtime validation** — Zod schemas + `parseDocument()` for everything that comes from a file, a
30
+ URL or `localStorage`.
31
+ - **Forward migrations** — `parseDocument()` migrates older documents up to the current version
32
+ before validating, keyed by the document `version`.
33
+ - **Deterministic serialization** — sorted, rounded and version-stamped output, so `.tt` /
34
+ `.ttm.json` files diff cleanly and share URLs stay stable.
35
+ - **Factories & a sample** — helpers that create well-formed elements and documents, plus a complete
36
+ example topology.
37
+
38
+ ## The document format
39
+
40
+ A diagram is a single JSON object. Interactions are **placed shapes** that overlap the teams they
41
+ relate to (spatial overlap, the Team Topologies convention) — there is no source/target reference.
42
+
43
+ ```jsonc
44
+ {
45
+ "version": 2,
46
+ "title": "Online retail — team topology",
47
+ "nodes": [
48
+ {
49
+ "id": "team_checkout",
50
+ "type": "stream-aligned",
51
+ "label": "Checkout Stream",
52
+ "position": { "x": 320, "y": 110 },
53
+ "size": { "width": 240, "height": 96 },
54
+ },
55
+ ],
56
+ "interactions": [
57
+ {
58
+ "id": "int_platform_checkout",
59
+ "mode": "x-as-a-service",
60
+ "position": { "x": 384, "y": 396 },
61
+ "size": { "width": 96, "height": 96 },
62
+ },
63
+ ],
64
+ "flows": [],
65
+ }
66
+ ```
67
+
68
+ | Field | Type | Notes |
69
+ | -------------- | -------------------- | ------------------------------------------------------------------------------------ |
70
+ | `version` | `2` | `DOCUMENT_VERSION`; older versions are migrated up on parse. |
71
+ | `title` | `string` | Diagram name. |
72
+ | `nodes` | `TeamNode[]` | A team: `type`, `label`, `position`, `size`, optional `description`/`fill`/`stroke`. |
73
+ | `interactions` | `InteractionShape[]` | A placed interaction: `mode`, `position`, `size`, optional `label`/`fill`/`stroke`. |
74
+ | `flows` | `FlowShape[]` | A flow-of-change band: `position`, `size`, optional `label`. |
75
+
76
+ ## Notation
77
+
78
+ The single source of truth for the visual notation. Shapes and colours follow the official
79
+ [Team-Shape-Templates](https://github.com/TeamTopologies/Team-Shape-Templates) — every element is
80
+ distinguished by shape **and** colour, so diagrams survive colour-vision deficiency and greyscale
81
+ printing. Team shapes are **solid** (long-lived); interaction shapes are **dashed and translucent**
82
+ (short-lived).
83
+
84
+ ### Team types — `TEAM_TYPE_SPECS`
85
+
86
+ | `type` | Label | Shape | Fill / Stroke |
87
+ | ----------------------- | --------------------- | ---------------------------- | --------------------- |
88
+ | `stream-aligned` | Stream-aligned | horizontal rounded rectangle | `#FFEDB8` / `#FFD966` |
89
+ | `enabling` | Enabling | vertical rounded rectangle | `#DFBDCF` / `#D09CB7` |
90
+ | `complicated-subsystem` | Complicated Subsystem | octagon | `#FFC08B` / `#E88814` |
91
+ | `platform` | Platform | square-cornered rectangle | `#B7CDF1` / `#6D9EEB` |
92
+
93
+ ### Interaction modes — `INTERACTION_MODE_SPECS`
94
+
95
+ | `mode` | Label | Glyph | Fill / Stroke |
96
+ | ---------------- | -------------- | ------------------------------------- | --------------------- |
97
+ | `collaboration` | Collaboration | parallelogram | `#C6BEDF` / `#967EE2` |
98
+ | `x-as-a-service` | X-as-a-Service | triangle (points provider → consumer) | `#B4B4B4` / `#999696` |
99
+ | `facilitating` | Facilitating | circle | `#C9DFBE` / `#78996B` |
100
+
101
+ The **flow of change** is described separately by `FLOW_SPEC` (a left-to-right dashed band).
102
+
103
+ ## Usage
104
+
105
+ ```ts
106
+ import {
107
+ emptyDocument,
108
+ createTeamNode,
109
+ createInteractionShape,
110
+ serializeDocument,
111
+ parseDocument,
112
+ SAMPLE_DOCUMENT,
113
+ } from "@miragon/team-topologies-schema-model";
114
+
115
+ // Build a document with the factories (notation defaults applied automatically)
116
+ const doc = emptyDocument("Online retail");
117
+ doc.nodes.push(createTeamNode("stream-aligned", { x: 320, y: 110 }));
118
+ doc.interactions.push(createInteractionShape("x-as-a-service", { x: 384, y: 396 }));
119
+
120
+ // Serialize deterministically (sorted, rounded, version-stamped) — diff- and URL-stable
121
+ const json = serializeDocument(doc);
122
+
123
+ // Validate + migrate anything untrusted (file / URL / localStorage)
124
+ const result = parseDocument(JSON.parse(json));
125
+ if (result.ok) {
126
+ console.log(result.document.title);
127
+ } else {
128
+ console.error(result.error);
129
+ }
130
+
131
+ // A ready-made example topology
132
+ console.log(SAMPLE_DOCUMENT.title);
133
+ ```
134
+
135
+ ### API surface
136
+
137
+ | Export | Purpose |
138
+ | ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
139
+ | `TtDocument`, `TeamNode`, `InteractionShape`, `FlowShape`, `Position`, `Size` | The document model types. |
140
+ | `TeamType`, `InteractionMode`, `TEAM_TYPES`, `INTERACTION_MODES` | The notation's discriminator unions + their value lists. |
141
+ | `TEAM_TYPE_SPECS`, `INTERACTION_MODE_SPECS`, `FLOW_SPEC`, `dashArray()` | The visual notation spec (shapes, colours, strokes) as data. |
142
+ | `documentSchema`, `teamNodeSchema`, `interactionSchema`, `flowSchema` | Zod schemas for each shape. |
143
+ | `parseDocument()`, `ParseResult` | Validate **and migrate** unknown input into a `TtDocument`. |
144
+ | `serializeDocument()`, `canonicalize()` | Deterministic JSON serialization (sorted, rounded, fixed key order). |
145
+ | `emptyDocument()`, `createTeamNode()`, `createInteractionShape()`, `createFlowShape()`, `newId()` | Factories with notation defaults + id generation. |
146
+ | `SAMPLE_DOCUMENT` | A complete example topology. |
147
+ | `DOCUMENT_VERSION` | The current document version (`2`). |
148
+
149
+ ## Determinism & migrations
150
+
151
+ - **Determinism** — `serializeDocument()` runs `canonicalize()` first: arrays are sorted by `id`,
152
+ coordinates are rounded to two decimals, optional fields with no value are dropped, and keys are
153
+ written in a fixed order. The same logical diagram always produces byte-identical JSON, which is
154
+ what makes Git diffs small and share URLs stable.
155
+ - **Migrations** — `parseDocument()` upgrades older documents before validating (keyed by `version`).
156
+ The `1 → 2` step drops the legacy `showFlowOfChange` flag and the old edge-based interactions,
157
+ keeping only interactions that carry geometry (the placed-shape model).
158
+
159
+ ## Development
160
+
161
+ This package is part of the [Team Topologies Modeler](../../README.md) monorepo and is normally
162
+ consumed from source. From the repo root:
163
+
164
+ ```bash
165
+ npm run build -w packages/schema-model # tsup → dist/ (publish build)
166
+ npm test # Vitest unit tests
167
+ npm run typecheck # tsc, compiled WITHOUT the DOM lib
168
+ ```
169
+
170
+ ## License
171
+
172
+ [MIT](../../LICENSE).
package/dist/index.d.cts CHANGED
@@ -163,418 +163,102 @@ declare const ALL_INTERACTION_SPECS: readonly InteractionModeSpec[];
163
163
 
164
164
  declare const teamNodeSchema: z.ZodObject<{
165
165
  id: z.ZodString;
166
- type: z.ZodEnum<[string, ...string[]]>;
166
+ type: z.ZodEnum<{
167
+ [x: string]: string;
168
+ }>;
167
169
  label: z.ZodString;
168
170
  description: z.ZodOptional<z.ZodString>;
169
171
  position: z.ZodObject<{
170
172
  x: z.ZodNumber;
171
173
  y: z.ZodNumber;
172
- }, "strip", z.ZodTypeAny, {
173
- x: number;
174
- y: number;
175
- }, {
176
- x: number;
177
- y: number;
178
- }>;
174
+ }, z.core.$strip>;
179
175
  size: z.ZodObject<{
180
176
  width: z.ZodNumber;
181
177
  height: z.ZodNumber;
182
- }, "strip", z.ZodTypeAny, {
183
- width: number;
184
- height: number;
185
- }, {
186
- width: number;
187
- height: number;
188
- }>;
178
+ }, z.core.$strip>;
189
179
  fill: z.ZodOptional<z.ZodString>;
190
180
  stroke: z.ZodOptional<z.ZodString>;
191
- }, "strip", z.ZodTypeAny, {
192
- type: string;
193
- id: string;
194
- label: string;
195
- position: {
196
- x: number;
197
- y: number;
198
- };
199
- size: {
200
- width: number;
201
- height: number;
202
- };
203
- fill?: string | undefined;
204
- description?: string | undefined;
205
- stroke?: string | undefined;
206
- }, {
207
- type: string;
208
- id: string;
209
- label: string;
210
- position: {
211
- x: number;
212
- y: number;
213
- };
214
- size: {
215
- width: number;
216
- height: number;
217
- };
218
- fill?: string | undefined;
219
- description?: string | undefined;
220
- stroke?: string | undefined;
221
- }>;
181
+ }, z.core.$strip>;
222
182
  declare const interactionSchema: z.ZodObject<{
223
183
  id: z.ZodString;
224
- mode: z.ZodEnum<[string, ...string[]]>;
184
+ mode: z.ZodEnum<{
185
+ [x: string]: string;
186
+ }>;
225
187
  label: z.ZodOptional<z.ZodString>;
226
188
  position: z.ZodObject<{
227
189
  x: z.ZodNumber;
228
190
  y: z.ZodNumber;
229
- }, "strip", z.ZodTypeAny, {
230
- x: number;
231
- y: number;
232
- }, {
233
- x: number;
234
- y: number;
235
- }>;
191
+ }, z.core.$strip>;
236
192
  size: z.ZodObject<{
237
193
  width: z.ZodNumber;
238
194
  height: z.ZodNumber;
239
- }, "strip", z.ZodTypeAny, {
240
- width: number;
241
- height: number;
242
- }, {
243
- width: number;
244
- height: number;
245
- }>;
195
+ }, z.core.$strip>;
246
196
  fill: z.ZodOptional<z.ZodString>;
247
197
  stroke: z.ZodOptional<z.ZodString>;
248
- }, "strip", z.ZodTypeAny, {
249
- id: string;
250
- position: {
251
- x: number;
252
- y: number;
253
- };
254
- size: {
255
- width: number;
256
- height: number;
257
- };
258
- mode: string;
259
- fill?: string | undefined;
260
- label?: string | undefined;
261
- stroke?: string | undefined;
262
- }, {
263
- id: string;
264
- position: {
265
- x: number;
266
- y: number;
267
- };
268
- size: {
269
- width: number;
270
- height: number;
271
- };
272
- mode: string;
273
- fill?: string | undefined;
274
- label?: string | undefined;
275
- stroke?: string | undefined;
276
- }>;
198
+ }, z.core.$strip>;
277
199
  declare const flowSchema: z.ZodObject<{
278
200
  id: z.ZodString;
279
201
  label: z.ZodOptional<z.ZodString>;
280
202
  position: z.ZodObject<{
281
203
  x: z.ZodNumber;
282
204
  y: z.ZodNumber;
283
- }, "strip", z.ZodTypeAny, {
284
- x: number;
285
- y: number;
286
- }, {
287
- x: number;
288
- y: number;
289
- }>;
205
+ }, z.core.$strip>;
290
206
  size: z.ZodObject<{
291
207
  width: z.ZodNumber;
292
208
  height: z.ZodNumber;
293
- }, "strip", z.ZodTypeAny, {
294
- width: number;
295
- height: number;
296
- }, {
297
- width: number;
298
- height: number;
299
- }>;
300
- }, "strip", z.ZodTypeAny, {
301
- id: string;
302
- position: {
303
- x: number;
304
- y: number;
305
- };
306
- size: {
307
- width: number;
308
- height: number;
309
- };
310
- label?: string | undefined;
311
- }, {
312
- id: string;
313
- position: {
314
- x: number;
315
- y: number;
316
- };
317
- size: {
318
- width: number;
319
- height: number;
320
- };
321
- label?: string | undefined;
322
- }>;
209
+ }, z.core.$strip>;
210
+ }, z.core.$strip>;
323
211
  declare const documentSchema: z.ZodObject<{
324
212
  version: z.ZodLiteral<2>;
325
213
  title: z.ZodString;
326
214
  nodes: z.ZodArray<z.ZodObject<{
327
215
  id: z.ZodString;
328
- type: z.ZodEnum<[string, ...string[]]>;
216
+ type: z.ZodEnum<{
217
+ [x: string]: string;
218
+ }>;
329
219
  label: z.ZodString;
330
220
  description: z.ZodOptional<z.ZodString>;
331
221
  position: z.ZodObject<{
332
222
  x: z.ZodNumber;
333
223
  y: z.ZodNumber;
334
- }, "strip", z.ZodTypeAny, {
335
- x: number;
336
- y: number;
337
- }, {
338
- x: number;
339
- y: number;
340
- }>;
224
+ }, z.core.$strip>;
341
225
  size: z.ZodObject<{
342
226
  width: z.ZodNumber;
343
227
  height: z.ZodNumber;
344
- }, "strip", z.ZodTypeAny, {
345
- width: number;
346
- height: number;
347
- }, {
348
- width: number;
349
- height: number;
350
- }>;
228
+ }, z.core.$strip>;
351
229
  fill: z.ZodOptional<z.ZodString>;
352
230
  stroke: z.ZodOptional<z.ZodString>;
353
- }, "strip", z.ZodTypeAny, {
354
- type: string;
355
- id: string;
356
- label: string;
357
- position: {
358
- x: number;
359
- y: number;
360
- };
361
- size: {
362
- width: number;
363
- height: number;
364
- };
365
- fill?: string | undefined;
366
- description?: string | undefined;
367
- stroke?: string | undefined;
368
- }, {
369
- type: string;
370
- id: string;
371
- label: string;
372
- position: {
373
- x: number;
374
- y: number;
375
- };
376
- size: {
377
- width: number;
378
- height: number;
379
- };
380
- fill?: string | undefined;
381
- description?: string | undefined;
382
- stroke?: string | undefined;
383
- }>, "many">;
231
+ }, z.core.$strip>>;
384
232
  interactions: z.ZodArray<z.ZodObject<{
385
233
  id: z.ZodString;
386
- mode: z.ZodEnum<[string, ...string[]]>;
234
+ mode: z.ZodEnum<{
235
+ [x: string]: string;
236
+ }>;
387
237
  label: z.ZodOptional<z.ZodString>;
388
238
  position: z.ZodObject<{
389
239
  x: z.ZodNumber;
390
240
  y: z.ZodNumber;
391
- }, "strip", z.ZodTypeAny, {
392
- x: number;
393
- y: number;
394
- }, {
395
- x: number;
396
- y: number;
397
- }>;
241
+ }, z.core.$strip>;
398
242
  size: z.ZodObject<{
399
243
  width: z.ZodNumber;
400
244
  height: z.ZodNumber;
401
- }, "strip", z.ZodTypeAny, {
402
- width: number;
403
- height: number;
404
- }, {
405
- width: number;
406
- height: number;
407
- }>;
245
+ }, z.core.$strip>;
408
246
  fill: z.ZodOptional<z.ZodString>;
409
247
  stroke: z.ZodOptional<z.ZodString>;
410
- }, "strip", z.ZodTypeAny, {
411
- id: string;
412
- position: {
413
- x: number;
414
- y: number;
415
- };
416
- size: {
417
- width: number;
418
- height: number;
419
- };
420
- mode: string;
421
- fill?: string | undefined;
422
- label?: string | undefined;
423
- stroke?: string | undefined;
424
- }, {
425
- id: string;
426
- position: {
427
- x: number;
428
- y: number;
429
- };
430
- size: {
431
- width: number;
432
- height: number;
433
- };
434
- mode: string;
435
- fill?: string | undefined;
436
- label?: string | undefined;
437
- stroke?: string | undefined;
438
- }>, "many">;
248
+ }, z.core.$strip>>;
439
249
  flows: z.ZodArray<z.ZodObject<{
440
250
  id: z.ZodString;
441
251
  label: z.ZodOptional<z.ZodString>;
442
252
  position: z.ZodObject<{
443
253
  x: z.ZodNumber;
444
254
  y: z.ZodNumber;
445
- }, "strip", z.ZodTypeAny, {
446
- x: number;
447
- y: number;
448
- }, {
449
- x: number;
450
- y: number;
451
- }>;
255
+ }, z.core.$strip>;
452
256
  size: z.ZodObject<{
453
257
  width: z.ZodNumber;
454
258
  height: z.ZodNumber;
455
- }, "strip", z.ZodTypeAny, {
456
- width: number;
457
- height: number;
458
- }, {
459
- width: number;
460
- height: number;
461
- }>;
462
- }, "strip", z.ZodTypeAny, {
463
- id: string;
464
- position: {
465
- x: number;
466
- y: number;
467
- };
468
- size: {
469
- width: number;
470
- height: number;
471
- };
472
- label?: string | undefined;
473
- }, {
474
- id: string;
475
- position: {
476
- x: number;
477
- y: number;
478
- };
479
- size: {
480
- width: number;
481
- height: number;
482
- };
483
- label?: string | undefined;
484
- }>, "many">;
485
- }, "strip", z.ZodTypeAny, {
486
- version: 2;
487
- title: string;
488
- nodes: {
489
- type: string;
490
- id: string;
491
- label: string;
492
- position: {
493
- x: number;
494
- y: number;
495
- };
496
- size: {
497
- width: number;
498
- height: number;
499
- };
500
- fill?: string | undefined;
501
- description?: string | undefined;
502
- stroke?: string | undefined;
503
- }[];
504
- interactions: {
505
- id: string;
506
- position: {
507
- x: number;
508
- y: number;
509
- };
510
- size: {
511
- width: number;
512
- height: number;
513
- };
514
- mode: string;
515
- fill?: string | undefined;
516
- label?: string | undefined;
517
- stroke?: string | undefined;
518
- }[];
519
- flows: {
520
- id: string;
521
- position: {
522
- x: number;
523
- y: number;
524
- };
525
- size: {
526
- width: number;
527
- height: number;
528
- };
529
- label?: string | undefined;
530
- }[];
531
- }, {
532
- version: 2;
533
- title: string;
534
- nodes: {
535
- type: string;
536
- id: string;
537
- label: string;
538
- position: {
539
- x: number;
540
- y: number;
541
- };
542
- size: {
543
- width: number;
544
- height: number;
545
- };
546
- fill?: string | undefined;
547
- description?: string | undefined;
548
- stroke?: string | undefined;
549
- }[];
550
- interactions: {
551
- id: string;
552
- position: {
553
- x: number;
554
- y: number;
555
- };
556
- size: {
557
- width: number;
558
- height: number;
559
- };
560
- mode: string;
561
- fill?: string | undefined;
562
- label?: string | undefined;
563
- stroke?: string | undefined;
564
- }[];
565
- flows: {
566
- id: string;
567
- position: {
568
- x: number;
569
- y: number;
570
- };
571
- size: {
572
- width: number;
573
- height: number;
574
- };
575
- label?: string | undefined;
576
- }[];
577
- }>;
259
+ }, z.core.$strip>;
260
+ }, z.core.$strip>>;
261
+ }, z.core.$strip>;
578
262
  type ParseResult = {
579
263
  ok: true;
580
264
  document: TtDocument;
package/dist/index.d.ts CHANGED
@@ -163,418 +163,102 @@ declare const ALL_INTERACTION_SPECS: readonly InteractionModeSpec[];
163
163
 
164
164
  declare const teamNodeSchema: z.ZodObject<{
165
165
  id: z.ZodString;
166
- type: z.ZodEnum<[string, ...string[]]>;
166
+ type: z.ZodEnum<{
167
+ [x: string]: string;
168
+ }>;
167
169
  label: z.ZodString;
168
170
  description: z.ZodOptional<z.ZodString>;
169
171
  position: z.ZodObject<{
170
172
  x: z.ZodNumber;
171
173
  y: z.ZodNumber;
172
- }, "strip", z.ZodTypeAny, {
173
- x: number;
174
- y: number;
175
- }, {
176
- x: number;
177
- y: number;
178
- }>;
174
+ }, z.core.$strip>;
179
175
  size: z.ZodObject<{
180
176
  width: z.ZodNumber;
181
177
  height: z.ZodNumber;
182
- }, "strip", z.ZodTypeAny, {
183
- width: number;
184
- height: number;
185
- }, {
186
- width: number;
187
- height: number;
188
- }>;
178
+ }, z.core.$strip>;
189
179
  fill: z.ZodOptional<z.ZodString>;
190
180
  stroke: z.ZodOptional<z.ZodString>;
191
- }, "strip", z.ZodTypeAny, {
192
- type: string;
193
- id: string;
194
- label: string;
195
- position: {
196
- x: number;
197
- y: number;
198
- };
199
- size: {
200
- width: number;
201
- height: number;
202
- };
203
- fill?: string | undefined;
204
- description?: string | undefined;
205
- stroke?: string | undefined;
206
- }, {
207
- type: string;
208
- id: string;
209
- label: string;
210
- position: {
211
- x: number;
212
- y: number;
213
- };
214
- size: {
215
- width: number;
216
- height: number;
217
- };
218
- fill?: string | undefined;
219
- description?: string | undefined;
220
- stroke?: string | undefined;
221
- }>;
181
+ }, z.core.$strip>;
222
182
  declare const interactionSchema: z.ZodObject<{
223
183
  id: z.ZodString;
224
- mode: z.ZodEnum<[string, ...string[]]>;
184
+ mode: z.ZodEnum<{
185
+ [x: string]: string;
186
+ }>;
225
187
  label: z.ZodOptional<z.ZodString>;
226
188
  position: z.ZodObject<{
227
189
  x: z.ZodNumber;
228
190
  y: z.ZodNumber;
229
- }, "strip", z.ZodTypeAny, {
230
- x: number;
231
- y: number;
232
- }, {
233
- x: number;
234
- y: number;
235
- }>;
191
+ }, z.core.$strip>;
236
192
  size: z.ZodObject<{
237
193
  width: z.ZodNumber;
238
194
  height: z.ZodNumber;
239
- }, "strip", z.ZodTypeAny, {
240
- width: number;
241
- height: number;
242
- }, {
243
- width: number;
244
- height: number;
245
- }>;
195
+ }, z.core.$strip>;
246
196
  fill: z.ZodOptional<z.ZodString>;
247
197
  stroke: z.ZodOptional<z.ZodString>;
248
- }, "strip", z.ZodTypeAny, {
249
- id: string;
250
- position: {
251
- x: number;
252
- y: number;
253
- };
254
- size: {
255
- width: number;
256
- height: number;
257
- };
258
- mode: string;
259
- fill?: string | undefined;
260
- label?: string | undefined;
261
- stroke?: string | undefined;
262
- }, {
263
- id: string;
264
- position: {
265
- x: number;
266
- y: number;
267
- };
268
- size: {
269
- width: number;
270
- height: number;
271
- };
272
- mode: string;
273
- fill?: string | undefined;
274
- label?: string | undefined;
275
- stroke?: string | undefined;
276
- }>;
198
+ }, z.core.$strip>;
277
199
  declare const flowSchema: z.ZodObject<{
278
200
  id: z.ZodString;
279
201
  label: z.ZodOptional<z.ZodString>;
280
202
  position: z.ZodObject<{
281
203
  x: z.ZodNumber;
282
204
  y: z.ZodNumber;
283
- }, "strip", z.ZodTypeAny, {
284
- x: number;
285
- y: number;
286
- }, {
287
- x: number;
288
- y: number;
289
- }>;
205
+ }, z.core.$strip>;
290
206
  size: z.ZodObject<{
291
207
  width: z.ZodNumber;
292
208
  height: z.ZodNumber;
293
- }, "strip", z.ZodTypeAny, {
294
- width: number;
295
- height: number;
296
- }, {
297
- width: number;
298
- height: number;
299
- }>;
300
- }, "strip", z.ZodTypeAny, {
301
- id: string;
302
- position: {
303
- x: number;
304
- y: number;
305
- };
306
- size: {
307
- width: number;
308
- height: number;
309
- };
310
- label?: string | undefined;
311
- }, {
312
- id: string;
313
- position: {
314
- x: number;
315
- y: number;
316
- };
317
- size: {
318
- width: number;
319
- height: number;
320
- };
321
- label?: string | undefined;
322
- }>;
209
+ }, z.core.$strip>;
210
+ }, z.core.$strip>;
323
211
  declare const documentSchema: z.ZodObject<{
324
212
  version: z.ZodLiteral<2>;
325
213
  title: z.ZodString;
326
214
  nodes: z.ZodArray<z.ZodObject<{
327
215
  id: z.ZodString;
328
- type: z.ZodEnum<[string, ...string[]]>;
216
+ type: z.ZodEnum<{
217
+ [x: string]: string;
218
+ }>;
329
219
  label: z.ZodString;
330
220
  description: z.ZodOptional<z.ZodString>;
331
221
  position: z.ZodObject<{
332
222
  x: z.ZodNumber;
333
223
  y: z.ZodNumber;
334
- }, "strip", z.ZodTypeAny, {
335
- x: number;
336
- y: number;
337
- }, {
338
- x: number;
339
- y: number;
340
- }>;
224
+ }, z.core.$strip>;
341
225
  size: z.ZodObject<{
342
226
  width: z.ZodNumber;
343
227
  height: z.ZodNumber;
344
- }, "strip", z.ZodTypeAny, {
345
- width: number;
346
- height: number;
347
- }, {
348
- width: number;
349
- height: number;
350
- }>;
228
+ }, z.core.$strip>;
351
229
  fill: z.ZodOptional<z.ZodString>;
352
230
  stroke: z.ZodOptional<z.ZodString>;
353
- }, "strip", z.ZodTypeAny, {
354
- type: string;
355
- id: string;
356
- label: string;
357
- position: {
358
- x: number;
359
- y: number;
360
- };
361
- size: {
362
- width: number;
363
- height: number;
364
- };
365
- fill?: string | undefined;
366
- description?: string | undefined;
367
- stroke?: string | undefined;
368
- }, {
369
- type: string;
370
- id: string;
371
- label: string;
372
- position: {
373
- x: number;
374
- y: number;
375
- };
376
- size: {
377
- width: number;
378
- height: number;
379
- };
380
- fill?: string | undefined;
381
- description?: string | undefined;
382
- stroke?: string | undefined;
383
- }>, "many">;
231
+ }, z.core.$strip>>;
384
232
  interactions: z.ZodArray<z.ZodObject<{
385
233
  id: z.ZodString;
386
- mode: z.ZodEnum<[string, ...string[]]>;
234
+ mode: z.ZodEnum<{
235
+ [x: string]: string;
236
+ }>;
387
237
  label: z.ZodOptional<z.ZodString>;
388
238
  position: z.ZodObject<{
389
239
  x: z.ZodNumber;
390
240
  y: z.ZodNumber;
391
- }, "strip", z.ZodTypeAny, {
392
- x: number;
393
- y: number;
394
- }, {
395
- x: number;
396
- y: number;
397
- }>;
241
+ }, z.core.$strip>;
398
242
  size: z.ZodObject<{
399
243
  width: z.ZodNumber;
400
244
  height: z.ZodNumber;
401
- }, "strip", z.ZodTypeAny, {
402
- width: number;
403
- height: number;
404
- }, {
405
- width: number;
406
- height: number;
407
- }>;
245
+ }, z.core.$strip>;
408
246
  fill: z.ZodOptional<z.ZodString>;
409
247
  stroke: z.ZodOptional<z.ZodString>;
410
- }, "strip", z.ZodTypeAny, {
411
- id: string;
412
- position: {
413
- x: number;
414
- y: number;
415
- };
416
- size: {
417
- width: number;
418
- height: number;
419
- };
420
- mode: string;
421
- fill?: string | undefined;
422
- label?: string | undefined;
423
- stroke?: string | undefined;
424
- }, {
425
- id: string;
426
- position: {
427
- x: number;
428
- y: number;
429
- };
430
- size: {
431
- width: number;
432
- height: number;
433
- };
434
- mode: string;
435
- fill?: string | undefined;
436
- label?: string | undefined;
437
- stroke?: string | undefined;
438
- }>, "many">;
248
+ }, z.core.$strip>>;
439
249
  flows: z.ZodArray<z.ZodObject<{
440
250
  id: z.ZodString;
441
251
  label: z.ZodOptional<z.ZodString>;
442
252
  position: z.ZodObject<{
443
253
  x: z.ZodNumber;
444
254
  y: z.ZodNumber;
445
- }, "strip", z.ZodTypeAny, {
446
- x: number;
447
- y: number;
448
- }, {
449
- x: number;
450
- y: number;
451
- }>;
255
+ }, z.core.$strip>;
452
256
  size: z.ZodObject<{
453
257
  width: z.ZodNumber;
454
258
  height: z.ZodNumber;
455
- }, "strip", z.ZodTypeAny, {
456
- width: number;
457
- height: number;
458
- }, {
459
- width: number;
460
- height: number;
461
- }>;
462
- }, "strip", z.ZodTypeAny, {
463
- id: string;
464
- position: {
465
- x: number;
466
- y: number;
467
- };
468
- size: {
469
- width: number;
470
- height: number;
471
- };
472
- label?: string | undefined;
473
- }, {
474
- id: string;
475
- position: {
476
- x: number;
477
- y: number;
478
- };
479
- size: {
480
- width: number;
481
- height: number;
482
- };
483
- label?: string | undefined;
484
- }>, "many">;
485
- }, "strip", z.ZodTypeAny, {
486
- version: 2;
487
- title: string;
488
- nodes: {
489
- type: string;
490
- id: string;
491
- label: string;
492
- position: {
493
- x: number;
494
- y: number;
495
- };
496
- size: {
497
- width: number;
498
- height: number;
499
- };
500
- fill?: string | undefined;
501
- description?: string | undefined;
502
- stroke?: string | undefined;
503
- }[];
504
- interactions: {
505
- id: string;
506
- position: {
507
- x: number;
508
- y: number;
509
- };
510
- size: {
511
- width: number;
512
- height: number;
513
- };
514
- mode: string;
515
- fill?: string | undefined;
516
- label?: string | undefined;
517
- stroke?: string | undefined;
518
- }[];
519
- flows: {
520
- id: string;
521
- position: {
522
- x: number;
523
- y: number;
524
- };
525
- size: {
526
- width: number;
527
- height: number;
528
- };
529
- label?: string | undefined;
530
- }[];
531
- }, {
532
- version: 2;
533
- title: string;
534
- nodes: {
535
- type: string;
536
- id: string;
537
- label: string;
538
- position: {
539
- x: number;
540
- y: number;
541
- };
542
- size: {
543
- width: number;
544
- height: number;
545
- };
546
- fill?: string | undefined;
547
- description?: string | undefined;
548
- stroke?: string | undefined;
549
- }[];
550
- interactions: {
551
- id: string;
552
- position: {
553
- x: number;
554
- y: number;
555
- };
556
- size: {
557
- width: number;
558
- height: number;
559
- };
560
- mode: string;
561
- fill?: string | undefined;
562
- label?: string | undefined;
563
- stroke?: string | undefined;
564
- }[];
565
- flows: {
566
- id: string;
567
- position: {
568
- x: number;
569
- y: number;
570
- };
571
- size: {
572
- width: number;
573
- height: number;
574
- };
575
- label?: string | undefined;
576
- }[];
577
- }>;
259
+ }, z.core.$strip>;
260
+ }, z.core.$strip>>;
261
+ }, z.core.$strip>;
578
262
  type ParseResult = {
579
263
  ok: true;
580
264
  document: TtDocument;
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@miragon/team-topologies-schema-model",
3
- "version": "0.1.0",
3
+ "version": "0.4.0",
4
4
  "description": "The Team Topologies data model with types, the notation specification, runtime validation, migrations and deterministic JSON serialization.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+https://github.com/miragon/team-topologies-modeler.git",
8
+ "url": "git+https://github.com/Miragon/team-topologies-modeler.git",
9
9
  "directory": "packages/schema-model"
10
10
  },
11
- "homepage": "https://github.com/miragon/team-topologies-modeler/tree/main/packages/schema-model#readme",
12
- "bugs": "https://github.com/miragon/team-topologies-modeler/issues",
11
+ "homepage": "https://github.com/Miragon/team-topologies-modeler/tree/main/packages/schema-model#readme",
12
+ "bugs": "https://github.com/Miragon/team-topologies-modeler/issues",
13
13
  "type": "module",
14
14
  "sideEffects": false,
15
15
  "exports": {
@@ -34,12 +34,12 @@
34
34
  "test": "npm --prefix ../.. run test"
35
35
  },
36
36
  "dependencies": {
37
- "nanoid": "5.0.9",
38
- "zod": "3.24.1"
37
+ "nanoid": "5.1.16",
38
+ "zod": "4.4.3"
39
39
  },
40
40
  "devDependencies": {
41
- "tsup": "8.3.5",
42
- "typescript": "5.7.2",
43
- "vitest": "3.2.6"
41
+ "tsup": "8.5.1",
42
+ "typescript": "6.0.3",
43
+ "vitest": "4.1.9"
44
44
  }
45
45
  }