process-graph 1.0.6 → 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.
- package/README.md +85 -17
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +92 -0
- package/dist/cli.d.ts +512 -0
- package/dist/cli.js +3 -0
- package/dist/control-aDk9560d.js +294 -0
- package/dist/detail-panel-B1ZmMuJT.js +341 -0
- package/dist/dist-BpCBmnMl.js +582 -0
- package/dist/dist-HLlW8vgT.js +1388 -0
- package/dist/dist-IjrgWhHQ.js +3 -0
- package/dist/errors-BZe5WzCn.js +19 -0
- package/dist/exit-codes-0ultCqdS.js +23 -0
- package/dist/graphql-C1j5wQFz.d.ts +631 -0
- package/dist/index-CCfe0csl.d.ts +353 -0
- package/dist/index-CmZOswkx.d.ts +512 -0
- package/dist/index-CoA6vXqe.d.ts +404 -0
- package/dist/index-CptUHq6F.d.ts +58 -0
- package/dist/index-CrM5qWUA.d.ts +110 -0
- package/dist/index-DhbvDgK4.d.ts +1582 -0
- package/dist/index-DricKcyl.d.ts +421 -0
- package/dist/index.d.ts +111 -4
- package/dist/index.js +929 -5
- package/dist/layout-CCM-KBdp.js +307 -0
- package/dist/layout.d.ts +8 -0
- package/dist/layout.js +2 -0
- package/dist/node-AchI1T-K.js +40 -0
- package/dist/open-CyRXJ4bt.js +29 -0
- package/dist/parse-CuipC_2K.js +41 -0
- package/dist/queries-CCexJAE2.js +2202 -0
- package/dist/react-flow/style.css +658 -0
- package/dist/react-flow.d.ts +173 -0
- package/dist/react-flow.js +450 -0
- package/dist/react.d.ts +2 -0
- package/dist/react.js +107 -0
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/router-D4gtTlXm.js +188 -0
- package/dist/schema-CVnS6HiX.js +234 -0
- package/dist/selection-BW_xXWOy.js +314 -0
- package/dist/source/github/node.d.ts +16 -0
- package/dist/source/github/node.js +2 -0
- package/dist/source/github.d.ts +49 -0
- package/dist/source/github.js +201 -0
- package/dist/source-DRDpEA8Q.js +1316 -0
- package/dist/status-Bm1CGu9C.js +11 -0
- package/dist/store/node.d.ts +24 -0
- package/dist/store/node.js +2 -0
- package/dist/store/wasm/worker.d.ts +16 -0
- package/dist/store/wasm/worker.js +98 -0
- package/dist/store/wasm.d.ts +9 -0
- package/dist/store/wasm.js +11 -0
- package/dist/store-BcR70CaO.js +1287 -0
- package/dist/store.d.ts +1328 -0
- package/dist/store.js +238 -0
- package/dist/ui/style.css +351 -0
- package/dist/ui.d.ts +235 -0
- package/dist/ui.js +2 -0
- package/dist/validate-DF3mQZww.js +125 -0
- package/package.json +148 -13
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { JsonValue, PredicateNode, PredicateNodeSchema } from "trilean";
|
|
3
|
+
//#region ../../core/graph/schema/dist/ids.d.ts
|
|
4
|
+
interface IdSpace {
|
|
5
|
+
/** Every declared participant. */
|
|
6
|
+
readonly participant: string;
|
|
7
|
+
/** Participants of kind "role" or "system": the ones that can act. */
|
|
8
|
+
readonly actor: string;
|
|
9
|
+
/** Participants of kind "entity": the ones whose lifecycle a state machine can track. */
|
|
10
|
+
readonly entity: string;
|
|
11
|
+
readonly event: string;
|
|
12
|
+
readonly action: string;
|
|
13
|
+
readonly element: string;
|
|
14
|
+
readonly transition: string;
|
|
15
|
+
readonly fragment: string;
|
|
16
|
+
/** The data or deliverables activities consume and produce. */
|
|
17
|
+
readonly artefact: string;
|
|
18
|
+
}
|
|
19
|
+
/** The open identifier space, used for models whose identifiers are only known at runtime. */
|
|
20
|
+
type OpenIds = IdSpace;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region ../../core/graph/schema/dist/vocabulary.d.ts
|
|
23
|
+
/** What a participant is: a `role` or `system` can act, an `entity` has a lifecycle a state machine can track. */
|
|
24
|
+
declare const participantKinds: readonly ["role", "system", "entity"];
|
|
25
|
+
type ParticipantKind = (typeof participantKinds)[number];
|
|
26
|
+
declare const pseudoRoles: readonly ["initial", "final", "fork", "join", "history"];
|
|
27
|
+
type PseudoRole = (typeof pseudoRoles)[number];
|
|
28
|
+
declare const messageModes: readonly ["sync", "async", "reply", "create", "destroy"];
|
|
29
|
+
type MessageMode = (typeof messageModes)[number];
|
|
30
|
+
declare const fragmentOperators: readonly ["alt", "opt", "loop", "par", "break"];
|
|
31
|
+
type FragmentOperator = (typeof fragmentOperators)[number];
|
|
32
|
+
/** Where an element stands in a run: finished, still to do, or not known. Run state is supplied by sources and never stored in the model. */
|
|
33
|
+
declare const overlayStatuses: readonly ["done", "open", "unknown"];
|
|
34
|
+
type OverlayStatus = (typeof overlayStatuses)[number];
|
|
35
|
+
declare const notations: readonly ["flowchart", "swimlane", "stateMachine", "sequence"];
|
|
36
|
+
type Notation = (typeof notations)[number];
|
|
37
|
+
/** The kinds of element a model declares, one per variant of `Element`. */
|
|
38
|
+
declare const elementKinds: readonly ["activity", "decision", "state", "pseudo", "message"];
|
|
39
|
+
type ElementKind = (typeof elementKinds)[number];
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region ../../core/graph/schema/dist/declarations.d.ts
|
|
42
|
+
interface Participant<Id extends string, Kind extends ParticipantKind = ParticipantKind> {
|
|
43
|
+
readonly id: Id;
|
|
44
|
+
readonly label: string;
|
|
45
|
+
readonly kind: Kind;
|
|
46
|
+
}
|
|
47
|
+
type AnyParticipants = readonly Participant<string>[];
|
|
48
|
+
/** Identifiers of the declared participants whose kind is one of `Kind`. */
|
|
49
|
+
type IdsOfKind<Ps extends AnyParticipants, Kind extends ParticipantKind> = Extract<Ps[number], {
|
|
50
|
+
readonly kind: Kind;
|
|
51
|
+
}>["id"];
|
|
52
|
+
interface EventDef<Id extends string> {
|
|
53
|
+
readonly id: Id;
|
|
54
|
+
readonly name: string;
|
|
55
|
+
readonly payload?: Readonly<Record<string, string>>;
|
|
56
|
+
}
|
|
57
|
+
interface ActionDef<Id extends string> {
|
|
58
|
+
readonly id: Id;
|
|
59
|
+
readonly name: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Concepts that belong to one notation only, such as an activation bar, a history pseudo-state or a pool, keyed by notation name. The model gives them no meaning, so a projection ignores them and reports that it did; they exist so a round trip through a view restores them.
|
|
63
|
+
*/
|
|
64
|
+
type Extensions = Readonly<Record<string, JsonValue>>;
|
|
65
|
+
/**
|
|
66
|
+
* Something activities consume or produce: data, a document, a deliverable. An artefact nothing produces is an input to the process; one flagged `deliverable` is an output of it.
|
|
67
|
+
*/
|
|
68
|
+
interface ArtefactDef<Id extends string> {
|
|
69
|
+
readonly id: Id;
|
|
70
|
+
readonly name: string;
|
|
71
|
+
readonly deliverable?: boolean;
|
|
72
|
+
}
|
|
73
|
+
type Element<Id extends string, R extends IdSpace> = {
|
|
74
|
+
readonly kind: "activity";
|
|
75
|
+
readonly id: Id;
|
|
76
|
+
readonly extensions?: Extensions;
|
|
77
|
+
readonly label: string;
|
|
78
|
+
readonly actor?: R["actor"];
|
|
79
|
+
readonly action?: R["action"];
|
|
80
|
+
/**
|
|
81
|
+
* The external record this activity stands for, as a source-qualified identifier such as `github:org/repo#12`. It is the activity's identity in its source and unique across the model's activities.
|
|
82
|
+
*/
|
|
83
|
+
readonly source?: string;
|
|
84
|
+
/**
|
|
85
|
+
* The entities whose lifecycle this activity changes. A state machine projection for a subject keeps the activities that affect it. Only entity participants can be named.
|
|
86
|
+
*/
|
|
87
|
+
readonly affects?: readonly R["entity"][];
|
|
88
|
+
/** Artefacts this activity needs before it can run. */
|
|
89
|
+
readonly consumes?: readonly R["artefact"][];
|
|
90
|
+
/** Artefacts this activity makes. An artefact has at most one producing activity. */
|
|
91
|
+
readonly produces?: readonly R["artefact"][];
|
|
92
|
+
} | {
|
|
93
|
+
readonly kind: "decision";
|
|
94
|
+
readonly id: Id;
|
|
95
|
+
readonly extensions?: Extensions;
|
|
96
|
+
readonly label: string;
|
|
97
|
+
readonly actor?: R["actor"];
|
|
98
|
+
} | {
|
|
99
|
+
readonly kind: "state";
|
|
100
|
+
readonly id: Id;
|
|
101
|
+
readonly extensions?: Extensions;
|
|
102
|
+
readonly label: string;
|
|
103
|
+
readonly parent?: R["element"];
|
|
104
|
+
readonly entry?: R["action"];
|
|
105
|
+
readonly exit?: R["action"];
|
|
106
|
+
} | {
|
|
107
|
+
readonly kind: "pseudo";
|
|
108
|
+
readonly id: Id;
|
|
109
|
+
readonly extensions?: Extensions;
|
|
110
|
+
readonly role: PseudoRole;
|
|
111
|
+
readonly parent?: R["element"];
|
|
112
|
+
} | {
|
|
113
|
+
readonly kind: "message";
|
|
114
|
+
readonly id: Id;
|
|
115
|
+
readonly extensions?: Extensions;
|
|
116
|
+
readonly label: string;
|
|
117
|
+
readonly from: R["actor"];
|
|
118
|
+
readonly to: R["actor"];
|
|
119
|
+
readonly mode: MessageMode;
|
|
120
|
+
readonly event?: R["event"];
|
|
121
|
+
};
|
|
122
|
+
interface Transition<Id extends string, R extends IdSpace> {
|
|
123
|
+
readonly id: Id;
|
|
124
|
+
readonly source: R["element"];
|
|
125
|
+
readonly target: R["element"];
|
|
126
|
+
readonly trigger?: R["event"];
|
|
127
|
+
/** The human-readable label of the branch. It is never evaluated; `condition` is. */
|
|
128
|
+
readonly guard?: string;
|
|
129
|
+
/**
|
|
130
|
+
* A three-valued predicate tree that decides whether this branch is taken, as a trilean `PredicateNode`. Its references are opaque keys for the evaluator's resolvers, not identifiers of this model, so it is not parameterised by the identifier spaces.
|
|
131
|
+
*/
|
|
132
|
+
readonly condition?: PredicateNode;
|
|
133
|
+
readonly effect?: R["action"];
|
|
134
|
+
}
|
|
135
|
+
interface FragmentOperand<R extends IdSpace> {
|
|
136
|
+
readonly guard?: string;
|
|
137
|
+
readonly body: readonly R["element"][];
|
|
138
|
+
}
|
|
139
|
+
interface Fragment<Id extends string, R extends IdSpace> {
|
|
140
|
+
readonly id: Id;
|
|
141
|
+
readonly operator: FragmentOperator;
|
|
142
|
+
readonly operands: readonly FragmentOperand<R>[];
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* A projection records the extra input a lossy direction needs. Flowchart and swimlane need none. A state machine needs its subject entity. A sequence diagram needs the scenario it follows.
|
|
146
|
+
*/
|
|
147
|
+
type Projection<R extends IdSpace> = {
|
|
148
|
+
readonly id: string;
|
|
149
|
+
readonly notation: "flowchart" | "swimlane";
|
|
150
|
+
} | {
|
|
151
|
+
readonly id: string;
|
|
152
|
+
readonly notation: "stateMachine";
|
|
153
|
+
readonly subject: R["entity"];
|
|
154
|
+
} | {
|
|
155
|
+
readonly id: string;
|
|
156
|
+
readonly notation: "sequence";
|
|
157
|
+
readonly scenario: readonly R["transition"][];
|
|
158
|
+
};
|
|
159
|
+
interface Point {
|
|
160
|
+
readonly x: number;
|
|
161
|
+
readonly y: number;
|
|
162
|
+
}
|
|
163
|
+
/** Layout lives apart from the semantic model, keyed by element identifier. */
|
|
164
|
+
type Views<ElementId extends string> = Readonly<Partial<Record<Notation, Readonly<Partial<Record<ElementId, Point>>>>>>;
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region ../../core/graph/schema/dist/model.d.ts
|
|
167
|
+
interface ModelParts<D extends IdSpace, R extends IdSpace, Ps extends AnyParticipants = readonly Participant<D["participant"]>[]> {
|
|
168
|
+
readonly participants: Ps;
|
|
169
|
+
readonly events: readonly EventDef<D["event"]>[];
|
|
170
|
+
readonly actions: readonly ActionDef<D["action"]>[];
|
|
171
|
+
readonly artefacts: readonly ArtefactDef<D["artefact"]>[];
|
|
172
|
+
readonly elements: readonly Element<D["element"], R>[];
|
|
173
|
+
readonly transitions: readonly Transition<D["transition"], R>[];
|
|
174
|
+
readonly fragments: readonly Fragment<D["fragment"], R>[];
|
|
175
|
+
readonly projections: readonly Projection<R>[];
|
|
176
|
+
readonly views?: Views<R["element"]>;
|
|
177
|
+
}
|
|
178
|
+
type Model<I extends IdSpace> = ModelParts<I, I>;
|
|
179
|
+
/**
|
|
180
|
+
* Declare a model. Each identifier union is inferred from the declaring arrays only, so every reference elsewhere is checked against what was declared.
|
|
181
|
+
*
|
|
182
|
+
* The participants array is captured whole, with each kind kept as a literal. Actors and message ends are then checked against the role and system participants, and a state machine subject against the entity participants.
|
|
183
|
+
*/
|
|
184
|
+
declare const defineModel: <const Ps extends AnyParticipants, const Ev extends string, const Ac extends string, const El extends string, const Tr extends string, const Fr extends string, const Ar extends string>(model: ModelParts<{
|
|
185
|
+
readonly participant: Ps[number]["id"];
|
|
186
|
+
readonly actor: IdsOfKind<Ps, "role" | "system">;
|
|
187
|
+
readonly entity: IdsOfKind<Ps, "entity">;
|
|
188
|
+
readonly event: Ev;
|
|
189
|
+
readonly action: Ac;
|
|
190
|
+
readonly element: El;
|
|
191
|
+
readonly transition: Tr;
|
|
192
|
+
readonly fragment: Fr;
|
|
193
|
+
readonly artefact: Ar;
|
|
194
|
+
}, {
|
|
195
|
+
readonly participant: NoInfer<Ps[number]["id"]>;
|
|
196
|
+
readonly actor: NoInfer<IdsOfKind<Ps, "role" | "system">>;
|
|
197
|
+
readonly entity: NoInfer<IdsOfKind<Ps, "entity">>;
|
|
198
|
+
readonly event: NoInfer<Ev>;
|
|
199
|
+
readonly action: NoInfer<Ac>;
|
|
200
|
+
readonly element: NoInfer<El>;
|
|
201
|
+
readonly transition: NoInfer<Tr>;
|
|
202
|
+
readonly fragment: NoInfer<Fr>;
|
|
203
|
+
readonly artefact: NoInfer<Ar>;
|
|
204
|
+
}, Ps>) => Model<{
|
|
205
|
+
readonly participant: Ps[number]["id"];
|
|
206
|
+
readonly actor: IdsOfKind<Ps, "role" | "system">;
|
|
207
|
+
readonly entity: IdsOfKind<Ps, "entity">;
|
|
208
|
+
readonly event: Ev;
|
|
209
|
+
readonly action: Ac;
|
|
210
|
+
readonly element: El;
|
|
211
|
+
readonly transition: Tr;
|
|
212
|
+
readonly fragment: Fr;
|
|
213
|
+
readonly artefact: Ar;
|
|
214
|
+
}>;
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region ../../core/graph/schema/dist/artefacts.d.ts
|
|
217
|
+
/**
|
|
218
|
+
* The artefacts the process takes as given: those no activity produces, in declaration order.
|
|
219
|
+
* @param model - The model to read.
|
|
220
|
+
* @returns The declared artefacts that appear in no activity's `produces`.
|
|
221
|
+
*/
|
|
222
|
+
declare const inputsOf: <I extends IdSpace>(model: Model<I>) => readonly ArtefactDef<I["artefact"]>[];
|
|
223
|
+
/**
|
|
224
|
+
* The artefacts the process exists to deliver: those flagged `deliverable`, in declaration order.
|
|
225
|
+
* @param model - The model to read.
|
|
226
|
+
* @returns The declared artefacts flagged `deliverable`.
|
|
227
|
+
*/
|
|
228
|
+
declare const outputsOf: <I extends IdSpace>(model: Model<I>) => readonly ArtefactDef<I["artefact"]>[];
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region ../../core/graph/schema/dist/validate.d.ts
|
|
231
|
+
type IssueCode = "duplicate-id" | "unknown-reference" | "multiple-initial" | "subject-not-entity" | "actor-is-entity" | "duplicate-source" | "multiple-producers" | "affects-not-entity" | "overlay-unknown-element";
|
|
232
|
+
interface Issue {
|
|
233
|
+
readonly code: IssueCode;
|
|
234
|
+
readonly message: string;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Runtime validation. Authored models are already reference-safe at compile time. This is for models loaded from JSON, where identifiers are plain strings, and for the rules the type system cannot state: unique identifiers, one initial pseudo-state per scope, and entity subjects for state machine projections.
|
|
238
|
+
*/
|
|
239
|
+
declare const validate: <I extends IdSpace>(model: Model<I>) => readonly Issue[];
|
|
240
|
+
//#endregion
|
|
241
|
+
//#region ../../core/graph/schema/dist/overlay.d.ts
|
|
242
|
+
/**
|
|
243
|
+
* Run state laid over a model, keyed by element identifier. It is separate from the model on purpose, the same rule as layout: a model describes a process, an overlay describes one run of it, and many overlays can sit over one model.
|
|
244
|
+
*
|
|
245
|
+
* An element with no entry has no recorded state, which is distinct from the explicit `"unknown"`, a source reporting that it cannot tell.
|
|
246
|
+
*/
|
|
247
|
+
type Overlay<I extends IdSpace> = Readonly<Partial<Record<I["element"], OverlayStatus>>>;
|
|
248
|
+
/** The open overlay shape: element identifiers are plain strings. Its inferred type is exactly `Overlay<OpenIds>`. */
|
|
249
|
+
declare const overlaySchema: z.ZodReadonly<z.ZodRecord<z.ZodString & z.core.$partial, z.ZodEnum<{
|
|
250
|
+
done: "done";
|
|
251
|
+
open: "open";
|
|
252
|
+
unknown: "unknown";
|
|
253
|
+
}>>>;
|
|
254
|
+
/** A shape problem found while loading an overlay. */
|
|
255
|
+
interface OverlayIssue {
|
|
256
|
+
/** RFC 6901 JSON pointer to the offending value in the input; the empty string is the document itself. */
|
|
257
|
+
readonly pointer: string;
|
|
258
|
+
readonly message: string;
|
|
259
|
+
}
|
|
260
|
+
/** Thrown by `parseOverlay` when the input is not a valid overlay. */
|
|
261
|
+
declare class OverlayParseError extends Error {
|
|
262
|
+
/** Every problem found. Never empty. */
|
|
263
|
+
readonly issues: readonly OverlayIssue[];
|
|
264
|
+
/**
|
|
265
|
+
* @param issues - The problems found. Must not be empty.
|
|
266
|
+
*/
|
|
267
|
+
constructor(issues: readonly OverlayIssue[]);
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Checks an overlay against the model it is laid over. `parseOverlay` is model-independent, so this is where an element identifier that the model does not declare is found.
|
|
271
|
+
* @param model - The model the overlay is for.
|
|
272
|
+
* @param overlay - The overlay to check.
|
|
273
|
+
* @returns One `overlay-unknown-element` issue per entry whose key is not an element of the model, in the overlay's key order. Empty when every entry names a declared element.
|
|
274
|
+
*/
|
|
275
|
+
declare const validateOverlay: <I extends IdSpace>(model: Model<I>, overlay: Readonly<Partial<Record<string, OverlayStatus>>>) => readonly Issue[];
|
|
276
|
+
/**
|
|
277
|
+
* Loads an overlay from untrusted input, such as parsed JSON.
|
|
278
|
+
* @param input - The value to load.
|
|
279
|
+
* @returns The overlay, keyed by plain-string element identifiers.
|
|
280
|
+
* @throws OverlayParseError when the input is not an object of element identifier to `"done"`, `"open"` or `"unknown"`.
|
|
281
|
+
*/
|
|
282
|
+
declare const parseOverlay: (input: unknown) => Overlay<OpenIds>;
|
|
283
|
+
//#endregion
|
|
284
|
+
//#region ../../core/graph/schema/dist/schema.d.ts
|
|
285
|
+
/**
|
|
286
|
+
* The open (runtime) shape of a model: identifiers are plain strings, so references are not checked here. `validate` checks what the shape cannot, and `parseModel` runs both.
|
|
287
|
+
*
|
|
288
|
+
* Every object is strict. The inferred type is exactly `Model<OpenIds>`, which a type-level test pins in both directions.
|
|
289
|
+
*/
|
|
290
|
+
declare const modelSchema: z.ZodReadonly<z.ZodObject<{
|
|
291
|
+
participants: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
292
|
+
id: z.ZodString;
|
|
293
|
+
label: z.ZodString;
|
|
294
|
+
kind: z.ZodEnum<{
|
|
295
|
+
role: "role";
|
|
296
|
+
system: "system";
|
|
297
|
+
entity: "entity";
|
|
298
|
+
}>;
|
|
299
|
+
}, z.core.$strict>>>>;
|
|
300
|
+
events: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
301
|
+
id: z.ZodString;
|
|
302
|
+
name: z.ZodString;
|
|
303
|
+
payload: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
304
|
+
}, z.core.$strict>>>>;
|
|
305
|
+
actions: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
306
|
+
id: z.ZodString;
|
|
307
|
+
name: z.ZodString;
|
|
308
|
+
}, z.core.$strict>>>>;
|
|
309
|
+
artefacts: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
310
|
+
id: z.ZodString;
|
|
311
|
+
name: z.ZodString;
|
|
312
|
+
deliverable: z.ZodExactOptional<z.ZodBoolean>;
|
|
313
|
+
}, z.core.$strict>>>>;
|
|
314
|
+
elements: z.ZodReadonly<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
|
|
315
|
+
kind: z.ZodLiteral<"activity">;
|
|
316
|
+
id: z.ZodString;
|
|
317
|
+
extensions: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>>>>;
|
|
318
|
+
label: z.ZodString;
|
|
319
|
+
actor: z.ZodExactOptional<z.ZodString>;
|
|
320
|
+
action: z.ZodExactOptional<z.ZodString>;
|
|
321
|
+
source: z.ZodExactOptional<z.ZodString>;
|
|
322
|
+
affects: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
323
|
+
consumes: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
324
|
+
produces: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
325
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
326
|
+
kind: z.ZodLiteral<"decision">;
|
|
327
|
+
id: z.ZodString;
|
|
328
|
+
extensions: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>>>>;
|
|
329
|
+
label: z.ZodString;
|
|
330
|
+
actor: z.ZodExactOptional<z.ZodString>;
|
|
331
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
332
|
+
kind: z.ZodLiteral<"state">;
|
|
333
|
+
id: z.ZodString;
|
|
334
|
+
extensions: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>>>>;
|
|
335
|
+
label: z.ZodString;
|
|
336
|
+
parent: z.ZodExactOptional<z.ZodString>;
|
|
337
|
+
entry: z.ZodExactOptional<z.ZodString>;
|
|
338
|
+
exit: z.ZodExactOptional<z.ZodString>;
|
|
339
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
340
|
+
kind: z.ZodLiteral<"pseudo">;
|
|
341
|
+
id: z.ZodString;
|
|
342
|
+
extensions: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>>>>;
|
|
343
|
+
role: z.ZodEnum<{
|
|
344
|
+
initial: "initial";
|
|
345
|
+
final: "final";
|
|
346
|
+
fork: "fork";
|
|
347
|
+
join: "join";
|
|
348
|
+
history: "history";
|
|
349
|
+
}>;
|
|
350
|
+
parent: z.ZodExactOptional<z.ZodString>;
|
|
351
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
352
|
+
kind: z.ZodLiteral<"message">;
|
|
353
|
+
id: z.ZodString;
|
|
354
|
+
extensions: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>>>>;
|
|
355
|
+
label: z.ZodString;
|
|
356
|
+
from: z.ZodString;
|
|
357
|
+
to: z.ZodString;
|
|
358
|
+
mode: z.ZodEnum<{
|
|
359
|
+
sync: "sync";
|
|
360
|
+
async: "async";
|
|
361
|
+
reply: "reply";
|
|
362
|
+
create: "create";
|
|
363
|
+
destroy: "destroy";
|
|
364
|
+
}>;
|
|
365
|
+
event: z.ZodExactOptional<z.ZodString>;
|
|
366
|
+
}, z.core.$strict>>], "kind">>>;
|
|
367
|
+
transitions: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
368
|
+
id: z.ZodString;
|
|
369
|
+
source: z.ZodString;
|
|
370
|
+
target: z.ZodString;
|
|
371
|
+
trigger: z.ZodExactOptional<z.ZodString>;
|
|
372
|
+
guard: z.ZodExactOptional<z.ZodString>;
|
|
373
|
+
condition: z.ZodExactOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
374
|
+
kind: z.ZodLiteral<"not">;
|
|
375
|
+
operand: typeof PredicateNodeSchema;
|
|
376
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
377
|
+
kind: z.ZodLiteral<"and">;
|
|
378
|
+
left: typeof PredicateNodeSchema;
|
|
379
|
+
right: typeof PredicateNodeSchema;
|
|
380
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
381
|
+
kind: z.ZodLiteral<"or">;
|
|
382
|
+
left: typeof PredicateNodeSchema;
|
|
383
|
+
right: typeof PredicateNodeSchema;
|
|
384
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
385
|
+
kind: z.ZodLiteral<"allOf">;
|
|
386
|
+
operands: z.ZodArray<typeof PredicateNodeSchema>;
|
|
387
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
388
|
+
kind: z.ZodLiteral<"anyOf">;
|
|
389
|
+
operands: z.ZodArray<typeof PredicateNodeSchema>;
|
|
390
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
391
|
+
kind: z.ZodLiteral<"compare">;
|
|
392
|
+
op: z.ZodEnum<{
|
|
393
|
+
gt: "gt";
|
|
394
|
+
gte: "gte";
|
|
395
|
+
lt: "lt";
|
|
396
|
+
lte: "lte";
|
|
397
|
+
eq: "eq";
|
|
398
|
+
neq: "neq";
|
|
399
|
+
}>;
|
|
400
|
+
left: typeof import("trilean").ExpressionNodeSchema;
|
|
401
|
+
right: typeof import("trilean").ExpressionNodeSchema;
|
|
402
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
403
|
+
kind: z.ZodLiteral<"textCompare">;
|
|
404
|
+
op: z.ZodEnum<{
|
|
405
|
+
equals: "equals";
|
|
406
|
+
notEquals: "notEquals";
|
|
407
|
+
matches: "matches";
|
|
408
|
+
notMatches: "notMatches";
|
|
409
|
+
portableMatches: "portableMatches";
|
|
410
|
+
portableNotMatches: "portableNotMatches";
|
|
411
|
+
}>;
|
|
412
|
+
left: typeof import("trilean").ExpressionNodeSchema;
|
|
413
|
+
right: typeof import("trilean").ExpressionNodeSchema;
|
|
414
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
415
|
+
kind: z.ZodLiteral<"memberOf">;
|
|
416
|
+
op: z.ZodEnum<{
|
|
417
|
+
in: "in";
|
|
418
|
+
notIn: "notIn";
|
|
419
|
+
}>;
|
|
420
|
+
operand: typeof import("trilean").ExpressionNodeSchema;
|
|
421
|
+
candidates: z.ZodArray<typeof import("trilean").ExpressionNodeSchema>;
|
|
422
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
423
|
+
kind: z.ZodLiteral<"exists">;
|
|
424
|
+
operand: typeof import("trilean").ExpressionNodeSchema;
|
|
425
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
426
|
+
kind: z.ZodLiteral<"some">;
|
|
427
|
+
collection: z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>;
|
|
428
|
+
item: typeof PredicateNodeSchema;
|
|
429
|
+
filter: z.ZodOptional<typeof PredicateNodeSchema>;
|
|
430
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
431
|
+
kind: z.ZodLiteral<"every">;
|
|
432
|
+
collection: z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>;
|
|
433
|
+
item: typeof PredicateNodeSchema;
|
|
434
|
+
filter: z.ZodOptional<typeof PredicateNodeSchema>;
|
|
435
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
436
|
+
kind: z.ZodLiteral<"treeReference">;
|
|
437
|
+
key: z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>;
|
|
438
|
+
}, z.core.$strip>], "kind">>;
|
|
439
|
+
effect: z.ZodExactOptional<z.ZodString>;
|
|
440
|
+
}, z.core.$strict>>>>;
|
|
441
|
+
fragments: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
442
|
+
id: z.ZodString;
|
|
443
|
+
operator: z.ZodEnum<{
|
|
444
|
+
alt: "alt";
|
|
445
|
+
opt: "opt";
|
|
446
|
+
loop: "loop";
|
|
447
|
+
par: "par";
|
|
448
|
+
break: "break";
|
|
449
|
+
}>;
|
|
450
|
+
operands: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
451
|
+
guard: z.ZodExactOptional<z.ZodString>;
|
|
452
|
+
body: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
453
|
+
}, z.core.$strict>>>>;
|
|
454
|
+
}, z.core.$strict>>>>;
|
|
455
|
+
projections: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
456
|
+
id: z.ZodString;
|
|
457
|
+
notation: z.ZodEnum<{
|
|
458
|
+
flowchart: "flowchart";
|
|
459
|
+
swimlane: "swimlane";
|
|
460
|
+
}>;
|
|
461
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
462
|
+
id: z.ZodString;
|
|
463
|
+
notation: z.ZodLiteral<"stateMachine">;
|
|
464
|
+
subject: z.ZodString;
|
|
465
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
466
|
+
id: z.ZodString;
|
|
467
|
+
notation: z.ZodLiteral<"sequence">;
|
|
468
|
+
scenario: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
469
|
+
}, z.core.$strict>>]>>>;
|
|
470
|
+
views: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodEnum<{
|
|
471
|
+
flowchart: "flowchart";
|
|
472
|
+
swimlane: "swimlane";
|
|
473
|
+
stateMachine: "stateMachine";
|
|
474
|
+
sequence: "sequence";
|
|
475
|
+
}> & z.core.$partial, z.ZodReadonly<z.ZodRecord<z.ZodString & z.core.$partial, z.ZodReadonly<z.ZodObject<{
|
|
476
|
+
x: z.ZodNumber;
|
|
477
|
+
y: z.ZodNumber;
|
|
478
|
+
}, z.core.$strict>>>>>>>;
|
|
479
|
+
}, z.core.$strict>>;
|
|
480
|
+
//#endregion
|
|
481
|
+
//#region ../../core/graph/schema/dist/parse.d.ts
|
|
482
|
+
/** A problem found while loading a model: a shape violation located by JSON pointer, or a rule `validate` reports. */
|
|
483
|
+
type ModelIssue = {
|
|
484
|
+
readonly source: "schema";
|
|
485
|
+
/** RFC 6901 JSON pointer to the offending value in the input; the empty string is the document itself. */
|
|
486
|
+
readonly pointer: string;
|
|
487
|
+
readonly message: string;
|
|
488
|
+
} | {
|
|
489
|
+
readonly source: "validate";
|
|
490
|
+
readonly code: IssueCode;
|
|
491
|
+
readonly message: string;
|
|
492
|
+
};
|
|
493
|
+
/** Thrown by `parseModel` when the input is not a valid model. */
|
|
494
|
+
declare class ModelParseError extends Error {
|
|
495
|
+
/** Every problem found, in the order the schema and then `validate` reported them. Never empty. */
|
|
496
|
+
readonly issues: readonly ModelIssue[];
|
|
497
|
+
/**
|
|
498
|
+
* @param issues - The problems found. Must not be empty.
|
|
499
|
+
*/
|
|
500
|
+
constructor(issues: readonly ModelIssue[]);
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Loads a model from untrusted input, such as parsed JSON.
|
|
504
|
+
*
|
|
505
|
+
* The input is checked against the open schema first, so every shape problem is reported with the JSON pointer of the offending value. Only a well-shaped model is then passed to `validate`, whose issues are surfaced the same way.
|
|
506
|
+
* @param input - The value to load.
|
|
507
|
+
* @returns The validated model, with identifiers as plain strings.
|
|
508
|
+
* @throws ModelParseError when the input is not a well-shaped model or fails `validate`.
|
|
509
|
+
*/
|
|
510
|
+
declare const parseModel: (input: unknown) => Model<OpenIds>;
|
|
511
|
+
//#endregion
|
|
512
|
+
export { Views as A, messageModes as B, Extensions as C, Point as D, Participant as E, OverlayStatus as F, IdSpace as G, overlayStatuses as H, ParticipantKind as I, OpenIds as K, PseudoRole as L, FragmentOperator as M, MessageMode as N, Projection as O, Notation as P, elementKinds as R, EventDef as S, FragmentOperand as T, participantKinds as U, notations as V, pseudoRoles as W, ModelParts as _, Overlay as a, ArtefactDef as b, overlaySchema as c, Issue as d, IssueCode as f, Model as g, outputsOf as h, modelSchema as i, ElementKind as j, Transition as k, parseOverlay as l, inputsOf as m, ModelParseError as n, OverlayIssue as o, validate as p, parseModel as r, OverlayParseError as s, ModelIssue as t, validateOverlay as u, defineModel as v, Fragment as w, Element as x, ActionDef as y, fragmentOperators as z };
|