@cratis/event-models 0.243.4 → 0.244.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 +4 -2
- package/dist/Model/SliceAnnotation.d.ts +6 -0
- package/dist/Model/SliceAnnotationStep.d.ts +7 -0
- package/dist/Model/index.d.ts +1 -0
- package/dist/Rows/Interaction/InteractionCard.d.ts +3 -1
- package/dist/Specifications/SpecificationCollection.d.ts +3 -2
- package/dist/Specifications/SpecificationHeader.d.ts +3 -1
- package/dist/event-model-document.schema.json +21 -0
- package/dist/index.js +2780 -2762
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -66,9 +66,11 @@ Add optional `annotations` to each slice in your document:
|
|
|
66
66
|
]
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
Each finding requires `severity` (`information`, `warning` or `error`) and a string `message`; `code` and
|
|
69
|
+
Each finding requires `severity` (`information`, `warning` or `error`) and a string `message`; `code` and the targets below are optional. The reader rejects unknown severities with `InvalidEventModelDocument` and the offending path. The header badge uses the worst severity and lists every finding in its tooltip and accessible label. Localize its words through `EventModelMessages.annotations`.
|
|
70
70
|
|
|
71
|
-
An `eventId` targets the card's own id within that slice, including a reference card's id rather than its `sourceEventId`. Matching cards get a dashed outline and a message badge; unmatched ids are ignored by the events row.
|
|
71
|
+
An `eventId` targets the card's own id within that slice, including a reference card's id rather than its `sourceEventId`. Matching cards get a dashed outline and a message badge; unmatched ids are ignored by the events row. Other optional ids target other cards of the same slice: `commandId` the command card, `readModelId` one of its read model cards (the first or an additional one), and `specificationId` one specification. A finding with a `specificationId` and no `specificationStep` marks that specification's header; with `specificationStep` (`given`, `givenReadModel`, `when`, `append` or `then`) and a `stepIndex` (its position among the steps of that kind, starting at 0) it is aimed at one step, and the host places it. The reader rejects an unknown `specificationStep`. Cards that carry a finding get the same dashed outline and badge as an event card. Ids that match nothing are ignored.
|
|
72
|
+
|
|
73
|
+
Findings work on read-only and collapsed headers and never change layout estimates. Omit `annotations` to keep the existing rendering. The built-in State View ordering warning shares the marker but its check is unchanged. See the `annotations` fixture and the Slices Area `Annotations` story.
|
|
72
74
|
|
|
73
75
|
## Select scopes, emphasize dependencies and draw slice links
|
|
74
76
|
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type { Guid } from '@cratis/fundamentals';
|
|
2
2
|
import type { AnnotationSeverity } from './AnnotationSeverity';
|
|
3
|
+
import type { SliceAnnotationStep } from './SliceAnnotationStep';
|
|
3
4
|
export interface SliceAnnotation {
|
|
4
5
|
severity: AnnotationSeverity;
|
|
5
6
|
code?: string;
|
|
6
7
|
message: string;
|
|
7
8
|
eventId?: Guid;
|
|
9
|
+
commandId?: Guid;
|
|
10
|
+
readModelId?: Guid;
|
|
11
|
+
specificationId?: Guid;
|
|
12
|
+
specificationStep?: SliceAnnotationStep;
|
|
13
|
+
stepIndex?: number;
|
|
8
14
|
}
|
package/dist/Model/index.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export * from './ReadModelItem';
|
|
|
40
40
|
export * from './ScreenTemplate';
|
|
41
41
|
export * from './Slice';
|
|
42
42
|
export * from './SliceAnnotation';
|
|
43
|
+
export * from './SliceAnnotationStep';
|
|
43
44
|
export * from './SliceSpecification';
|
|
44
45
|
export * from './SliceStatus';
|
|
45
46
|
export * from './SliceType';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Guid } from '@cratis/fundamentals';
|
|
2
2
|
import type { JsonSchema } from '@cratis/components/types';
|
|
3
3
|
import { ArtifactCardKind } from '../../Cards';
|
|
4
|
+
import type { SliceAnnotation } from '../../Model';
|
|
4
5
|
export type InteractionCardKind = ArtifactCardKind.command | ArtifactCardKind.readModel;
|
|
5
6
|
export interface InteractionCardProps {
|
|
6
7
|
sliceId: Guid;
|
|
@@ -11,6 +12,7 @@ export interface InteractionCardProps {
|
|
|
11
12
|
description?: string;
|
|
12
13
|
documentation?: string;
|
|
13
14
|
showDetails?: boolean;
|
|
15
|
+
annotations?: readonly SliceAnnotation[];
|
|
14
16
|
onRenamed?: (name: string) => void;
|
|
15
17
|
}
|
|
16
|
-
export declare const InteractionCard: ({ sliceId, kind, artifactId, name, schema, description, documentation, showDetails, onRenamed }: InteractionCardProps) => import("react").JSX.Element;
|
|
18
|
+
export declare const InteractionCard: ({ sliceId, kind, artifactId, name, schema, description, documentation, showDetails, annotations, onRenamed }: InteractionCardProps) => import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { Guid } from '@cratis/fundamentals';
|
|
3
|
-
import type { SliceSpecification } from '../Model';
|
|
3
|
+
import type { SliceAnnotation, SliceSpecification } from '../Model';
|
|
4
4
|
import { SpecificationRunState } from './SpecificationRunState';
|
|
5
5
|
export interface SpecificationCollectionProps {
|
|
6
6
|
sliceId: Guid;
|
|
@@ -13,6 +13,7 @@ export interface SpecificationCollectionProps {
|
|
|
13
13
|
};
|
|
14
14
|
executionLabel?: string;
|
|
15
15
|
nameNoticeFor?: (specification: SliceSpecification) => string | undefined;
|
|
16
|
+
annotations?: readonly SliceAnnotation[];
|
|
16
17
|
renderRows: (specification: SliceSpecification) => ReactNode;
|
|
17
18
|
}
|
|
18
|
-
export declare const SpecificationCollection: ({ sliceId, width, collapsed, specifications: incoming, runInfoFor, executionLabel, nameNoticeFor, renderRows }: SpecificationCollectionProps) => import("react").JSX.Element | null;
|
|
19
|
+
export declare const SpecificationCollection: ({ sliceId, width, collapsed, specifications: incoming, runInfoFor, executionLabel, nameNoticeFor, annotations, renderRows }: SpecificationCollectionProps) => import("react").JSX.Element | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { SliceAnnotation } from '../Model';
|
|
2
3
|
import { SpecificationRunState } from './SpecificationRunState';
|
|
3
4
|
export interface SpecificationHeaderProps {
|
|
4
5
|
name: string;
|
|
@@ -9,10 +10,11 @@ export interface SpecificationHeaderProps {
|
|
|
9
10
|
runState: SpecificationRunState;
|
|
10
11
|
runMessage?: string;
|
|
11
12
|
nameNotice?: string;
|
|
13
|
+
annotations?: readonly SliceAnnotation[];
|
|
12
14
|
executionLabel?: string;
|
|
13
15
|
onRenamed?: (name: string) => void;
|
|
14
16
|
onDeleted?: () => void;
|
|
15
17
|
runControl?: ReactNode;
|
|
16
18
|
gutter?: ReactNode;
|
|
17
19
|
}
|
|
18
|
-
export declare const SpecificationHeader: ({ name, description, documentation, collapsed, onToggleCollapse, runState, runMessage, nameNotice, executionLabel, onRenamed, onDeleted, runControl, gutter, }: SpecificationHeaderProps) => import("react").JSX.Element;
|
|
20
|
+
export declare const SpecificationHeader: ({ name, description, documentation, collapsed, onToggleCollapse, runState, runMessage, nameNotice, annotations, executionLabel, onRenamed, onDeleted, runControl, gutter, }: SpecificationHeaderProps) => import("react").JSX.Element;
|
|
@@ -335,6 +335,27 @@
|
|
|
335
335
|
"eventId": {
|
|
336
336
|
"$ref": "#/$defs/Guid",
|
|
337
337
|
"description": "The id of an owned or reference event card in this slice; unmatched ids are ignored."
|
|
338
|
+
},
|
|
339
|
+
"commandId": {
|
|
340
|
+
"$ref": "#/$defs/Guid",
|
|
341
|
+
"description": "The id of the slice's command card; an unmatched id is ignored."
|
|
342
|
+
},
|
|
343
|
+
"readModelId": {
|
|
344
|
+
"$ref": "#/$defs/Guid",
|
|
345
|
+
"description": "The id of one of the slice's read model cards; an unmatched id is ignored."
|
|
346
|
+
},
|
|
347
|
+
"specificationId": {
|
|
348
|
+
"$ref": "#/$defs/Guid",
|
|
349
|
+
"description": "The id of one of the slice's specifications; the finding marks its header. An unmatched id is ignored."
|
|
350
|
+
},
|
|
351
|
+
"specificationStep": {
|
|
352
|
+
"type": "string",
|
|
353
|
+
"enum": ["given", "givenReadModel", "when", "append", "then"],
|
|
354
|
+
"description": "The kind of step of the specification the finding is about."
|
|
355
|
+
},
|
|
356
|
+
"stepIndex": {
|
|
357
|
+
"type": "number",
|
|
358
|
+
"description": "The position of the step among the steps of its kind."
|
|
338
359
|
}
|
|
339
360
|
}
|
|
340
361
|
},
|