process-graph 1.2.0 → 1.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 +25 -20
- package/dist/bin.js +4 -3
- package/dist/cli.d.ts +87 -75
- package/dist/cli.js +4 -2
- package/dist/data-file-BVMxkTug.js +95 -0
- package/dist/{dist-BxHnxpcT.js → dist-C8zDuW-y.js} +293 -510
- package/dist/dist-DipyhCvb.js +4 -0
- package/dist/{dist-BpCBmnMl.js → dist-arkejVz2.js} +2 -112
- package/dist/graphql-3DSUSUvL.d.ts +17 -0
- package/dist/{index-CoA6vXqe.d.ts → index-4f4PVH7K.d.ts} +23 -2
- package/dist/index-Bb90VKMc.d.ts +71 -0
- package/dist/{index-DxWOY8f9.d.ts → index-CR8xUK3S.d.ts} +5 -572
- package/dist/{index-CptUHq6F.d.ts → index-Cp5selgs.d.ts} +2 -1
- package/dist/{graphql-C1j5wQFz.d.ts → index-Cs1CWlEg.d.ts} +3 -16
- package/dist/{index-BH1aFqkJ.d.ts → index-D4CnOhNf.d.ts} +1 -1
- package/dist/index-DoMIav3D.d.ts +118 -0
- package/dist/{index-CmZOswkx.d.ts → index-Dvz_I_uQ.d.ts} +17 -8
- package/dist/{index-BUheRLdG.d.ts → index-LWdwpjZG.d.ts} +5 -24
- package/dist/{index-CrM5qWUA.d.ts → index-RwwlDYZ7.d.ts} +2 -2
- package/dist/index.d.ts +25 -4
- package/dist/index.js +4 -3
- package/dist/layout.d.ts +1 -1
- package/dist/project-CP_ye6KI.js +27 -0
- package/dist/react-flow.d.ts +5 -5
- package/dist/react-flow.js +1 -1
- package/dist/react.d.ts +2 -1
- package/dist/react.js +1 -24
- package/dist/{router-DvGGLnNt.js → router-Dk91O_9p.js} +2 -2
- package/dist/{schema-CVnS6HiX.js → schema-BPT8fmfa.js} +2 -2
- package/dist/schema-DVAttrJg.js +126 -0
- package/dist/source/github/node.d.ts +1 -1
- package/dist/source/github.d.ts +3 -2
- package/dist/source/github.js +38 -1
- package/dist/{source-DRDpEA8Q.js → source-lTKshktI.js} +24 -163
- package/dist/store/node.d.ts +27 -2
- package/dist/store/node.js +2 -2
- package/dist/store/wasm/worker.js +2 -2
- package/dist/store/wasm.d.ts +1 -1
- package/dist/{store-BJILV4JS.js → store-DKzvLGgl.js} +1 -1
- package/dist/store.d.ts +1 -1
- package/dist/store.js +2 -2
- package/dist/sync-CkaJO3OQ.js +213 -0
- package/dist/sync.d.ts +26 -0
- package/dist/sync.js +16 -0
- package/dist/theme-values-BJJhAkUn-ORyRUrPf.js +114 -0
- package/dist/theme-values-BybZ-cle.d.ts +116 -0
- package/dist/ui/theme.d.ts +2 -0
- package/dist/ui/theme.js +2 -0
- package/dist/ui.d.ts +6 -120
- package/dist/ui.js +2 -1
- package/dist/version-DMNBcTZ-.js +5 -0
- package/dist/view-DTeNUhGG.js +392 -0
- package/package.json +34 -23
- package/dist/dist-Cw63tKU9.js +0 -3
- package/dist/open-BF-UHqeW.js +0 -29
- package/dist/parse-CuipC_2K.js +0 -41
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { P as SyncFilter, b as Gap, h as GraphSourceClient } from "./index-Cs1CWlEg.js";
|
|
2
|
+
import { ut as GraphStoreClient } from "./index-CR8xUK3S.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region ../../core/graph/sync/dist/checkpoint.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Where a sync stopped: the model, every scope it was asked for in order, the filter it read them with, the prefix of the source to read next, and the cursor after the last page it wrote within that source's scopes (absent to read them from the start). Everything before it is in the store, so a sync started from it reads only what is left. A source's cursor is valid only with the scopes and filter it was issued for, which is why both are kept with it.
|
|
7
|
+
*/
|
|
8
|
+
declare const syncCheckpointSchema: z.ZodReadonly<z.ZodObject<{
|
|
9
|
+
modelId: z.ZodString;
|
|
10
|
+
scopes: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
11
|
+
filter: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
12
|
+
states: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
13
|
+
open: "open";
|
|
14
|
+
done: "done";
|
|
15
|
+
}>>>>;
|
|
16
|
+
labels: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
17
|
+
order: z.ZodExactOptional<z.ZodReadonly<z.ZodObject<{
|
|
18
|
+
field: z.ZodEnum<{
|
|
19
|
+
created: "created";
|
|
20
|
+
updated: "updated";
|
|
21
|
+
comments: "comments";
|
|
22
|
+
}>;
|
|
23
|
+
direction: z.ZodEnum<{
|
|
24
|
+
ascending: "ascending";
|
|
25
|
+
descending: "descending";
|
|
26
|
+
}>;
|
|
27
|
+
}, z.core.$strict>>>;
|
|
28
|
+
}, z.core.$strict>>>;
|
|
29
|
+
source: z.ZodString;
|
|
30
|
+
after: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, z.core.$strict>>;
|
|
32
|
+
type SyncCheckpoint = z.infer<typeof syncCheckpointSchema>;
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region ../../core/graph/sync/dist/sync.d.ts
|
|
35
|
+
/** Finds the source that reads scopes with an identifier prefix, such as `github`, or nothing when no source does. */
|
|
36
|
+
type SourceLookup = (prefix: string) => GraphSourceClient | undefined;
|
|
37
|
+
/** The part of the `GraphStore` client a sync calls: loading the model it merges into and upserting each page. */
|
|
38
|
+
interface SyncStore {
|
|
39
|
+
readonly v1: {
|
|
40
|
+
readonly models: Pick<GraphStoreClient["v1"]["models"], "load">;
|
|
41
|
+
readonly items: Pick<GraphStoreClient["v1"]["items"], "upsert">;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/** How far a sync has got. Each count is of distinct identifiers (relations by kind and both ends) written by this sync. */
|
|
45
|
+
interface SyncProgress {
|
|
46
|
+
/** Pages read and written. */
|
|
47
|
+
readonly pages: number;
|
|
48
|
+
/** The revision the last write took. */
|
|
49
|
+
readonly revision: number;
|
|
50
|
+
readonly participants: number;
|
|
51
|
+
/** Bound activities. */
|
|
52
|
+
readonly activities: number;
|
|
53
|
+
readonly transitions: number;
|
|
54
|
+
/** Relations: sub-issues to their parents, assignees, repositories to their owners. */
|
|
55
|
+
readonly relations: number;
|
|
56
|
+
/** The parts of the scope the sources could not read, in the order met. */
|
|
57
|
+
readonly gaps: readonly Gap[];
|
|
58
|
+
/** Where to resume; absent once every scope has been read. */
|
|
59
|
+
readonly checkpoint: SyncCheckpoint | undefined;
|
|
60
|
+
}
|
|
61
|
+
/** What to sync and where to. */
|
|
62
|
+
interface SyncRequest {
|
|
63
|
+
readonly store: SyncStore;
|
|
64
|
+
readonly sources: SourceLookup;
|
|
65
|
+
readonly modelId: string;
|
|
66
|
+
/** Source-qualified scopes, read in order, one source after another. */
|
|
67
|
+
readonly scopes: readonly string[];
|
|
68
|
+
/** Narrows and orders what each scope lists. It is recorded in every checkpoint, since a cursor is valid only with the filter it was issued under. */
|
|
69
|
+
readonly filter?: SyncFilter | undefined;
|
|
70
|
+
/** A checkpoint from an interrupted sync of the same model, scopes and filter: the sync carries on from it. */
|
|
71
|
+
readonly resume?: SyncCheckpoint | undefined;
|
|
72
|
+
/** Ends the sync between or during reads; what was written stays written. */
|
|
73
|
+
readonly signal?: AbortSignal | undefined;
|
|
74
|
+
/** Called after every page is written, with the progress so far. */
|
|
75
|
+
readonly onProgress?: ((progress: SyncProgress) => void) | undefined;
|
|
76
|
+
}
|
|
77
|
+
/** Thrown when a scope names a source no reader serves. */
|
|
78
|
+
declare class UnknownSourceError extends Error {
|
|
79
|
+
/** The source prefix no reader serves. */
|
|
80
|
+
readonly prefix: string;
|
|
81
|
+
/**
|
|
82
|
+
* @param prefix - The source prefix no reader serves.
|
|
83
|
+
*/
|
|
84
|
+
constructor(prefix: string);
|
|
85
|
+
}
|
|
86
|
+
/** Where a sync a source interrupted carries on, as data. */
|
|
87
|
+
interface SyncInterruption {
|
|
88
|
+
/** The checkpoint that continues the failing source: its prefix, after the cursor of the last page read from it, or from the start of its scopes when none was read. */
|
|
89
|
+
readonly resume: SyncCheckpoint;
|
|
90
|
+
/** The scopes of the sources after the failing one, which were not read. */
|
|
91
|
+
readonly remaining: readonly string[];
|
|
92
|
+
/** Whether this sync wrote any pages before the failure. */
|
|
93
|
+
readonly saved: boolean;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Thrown by `syncScopes` when a source fails while it is being read: opening its stream or reading a page. Its message is the source's, its cause is what the source threw, and where to carry on is data in `resume` and `remaining`. A failure of the store, or of the request itself (an unknown source, a malformed scope), is thrown as it is.
|
|
97
|
+
*/
|
|
98
|
+
declare class InterruptedSyncError extends Error implements SyncInterruption {
|
|
99
|
+
readonly resume: SyncCheckpoint;
|
|
100
|
+
readonly remaining: readonly string[];
|
|
101
|
+
readonly saved: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* @param interruption - Where the sync carries on.
|
|
104
|
+
* @param cause - What the source threw.
|
|
105
|
+
*/
|
|
106
|
+
constructor(interruption: SyncInterruption, cause: unknown);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Reads the scopes from their sources page by page and merges each page into the stored model as soon as it is read: participants, bound activities, transitions, relations and run state. Progress is kept as it is made, so a sync that is cancelled, rate limited or interrupted leaves everything it read in the store, and a checkpoint to carry on from.
|
|
110
|
+
*
|
|
111
|
+
* A store rejects a write that leaves a transition or a relation naming an element or participant the model lacks, and a source may report a dependency or a sub-issue whose other end a later page brings. A transition or relation is therefore held back until the model has both of its ends, and written with the page that completes it. One whose end never arrives is written with the last page, where the store's rejection says which reference is missing.
|
|
112
|
+
* @param request - The store, sources, model, scopes, an optional filter and checkpoint, the signal and a progress listener.
|
|
113
|
+
* @returns The final progress, with no checkpoint.
|
|
114
|
+
* @throws InvalidScopeError for a scope that names no source; UnknownSourceError for a scope whose source no reader serves; an Error for a checkpoint naming a source none of the scopes use, and for a sync of no scopes; InterruptedSyncError, after the pages before it are written, when a source fails while it is read, an abort included; and whatever the store throws.
|
|
115
|
+
*/
|
|
116
|
+
declare const syncScopes: (request: SyncRequest) => Promise<SyncProgress>;
|
|
117
|
+
//#endregion
|
|
118
|
+
export { SyncRequest as a, syncScopes as c, SyncProgress as i, SyncCheckpoint as l, SourceLookup as n, SyncStore as o, SyncInterruption as r, UnknownSourceError as s, InterruptedSyncError as t, syncCheckpointSchema as u };
|
|
@@ -282,12 +282,8 @@ declare const validateOverlay: <I extends IdSpace>(model: Model<I>, overlay: Rea
|
|
|
282
282
|
declare const parseOverlay: (input: unknown) => Overlay<OpenIds>;
|
|
283
283
|
//#endregion
|
|
284
284
|
//#region ../../core/graph/schema/dist/schema.d.ts
|
|
285
|
-
/**
|
|
286
|
-
|
|
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<{
|
|
285
|
+
/** The strict object schema inside `modelSchema`, before it is made read-only. */
|
|
286
|
+
declare const modelObjectSchema: z.ZodObject<{
|
|
291
287
|
participants: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
292
288
|
id: z.ZodString;
|
|
293
289
|
label: z.ZodString;
|
|
@@ -476,7 +472,20 @@ declare const modelSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
476
472
|
x: z.ZodNumber;
|
|
477
473
|
y: z.ZodNumber;
|
|
478
474
|
}, z.core.$strict>>>>>>>;
|
|
479
|
-
}, z.core.$strict
|
|
475
|
+
}, z.core.$strict>;
|
|
476
|
+
/**
|
|
477
|
+
* The type of `modelSchema`, declared by name so that a declaration file that embeds the schema, such as a consumer's `z.object({ model: modelSchema })` under `declaration: true`, refers to `ModelSchema` rather than writing out the whole model schema with every record and trilean's JSON value inline, which can exceed the length the compiler will serialise (TS7056).
|
|
478
|
+
*/
|
|
479
|
+
interface ModelSchema extends z.ZodReadonly<typeof modelObjectSchema> {
|
|
480
|
+
/** The strict object schema inside, whose `shape` holds each record's own schema. */
|
|
481
|
+
readonly unwrap: () => typeof modelObjectSchema;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* 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.
|
|
485
|
+
*
|
|
486
|
+
* Every object is strict. The inferred type is exactly `Model<OpenIds>`, which a type-level test pins in both directions.
|
|
487
|
+
*/
|
|
488
|
+
declare const modelSchema: ModelSchema;
|
|
480
489
|
//#endregion
|
|
481
490
|
//#region ../../core/graph/schema/dist/parse.d.ts
|
|
482
491
|
/** A problem found while loading a model: a shape violation located by JSON pointer, or a rule `validate` reports. */
|
|
@@ -509,4 +518,4 @@ declare class ModelParseError extends Error {
|
|
|
509
518
|
*/
|
|
510
519
|
declare const parseModel: (input: unknown) => Model<OpenIds>;
|
|
511
520
|
//#endregion
|
|
512
|
-
export {
|
|
521
|
+
export { Transition as A, fragmentOperators as B, EventDef as C, Participant as D, FragmentOperand as E, Notation as F, pseudoRoles as G, notations as H, OverlayStatus as I, IdSpace as K, ParticipantKind as L, ElementKind as M, FragmentOperator as N, Point as O, MessageMode as P, PseudoRole as R, Element as S, Fragment as T, overlayStatuses as U, messageModes as V, participantKinds as W, Model as _, modelSchema as a, ActionDef as b, OverlayParseError as c, validateOverlay as d, Issue as f, outputsOf as g, inputsOf as h, ModelSchema as i, Views as j, Projection as k, overlaySchema as l, validate as m, ModelParseError as n, Overlay as o, IssueCode as p, OpenIds as q, parseModel as r, OverlayIssue as s, ModelIssue as t, parseOverlay as u, ModelParts as v, Extensions as w, ArtefactDef as x, defineModel as y, elementKinds as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as Facts, B as Status, C as CriticalPath, _ as StatusRule, d as StatusExplanation, u as ChainLink } from "./index-
|
|
2
|
-
import {
|
|
3
|
-
import { K as StoredModel, ut as GraphStoreClient } from "./index-
|
|
4
|
-
import {
|
|
1
|
+
import { A as Facts, B as Status, C as CriticalPath, _ as StatusRule, d as StatusExplanation, u as ChainLink } from "./index-D4CnOhNf.js";
|
|
2
|
+
import { K as IdSpace, S as Element, _ as Model, k as Projection, o as Overlay } from "./index-Dvz_I_uQ.js";
|
|
3
|
+
import { K as StoredModel, ut as GraphStoreClient } from "./index-CR8xUK3S.js";
|
|
4
|
+
import { a as ProjectedView } from "./index-4f4PVH7K.js";
|
|
5
5
|
import { KeyboardEvent, ReactElement, ReactNode, RefCallback } from "react";
|
|
6
6
|
//#region ../../ui/graph/react/dist/run.d.ts
|
|
7
7
|
/**
|
|
@@ -114,25 +114,6 @@ declare const stepWeight: () => number;
|
|
|
114
114
|
declare const useCriticalPath: <I extends IdSpace>(run: Run<I>, weight?: (id: I["element"]) => number) => CriticalPath<I["element"]>;
|
|
115
115
|
//#endregion
|
|
116
116
|
//#region ../../ui/graph/react/dist/projection.d.ts
|
|
117
|
-
/** The view each projection notation produces. */
|
|
118
|
-
interface ViewsByNotation<I extends IdSpace> {
|
|
119
|
-
readonly flowchart: Flowchart<I>;
|
|
120
|
-
readonly swimlane: Swimlane<I>;
|
|
121
|
-
readonly stateMachine: StateMachine<I>;
|
|
122
|
-
readonly sequence: SequenceDiagram<I>;
|
|
123
|
-
}
|
|
124
|
-
/** A projection request together with the view it produced, discriminated by notation. */
|
|
125
|
-
type ProjectedView<I extends IdSpace> = { readonly [N in keyof ViewsByNotation<I>]: {
|
|
126
|
-
readonly notation: N;
|
|
127
|
-
readonly view: ViewsByNotation<I>[N];
|
|
128
|
-
}; }[keyof ViewsByNotation<I>];
|
|
129
|
-
/**
|
|
130
|
-
* Projects a model into the notation a projection names, with the input it records (a subject, a scenario).
|
|
131
|
-
* @param model - The model to project.
|
|
132
|
-
* @param projection - One of the model's declared projections, or one built the same way.
|
|
133
|
-
* @returns The notation and its view.
|
|
134
|
-
*/
|
|
135
|
-
declare const project: <I extends IdSpace>(model: Model<I>, projection: Projection<I>) => ProjectedView<I>;
|
|
136
117
|
/**
|
|
137
118
|
* A model's view in one notation, projected again only when the model or the projection changes.
|
|
138
119
|
* @param model - The model to project.
|
|
@@ -418,4 +399,4 @@ interface DetailPanelProps<I extends IdSpace> {
|
|
|
418
399
|
*/
|
|
419
400
|
declare const DetailPanel: <I extends IdSpace>(props: DetailPanelProps<I>) => ReactElement;
|
|
420
401
|
//#endregion
|
|
421
|
-
export {
|
|
402
|
+
export { useModel as $, ElementFilter as A, useElementFilter as B, ruleDescriptions as C, SelectionContainerProps as D, GraphSelectionOptions as E, emptyFilter as F, useBlockers as G, BlockedChain as H, filterElements as I, useReadySet as J, useCriticalPath as K, filterOptions as L, FilterOption as M, FilterOptions as N, SelectionItemProps as O, actorsOf as P, ModelState as Q, matchesFilter as R, elementLabel as S, GraphSelection as T, stepWeight as U, useProjection as V, useBlockedChain as W, useWhyStatus as X, useStatuses as Y, ModelClient as Z, ElementCardPart as _, FilterPanelPart as a, StatusBadge as b, LegendPart as c, LanePart as d, Run as et, LaneProps as f, ElementCard as g, TransitionItemProps as h, FilterPanel as i, ElementFilterState as j, useGraphSelection as k, LegendProps as l, TransitionItemPart as m, DetailPanelPart as n, FilterPanelProps as o, TransitionItem as p, useImpact as q, DetailPanelProps as r, Legend as s, DetailPanel as t, noFacts as tt, Lane as u, ElementCardProps as v, statusLabels as w, StatusBadgeProps as x, NamedElement as y, sourceScope as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { K as IdSpace, j as Views } from "./index-Dvz_I_uQ.js";
|
|
2
|
+
import { N as Flowchart, k as Swimlane, w as StateMachine } from "./index-4f4PVH7K.js";
|
|
3
3
|
//#region ../../core/graph/layout/dist/engine.d.ts
|
|
4
4
|
/** A box with a fixed size, which the engine places. */
|
|
5
5
|
interface EngineLeaf {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { A as Facts, B as Status, C as CriticalPath, D as UnknownReference, E as NodeId, F as evaluateBranches, I as factNamesIn, L as factsFrom, M as artefactKey, N as elementStatusKey, O as buildDag, P as emptyFactRecord, R as layeredFacts, S as loopTransitions, T as Dag, V as statuses, _ as StatusRule, a as criticalPath, b as controlDag, c as unmetOutputs, d as StatusExplanation, f as explainStatus, g as StatusBasis, h as ProducerBasis, i as blockedBy, j as UnsupportedConditionError, k as FactRecord, l as whatIfDone, m as IncomingBasis, n as UnmetOutput, o as impact, p as ArtefactBasis, r as WhatIf, s as readySet, t as StatusChange, u as ChainLink, v as deriveStatuses, w as criticalPath$1, x as illegalCycles, y as statusRules, z as Branch } from "./index-
|
|
2
|
-
import { A as
|
|
3
|
-
import { A as
|
|
1
|
+
import { A as Facts, B as Status, C as CriticalPath, D as UnknownReference, E as NodeId, F as evaluateBranches, I as factNamesIn, L as factsFrom, M as artefactKey, N as elementStatusKey, O as buildDag, P as emptyFactRecord, R as layeredFacts, S as loopTransitions, T as Dag, V as statuses, _ as StatusRule, a as criticalPath, b as controlDag, c as unmetOutputs, d as StatusExplanation, f as explainStatus, g as StatusBasis, h as ProducerBasis, i as blockedBy, j as UnsupportedConditionError, k as FactRecord, l as whatIfDone, m as IncomingBasis, n as UnmetOutput, o as impact, p as ArtefactBasis, r as WhatIf, s as readySet, t as StatusChange, u as ChainLink, v as deriveStatuses, w as criticalPath$1, x as illegalCycles, y as statusRules, z as Branch } from "./index-D4CnOhNf.js";
|
|
2
|
+
import { A as Transition, B as fragmentOperators, C as EventDef, D as Participant, E as FragmentOperand, F as Notation, G as pseudoRoles, H as notations, I as OverlayStatus, K as IdSpace, L as ParticipantKind, M as ElementKind, N as FragmentOperator, O as Point, P as MessageMode, R as PseudoRole, S as Element, T as Fragment, U as overlayStatuses, V as messageModes, W as participantKinds, _ as Model, a as modelSchema, b as ActionDef, c as OverlayParseError, d as validateOverlay, f as Issue, g as outputsOf, h as inputsOf, i as ModelSchema, j as Views, k as Projection, l as overlaySchema, m as validate, n as ModelParseError, o as Overlay, p as IssueCode, q as OpenIds, r as parseModel, s as OverlayIssue, t as ModelIssue, u as parseOverlay, v as ModelParts, w as Extensions, x as ArtefactDef, y as defineModel, z as elementKinds } from "./index-Dvz_I_uQ.js";
|
|
3
|
+
import { A as toSwimlane, C as toSequence, D as toStateMachine, E as StateMachineTransition, F as Handoff, I as handoffs, L as Loss, M as FlowNode, N as Flowchart, O as Lane, P as toFlowchart, R as UnrepresentedElement, S as SequenceOperand, T as StateMachineState, _ as applyModelDiff, a as ProjectedView, b as SequenceItem, c as Addressing, d as Ends, f as EventChange, g as UnconfirmedChangeError, h as TransitionFieldChange, i as diffSwimlane, j as FlowEdge, k as Swimlane, l as Change, m as TransitionChange, n as diffStateMachine, o as ViewsByNotation, p as ModelDiff, r as diffFlowchart, s as project, t as diffSequence, u as ElementChange, v as confirmChanges, w as StateMachine, x as SequenceMessage, y as SequenceDiagram, z as UnrepresentedKind } from "./index-4f4PVH7K.js";
|
|
4
|
+
import { a as flowchartToMermaid, c as swimlaneToMermaid, d as viewText, i as swimlaneToDot, l as ExportFormat, n as sequenceToDot, o as sequenceToMermaid, r as stateMachineToDot, s as stateMachineToMermaid, t as flowchartToDot, u as exportFormats } from "./index-Bb90VKMc.js";
|
|
4
5
|
//#region ../../core/graph/dag/dist/errors.d.ts
|
|
5
6
|
/**
|
|
6
7
|
* Thrown when an operation that is only defined on an acyclic graph is given one that contains a cycle.
|
|
@@ -108,4 +109,24 @@ declare namespace index_d_exports {
|
|
|
108
109
|
export { CriticalPath, CycleError, Dag, NodeId, TopologicalLayers, UnknownNodeError, UnknownReference, ancestorsOf, buildDag, criticalPath$1 as criticalPath, descendantsOf, findCycles, immediateDominators, stronglyConnectedComponents, topologicalLayers, transitiveReduction };
|
|
109
110
|
}
|
|
110
111
|
//#endregion
|
|
111
|
-
export
|
|
112
|
+
//#region ../../core/graph/export/dist/terminal-text.d.ts
|
|
113
|
+
/**
|
|
114
|
+
* Whether a character is one of the unsafe ones (see `unsafeCharacters`).
|
|
115
|
+
* @param character - One character: one code point, which may be two UTF-16 code units.
|
|
116
|
+
* @returns Whether it must be escaped.
|
|
117
|
+
*/
|
|
118
|
+
export declare const isUnsafeCharacter: (character: string) => boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Text made safe to write to a terminal. Each unsafe character (see `unsafeCharacters`) is written as the visible escape `\u{<hex>}` of its code point, such as `\u{1b}` for ESC, `\u{202e}` for a right-to-left override or `\u{e0041}` for a tag character, so nothing is lost and nothing acts on the terminal. Line feed, tab, the zero-width joiners and every other character, accented letters, CJK, Arabic and emoji included, pass through. A literal `\u{...}` already in the text is left as it is, so the escaped form is for reading, not for reversing.
|
|
121
|
+
* @param text - The text as written.
|
|
122
|
+
* @returns The text with every unsafe character escaped.
|
|
123
|
+
*/
|
|
124
|
+
export declare const terminalText: (text: string) => string;
|
|
125
|
+
/**
|
|
126
|
+
* A value as JSON that is also safe to write to a terminal. `JSON.stringify` escapes the C0 controls but writes every other unsafe character (see `unsafeCharacters`) as it is; this writes those as `\u` escapes too, a surrogate pair for a code point beyond the Basic Multilingual Plane, which leaves the JSON, and every value parsed from it, exactly the same.
|
|
127
|
+
* @param value - The value to write.
|
|
128
|
+
* @returns The JSON text, indented by two spaces and ending in a line break.
|
|
129
|
+
*/
|
|
130
|
+
export declare const terminalJson: (value: unknown) => string;
|
|
131
|
+
//#endregion
|
|
132
|
+
export { type ActionDef, type Addressing, type ArtefactBasis, type ArtefactDef, type Branch, type ChainLink, type Change, type Element, type ElementChange, type ElementKind, type Ends, type EventChange, type EventDef, type ExportFormat, type Extensions, type FactRecord, type Facts, type FlowEdge, type FlowNode, type Flowchart, type Fragment, type FragmentOperand, type FragmentOperator, type Handoff, type IdSpace, type IncomingBasis, type Issue, type IssueCode, type Lane, type Loss, type MessageMode, type Model, type ModelDiff, type ModelIssue, ModelParseError, type ModelParts, type ModelSchema, type Notation, type OpenIds, type Overlay, type OverlayIssue, OverlayParseError, type OverlayStatus, type Participant, type ParticipantKind, type Point, type ProducerBasis, type ProjectedView, type Projection, type PseudoRole, type SequenceDiagram, type SequenceItem, type SequenceMessage, type SequenceOperand, type StateMachine, type StateMachineState, type StateMachineTransition, type Status, type StatusBasis, type StatusChange, type StatusExplanation, type StatusRule, type Swimlane, type Transition, type TransitionChange, type TransitionFieldChange, UnconfirmedChangeError, type UnmetOutput, type UnrepresentedElement, type UnrepresentedKind, UnsupportedConditionError, type Views, type ViewsByNotation, type WhatIf, applyModelDiff, artefactKey, blockedBy, confirmChanges, controlDag, criticalPath, index_d_exports as dag, defineModel, deriveStatuses, diffFlowchart, diffSequence, diffStateMachine, diffSwimlane, elementKinds, elementStatusKey, emptyFactRecord, evaluateBranches, explainStatus, exportFormats, factNamesIn, factsFrom, flowchartToDot, flowchartToMermaid, fragmentOperators, handoffs, illegalCycles, impact, inputsOf, layeredFacts, loopTransitions, messageModes, modelSchema, notations, outputsOf, overlaySchema, overlayStatuses, parseModel, parseOverlay, participantKinds, project, pseudoRoles, readySet, sequenceToDot, sequenceToMermaid, stateMachineToDot, stateMachineToMermaid, statusRules, statuses, swimlaneToDot, swimlaneToMermaid, toFlowchart, toSequence, toStateMachine, toSwimlane, unmetOutputs, validate, validateOverlay, viewText, whatIfDone };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { a as validateOverlay, c as fragmentOperators, d as overlayStatuses, f as participantKinds, i as parseOverlay, l as messageModes, n as OverlayParseError, p as pseudoRoles, r as overlaySchema, s as elementKinds, t as modelSchema, u as notations } from "./schema-
|
|
2
|
+
import { a as validateOverlay, c as fragmentOperators, d as overlayStatuses, f as participantKinds, i as parseOverlay, l as messageModes, n as OverlayParseError, p as pseudoRoles, r as overlaySchema, s as elementKinds, t as modelSchema, u as notations } from "./schema-BPT8fmfa.js";
|
|
3
3
|
import { t as validate } from "./validate-DF3mQZww.js";
|
|
4
|
-
import {
|
|
4
|
+
import { a as stateMachineToDot, c as sequenceToMermaid, d as isUnsafeCharacter, f as terminalJson, h as parseModel, i as sequenceToDot, l as stateMachineToMermaid, m as ModelParseError, n as viewText, o as swimlaneToDot, p as terminalText, r as flowchartToDot, s as flowchartToMermaid, t as exportFormats, u as swimlaneToMermaid } from "./view-DTeNUhGG.js";
|
|
5
5
|
import { _ as criticalPath$1, a as unmetOutputs, b as actorMap, c as deriveStatuses, d as stateMachineParts, f as toStateMachine, g as handoffs, h as toFlowchart, i as readySet, l as statusRules, m as flowchartParts, n as criticalPath, o as whatIfDone, p as toSwimlane, r as impact, s as explainStatus, t as blockedBy, u as toSequence, v as immediateDominators, y as topologicalLayers } from "./queries-C8kIDRiY.js";
|
|
6
6
|
import { S as UnknownNodeError, _ as descendantsOf, a as artefactKey, b as lookup, c as evaluateBranches, f as layeredFacts, g as ancestorsOf, h as stronglyConnectedComponents, i as UnsupportedConditionError, l as factNamesIn, m as findCycles, n as illegalCycles, o as elementStatusKey, p as assertAcyclic, r as loopTransitions, s as emptyFactRecord, t as controlDag, u as factsFrom, v as assembleDag, x as CycleError, y as buildDag } from "./control-DiygoEhm.js";
|
|
7
|
+
import { t as project } from "./project-CP_ye6KI.js";
|
|
7
8
|
import { t as statuses } from "./status-Bm1CGu9C.js";
|
|
8
9
|
//#region ../../core/graph/schema/dist/artefacts.js
|
|
9
10
|
/**
|
|
@@ -926,4 +927,4 @@ const diffSequence = (model, scenario, edited) => {
|
|
|
926
927
|
};
|
|
927
928
|
};
|
|
928
929
|
//#endregion
|
|
929
|
-
export { ModelParseError, OverlayParseError, UnconfirmedChangeError, UnsupportedConditionError, applyModelDiff, artefactKey, blockedBy, confirmChanges, controlDag, criticalPath, dist_exports as dag, defineModel, deriveStatuses, diffFlowchart, diffSequence, diffStateMachine, diffSwimlane, elementKinds, elementStatusKey, emptyFactRecord, evaluateBranches, explainStatus, factNamesIn, factsFrom, fragmentOperators, handoffs, illegalCycles, impact, inputsOf, layeredFacts, loopTransitions, messageModes, modelSchema, notations, outputsOf, overlaySchema, overlayStatuses, parseModel, parseOverlay, participantKinds, pseudoRoles, readySet, statusRules, statuses, toFlowchart, toSequence, toStateMachine, toSwimlane, unmetOutputs, validate, validateOverlay, whatIfDone };
|
|
930
|
+
export { ModelParseError, OverlayParseError, UnconfirmedChangeError, UnsupportedConditionError, applyModelDiff, artefactKey, blockedBy, confirmChanges, controlDag, criticalPath, dist_exports as dag, defineModel, deriveStatuses, diffFlowchart, diffSequence, diffStateMachine, diffSwimlane, elementKinds, elementStatusKey, emptyFactRecord, evaluateBranches, explainStatus, exportFormats, factNamesIn, factsFrom, flowchartToDot, flowchartToMermaid, fragmentOperators, handoffs, illegalCycles, impact, inputsOf, isUnsafeCharacter, layeredFacts, loopTransitions, messageModes, modelSchema, notations, outputsOf, overlaySchema, overlayStatuses, parseModel, parseOverlay, participantKinds, project, pseudoRoles, readySet, sequenceToDot, sequenceToMermaid, stateMachineToDot, stateMachineToMermaid, statusRules, statuses, swimlaneToDot, swimlaneToMermaid, terminalJson, terminalText, toFlowchart, toSequence, toStateMachine, toSwimlane, unmetOutputs, validate, validateOverlay, viewText, whatIfDone };
|
package/dist/layout.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as layout, c as EngineBox, d as EngineGroup, f as EngineLeaf, i as LayoutView, l as EngineEdge, m as LayoutEngine, n as LayoutOptions, o as Size, p as EngineNode, r as LayoutResult, s as Direction, t as LaneBounds, u as EngineGraph } from "./index-
|
|
1
|
+
import { a as layout, c as EngineBox, d as EngineGroup, f as EngineLeaf, i as LayoutView, l as EngineEdge, m as LayoutEngine, n as LayoutOptions, o as Size, p as EngineNode, r as LayoutResult, s as Direction, t as LaneBounds, u as EngineGraph } from "./index-RwwlDYZ7.js";
|
|
2
2
|
//#region ../../core/graph/layout/dist/elk-engine.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* The default engine: elkjs's layered algorithm, run in the calling context from the bundled build so it needs neither a Worker nor Node-only modules. Groups are laid out together with their children (`INCLUDE_CHILDREN`), so an edge between lanes takes part in layer assignment.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { f as toStateMachine, h as toFlowchart, p as toSwimlane, u as toSequence } from "./queries-C8kIDRiY.js";
|
|
2
|
+
//#region ../../core/graph/projection/dist/project.js
|
|
3
|
+
/**
|
|
4
|
+
* Projects a model into the notation a projection names, with the input it records (a subject, a scenario).
|
|
5
|
+
* @param model - The model to project.
|
|
6
|
+
* @param projection - One of the model's declared projections, or one built the same way.
|
|
7
|
+
* @returns The notation and its view.
|
|
8
|
+
*/
|
|
9
|
+
const project = (model, projection) => {
|
|
10
|
+
if (projection.notation === "stateMachine") return {
|
|
11
|
+
notation: "stateMachine",
|
|
12
|
+
view: toStateMachine(model, projection.subject)
|
|
13
|
+
};
|
|
14
|
+
if (projection.notation === "sequence") return {
|
|
15
|
+
notation: "sequence",
|
|
16
|
+
view: toSequence(model, projection.scenario)
|
|
17
|
+
};
|
|
18
|
+
return projection.notation === "swimlane" ? {
|
|
19
|
+
notation: "swimlane",
|
|
20
|
+
view: toSwimlane(model)
|
|
21
|
+
} : {
|
|
22
|
+
notation: "flowchart",
|
|
23
|
+
view: toFlowchart(model)
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { project as t };
|
package/dist/react-flow.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { B as Status } from "./index-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { i as LayoutView, n as LayoutOptions, r as LayoutResult, s as Direction } from "./index-
|
|
5
|
-
import { A as ElementFilter,
|
|
1
|
+
import { B as Status } from "./index-D4CnOhNf.js";
|
|
2
|
+
import { K as IdSpace, S as Element, _ as Model, k as Projection } from "./index-Dvz_I_uQ.js";
|
|
3
|
+
import { N as Flowchart, k as Swimlane, w as StateMachine } from "./index-4f4PVH7K.js";
|
|
4
|
+
import { i as LayoutView, n as LayoutOptions, r as LayoutResult, s as Direction } from "./index-RwwlDYZ7.js";
|
|
5
|
+
import { A as ElementFilter, et as Run, y as NamedElement } from "./index-LWdwpjZG.js";
|
|
6
6
|
import { ReactElement } from "react";
|
|
7
7
|
import { ColorMode, Edge, EdgeProps, Node, NodeProps } from "@xyflow/react";
|
|
8
8
|
//#region ../../ui/graph/react-flow/dist/use-layout.d.ts
|
package/dist/react-flow.js
CHANGED
|
@@ -2,7 +2,7 @@ import { f as toStateMachine, h as toFlowchart, p as toSwimlane, u as toSequence
|
|
|
2
2
|
import { t as layout } from "./layout-CCM-KBdp.js";
|
|
3
3
|
import { d as useBlockers, f as useCriticalPath, h as useStatuses, i as filterElements, r as emptyFilter, t as useGraphSelection } from "./selection-iet5RAlP.js";
|
|
4
4
|
import { c as elementLabel } from "./detail-panel-B1ZmMuJT.js";
|
|
5
|
-
import { a as Lane, n as ElementCard, s as SequenceDiagram } from "./dist-
|
|
5
|
+
import { a as Lane, n as ElementCard, s as SequenceDiagram } from "./dist-arkejVz2.js";
|
|
6
6
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { BaseEdge, Handle, MarkerType, Position, ReactFlow, getSmoothStepPath } from "@xyflow/react";
|
package/dist/react.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as ProjectedView, o as ViewsByNotation, s as project } from "./index-4f4PVH7K.js";
|
|
2
|
+
import { $ as useModel, A as ElementFilter, B as useElementFilter, C as ruleDescriptions, D as SelectionContainerProps, E as GraphSelectionOptions, F as emptyFilter, G as useBlockers, H as BlockedChain, I as filterElements, J as useReadySet, K as useCriticalPath, L as filterOptions, M as FilterOption, N as FilterOptions, O as SelectionItemProps, P as actorsOf, Q as ModelState, R as matchesFilter, S as elementLabel, T as GraphSelection, U as stepWeight, V as useProjection, W as useBlockedChain, X as useWhyStatus, Y as useStatuses, Z as ModelClient, _ as ElementCardPart, a as FilterPanelPart, b as StatusBadge, c as LegendPart, d as LanePart, et as Run, f as LaneProps, g as ElementCard, h as TransitionItemProps, i as FilterPanel, j as ElementFilterState, k as useGraphSelection, l as LegendProps, m as TransitionItemPart, n as DetailPanelPart, o as FilterPanelProps, p as TransitionItem, q as useImpact, r as DetailPanelProps, s as Legend, t as DetailPanel, tt as noFacts, u as Lane, v as ElementCardProps, w as statusLabels, x as StatusBadgeProps, y as NamedElement, z as sourceScope } from "./index-LWdwpjZG.js";
|
|
2
3
|
export { type BlockedChain, DetailPanel, type DetailPanelPart, type DetailPanelProps, ElementCard, type ElementCardPart, type ElementCardProps, type ElementFilter, type ElementFilterState, type FilterOption, type FilterOptions, FilterPanel, type FilterPanelPart, type FilterPanelProps, type GraphSelection, type GraphSelectionOptions, Lane, type LanePart, type LaneProps, Legend, type LegendPart, type LegendProps, type ModelClient, type ModelState, type NamedElement, type ProjectedView, type Run, type SelectionContainerProps, type SelectionItemProps, StatusBadge, type StatusBadgeProps, TransitionItem, type TransitionItemPart, type TransitionItemProps, type ViewsByNotation, actorsOf, elementLabel, emptyFilter, filterElements, filterOptions, matchesFilter, noFacts, project, ruleDescriptions, sourceScope, statusLabels, stepWeight, useBlockedChain, useBlockers, useCriticalPath, useElementFilter, useGraphSelection, useImpact, useModel, useProjection, useReadySet, useStatuses, useWhyStatus };
|
package/dist/react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as project } from "./project-CP_ye6KI.js";
|
|
2
2
|
import { a as filterOptions, c as useElementFilter, d as useBlockers, f as useCriticalPath, g as useWhyStatus, h as useStatuses, i as filterElements, l as stepWeight, m as useReadySet, n as actorsOf, o as matchesFilter, p as useImpact, r as emptyFilter, s as sourceScope, t as useGraphSelection, u as useBlockedChain } from "./selection-iet5RAlP.js";
|
|
3
3
|
import { a as TransitionItem, c as elementLabel, i as Lane, l as ruleDescriptions, n as FilterPanel, o as ElementCard, r as Legend, s as StatusBadge, t as DetailPanel, u as statusLabels } from "./detail-panel-B1ZmMuJT.js";
|
|
4
4
|
import { ORPCError } from "@orpc/client";
|
|
@@ -73,29 +73,6 @@ const useModel = (client, modelId) => {
|
|
|
73
73
|
//#endregion
|
|
74
74
|
//#region ../../ui/graph/react/dist/projection.js
|
|
75
75
|
/**
|
|
76
|
-
* Projects a model into the notation a projection names, with the input it records (a subject, a scenario).
|
|
77
|
-
* @param model - The model to project.
|
|
78
|
-
* @param projection - One of the model's declared projections, or one built the same way.
|
|
79
|
-
* @returns The notation and its view.
|
|
80
|
-
*/
|
|
81
|
-
const project = (model, projection) => {
|
|
82
|
-
if (projection.notation === "stateMachine") return {
|
|
83
|
-
notation: "stateMachine",
|
|
84
|
-
view: toStateMachine(model, projection.subject)
|
|
85
|
-
};
|
|
86
|
-
if (projection.notation === "sequence") return {
|
|
87
|
-
notation: "sequence",
|
|
88
|
-
view: toSequence(model, projection.scenario)
|
|
89
|
-
};
|
|
90
|
-
return projection.notation === "swimlane" ? {
|
|
91
|
-
notation: "swimlane",
|
|
92
|
-
view: toSwimlane(model)
|
|
93
|
-
} : {
|
|
94
|
-
notation: "flowchart",
|
|
95
|
-
view: toFlowchart(model)
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
/**
|
|
99
76
|
* A model's view in one notation, projected again only when the model or the projection changes.
|
|
100
77
|
* @param model - The model to project.
|
|
101
78
|
* @param projection - The projection to draw. Keep it stable between renders, for instance one of `model.projections`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as overlaySchema, t as modelSchema } from "./schema-
|
|
2
|
-
import { A as modelIdSchema, C as boundItemsSchema, E as factClearingSchema, F as revisionSchema, I as storeChangeSchema, L as storedFactsSchema, M as reachSchema, P as relationSchema, R as storedModelSchema, T as factChangeSchema, j as modelSummarySchema, k as issueSchema, x as GraphStoreError } from "./store-
|
|
1
|
+
import { r as overlaySchema, t as modelSchema } from "./schema-BPT8fmfa.js";
|
|
2
|
+
import { A as modelIdSchema, C as boundItemsSchema, E as factClearingSchema, F as revisionSchema, I as storeChangeSchema, L as storedFactsSchema, M as reachSchema, P as relationSchema, R as storedModelSchema, T as factChangeSchema, j as modelSummarySchema, k as issueSchema, x as GraphStoreError } from "./store-DKzvLGgl.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { eventIterator, oc } from "@orpc/contract";
|
|
5
5
|
import { implement } from "@orpc/server";
|
|
@@ -219,7 +219,7 @@ const viewsSchema = z.partialRecord(z.enum(notations), z.partialRecord(z.string(
|
|
|
219
219
|
*
|
|
220
220
|
* Every object is strict. The inferred type is exactly `Model<OpenIds>`, which a type-level test pins in both directions.
|
|
221
221
|
*/
|
|
222
|
-
const modelSchema =
|
|
222
|
+
const modelSchema = z.strictObject({
|
|
223
223
|
participants: z.array(participantSchema).readonly(),
|
|
224
224
|
events: z.array(eventSchema).readonly(),
|
|
225
225
|
actions: z.array(actionSchema).readonly(),
|
|
@@ -229,6 +229,6 @@ const modelSchema = record({
|
|
|
229
229
|
fragments: z.array(fragmentSchema).readonly(),
|
|
230
230
|
projections: z.array(projectionSchema).readonly(),
|
|
231
231
|
views: viewsSchema.exactOptional()
|
|
232
|
-
});
|
|
232
|
+
}).readonly();
|
|
233
233
|
//#endregion
|
|
234
234
|
export { validateOverlay as a, fragmentOperators as c, overlayStatuses as d, participantKinds as f, parseOverlay as i, messageModes as l, OverlayParseError as n, toPointer as o, pseudoRoles as p, overlaySchema as r, elementKinds as s, modelSchema as t, notations as u };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { r as overlaySchema, t as modelSchema } from "./schema-BPT8fmfa.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region ../../core/graph/source-contract/dist/schema.js
|
|
4
|
+
/**
|
|
5
|
+
* The model's own record schemas, taken from `modelSchema` rather than restated, so a page of a sync is exactly a slice of a model and can never drift from it.
|
|
6
|
+
*/
|
|
7
|
+
const modelShape = modelSchema.unwrap().shape;
|
|
8
|
+
/** A participant as the model declares it: an organisation, a repository, a person. */
|
|
9
|
+
const participantSchema = modelShape.participants.unwrap().element;
|
|
10
|
+
/** A transition as the model declares it. A source emits one per dependency, from the prerequisite to the work that waits on it. */
|
|
11
|
+
const transitionSchema = modelShape.transitions.unwrap().element;
|
|
12
|
+
/** The model's `activity` element: the first variant of its element union, pinned by a type test so a reordering of the union is a compile error. */
|
|
13
|
+
const [activityElementSchema] = modelShape.elements.unwrap().element.options;
|
|
14
|
+
/**
|
|
15
|
+
* An activity bound to the external record it stands for. `source` is required here, where the model leaves it optional, and it equals `id`: the source-qualified identifier (`github:org/repo#12`) is the element's identity, so the same record synced twice, or reached from two places, is the same element.
|
|
16
|
+
*/
|
|
17
|
+
const boundActivitySchema = activityElementSchema.unwrap().extend({ source: z.string().min(1) }).refine((activity) => activity.id === activity.source, {
|
|
18
|
+
message: "a bound activity's id must equal its source",
|
|
19
|
+
path: ["id"]
|
|
20
|
+
}).readonly();
|
|
21
|
+
/** The relation kinds a source reports beside the model's transitions. */
|
|
22
|
+
const relationKinds = [
|
|
23
|
+
"child-of",
|
|
24
|
+
"assigned-to",
|
|
25
|
+
"part-of"
|
|
26
|
+
];
|
|
27
|
+
/**
|
|
28
|
+
* A structural link between two identifiers that the model has no field for: `child-of` from a sub-task activity to its parent activity, `assigned-to` from an activity to a person participant, `part-of` from one participant to the participant that contains it (a repository to its organisation). Relations carry no ordering, so a consumer decides whether a parent waits on its children.
|
|
29
|
+
*/
|
|
30
|
+
const relationSchema = z.strictObject({
|
|
31
|
+
kind: z.enum(relationKinds),
|
|
32
|
+
from: z.string().min(1),
|
|
33
|
+
to: z.string().min(1)
|
|
34
|
+
}).readonly();
|
|
35
|
+
/** Why part of a requested scope is missing from a sync. */
|
|
36
|
+
const gapReasons = ["not-found", "forbidden"];
|
|
37
|
+
/**
|
|
38
|
+
* A part of the requested scope that the source could not read, reported as data so the rest of the sync still arrives. `target` is the source-qualified identifier of what is missing: a scope, a record, or one of a record's connections.
|
|
39
|
+
*/
|
|
40
|
+
const gapSchema = z.strictObject({
|
|
41
|
+
target: z.string().min(1),
|
|
42
|
+
reason: z.enum(gapReasons),
|
|
43
|
+
message: z.string()
|
|
44
|
+
}).readonly();
|
|
45
|
+
/**
|
|
46
|
+
* One page of a sync: bound activities, the participants they name, the transitions between them, their relations, their run state, and any gaps. A page is a partial view; `assembleSync` merges a whole sync into one model.
|
|
47
|
+
*
|
|
48
|
+
* `next` is the cursor to resume after this page. It is absent on the last page.
|
|
49
|
+
*/
|
|
50
|
+
const syncPageSchema = z.strictObject({
|
|
51
|
+
participants: z.array(participantSchema).readonly(),
|
|
52
|
+
activities: z.array(boundActivitySchema).readonly(),
|
|
53
|
+
transitions: z.array(transitionSchema).readonly(),
|
|
54
|
+
relations: z.array(relationSchema).readonly(),
|
|
55
|
+
overlay: overlaySchema,
|
|
56
|
+
gaps: z.array(gapSchema).readonly(),
|
|
57
|
+
next: z.string().min(1).exactOptional()
|
|
58
|
+
}).readonly();
|
|
59
|
+
/** The run states a sync filter can select by: whether the work is still open or done. */
|
|
60
|
+
const filterStates = ["open", "done"];
|
|
61
|
+
/** What a sync filter can order the listed records by: when they were created, when they last changed, or how much discussion they have. */
|
|
62
|
+
const orderFields = [
|
|
63
|
+
"created",
|
|
64
|
+
"updated",
|
|
65
|
+
"comments"
|
|
66
|
+
];
|
|
67
|
+
/** Which way a sync filter orders the listed records. */
|
|
68
|
+
const orderDirections = ["ascending", "descending"];
|
|
69
|
+
/**
|
|
70
|
+
* Narrows and orders the records each scope lists, applied on the source's side where the source supports it. Every field is optional, and an absent field does not narrow.
|
|
71
|
+
*
|
|
72
|
+
* - `states` keeps records whose run state is one of those given.
|
|
73
|
+
* - `labels` keeps records carrying at least one of the labels given.
|
|
74
|
+
* - `order` is the order the records are listed in; absent, the source's own stable order.
|
|
75
|
+
*
|
|
76
|
+
* A filter narrows what a scope lists, not what the listed records reach: a blocker of a listed record is read whatever its own state or labels, because it is a dependency of work the filter kept.
|
|
77
|
+
*/
|
|
78
|
+
const syncFilterSchema = z.strictObject({
|
|
79
|
+
states: z.array(z.enum(filterStates)).min(1).readonly().exactOptional(),
|
|
80
|
+
labels: z.array(z.string().min(1)).min(1).readonly().exactOptional(),
|
|
81
|
+
order: z.strictObject({
|
|
82
|
+
field: z.enum(orderFields),
|
|
83
|
+
direction: z.enum(orderDirections)
|
|
84
|
+
}).readonly().exactOptional()
|
|
85
|
+
}).readonly();
|
|
86
|
+
/**
|
|
87
|
+
* What to sync and where to resume. `scope` names what to read as source-qualified scope identifiers (for GitHub, `github:org` for every repository an owner has, or `github:org/repo`), read in the order given. `after` is a cursor from an earlier page's `next`: the sync continues with the page that followed it. A cursor is valid only with the scope list and the filter it was issued for.
|
|
88
|
+
*
|
|
89
|
+
* `filter` narrows and orders what each scope lists (see `syncFilterSchema`).
|
|
90
|
+
*/
|
|
91
|
+
const syncInputSchema = z.strictObject({
|
|
92
|
+
scope: z.array(z.string().min(1)).min(1).readonly(),
|
|
93
|
+
after: z.string().min(1).exactOptional(),
|
|
94
|
+
filter: syncFilterSchema.exactOptional()
|
|
95
|
+
}).readonly();
|
|
96
|
+
/**
|
|
97
|
+
* A scope a person can choose to sync, as a picker lists it. `scope` is the scope identifier to pass to `sync` (for GitHub, `github:org` for an organisation, `github:org/repo` for a repository), `label` its display name, `description` the source's own description when it has one, `url` where it lives in the source's own interface, and `archived` whether the source has archived it.
|
|
98
|
+
*/
|
|
99
|
+
const scopeEntrySchema = z.strictObject({
|
|
100
|
+
scope: z.string().min(1),
|
|
101
|
+
label: z.string(),
|
|
102
|
+
description: z.string().exactOptional(),
|
|
103
|
+
url: z.url().exactOptional(),
|
|
104
|
+
archived: z.boolean()
|
|
105
|
+
}).readonly();
|
|
106
|
+
/**
|
|
107
|
+
* One page of a scope listing. `entries` are in the source's stable listing order, `gaps` name a parent the source could not read (it does not exist, or the credentials cannot see it), and `next` is the cursor to resume after this page, absent on the last.
|
|
108
|
+
*/
|
|
109
|
+
const scopeListingSchema = z.strictObject({
|
|
110
|
+
entries: z.array(scopeEntrySchema).readonly(),
|
|
111
|
+
gaps: z.array(gapSchema).readonly(),
|
|
112
|
+
next: z.string().min(1).exactOptional()
|
|
113
|
+
}).readonly();
|
|
114
|
+
/** Where a listing of the top-level scopes resumes: a cursor from an earlier page's `next`. */
|
|
115
|
+
const scopeRootsInputSchema = z.strictObject({ after: z.string().min(1).exactOptional() }).readonly();
|
|
116
|
+
/** The scope whose child scopes to list (for GitHub, the repositories of `github:owner`), and where to resume. A cursor is valid only for the parent it was issued for. */
|
|
117
|
+
const scopeChildrenInputSchema = z.strictObject({
|
|
118
|
+
scope: z.string().min(1),
|
|
119
|
+
after: z.string().min(1).exactOptional()
|
|
120
|
+
}).readonly();
|
|
121
|
+
/** What a source says about itself. `source` is the prefix of every identifier it emits, before the colon. */
|
|
122
|
+
const sourceDescriptionSchema = z.strictObject({ source: z.string().regex(/^[a-z][a-z0-9-]*$/u) }).readonly();
|
|
123
|
+
/** Why a request was rejected as malformed. */
|
|
124
|
+
const badRequestReasons = ["invalid-cursor", "invalid-scope"];
|
|
125
|
+
//#endregion
|
|
126
|
+
export { syncInputSchema as _, gapSchema as a, participantSchema as c, scopeChildrenInputSchema as d, scopeEntrySchema as f, syncFilterSchema as g, sourceDescriptionSchema as h, gapReasons as i, relationKinds as l, scopeRootsInputSchema as m, boundActivitySchema as n, orderDirections as o, scopeListingSchema as p, filterStates as r, orderFields as s, badRequestReasons as t, relationSchema as u, syncPageSchema as v, transitionSchema as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as GitHubTokenPort } from "../../graphql-
|
|
1
|
+
import { t as GitHubTokenPort } from "../../graphql-3DSUSUvL.js";
|
|
2
2
|
//#region ../../adapters/graph/source-github-issues/dist/node.d.ts
|
|
3
3
|
/** Where `githubTokenFromEnvironment` looks. Both are ports, so a test supplies its own. */
|
|
4
4
|
export interface EnvironmentTokenOptions {
|
package/dist/source/github.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import {
|
|
1
|
+
import { $ as syncInputSchema, A as ScopeRootsInput, B as gapReasons, C as OrderField, D as ScopeEntry, E as ScopeChildrenInput, F as SyncInput, G as relationKinds, H as orderDirections, I as SyncPage, J as scopeEntrySchema, K as relationSchema, L as badRequestReasons, M as SourceParticipant, N as SourceTransition, O as ScopeListing, P as SyncFilter, Q as syncFilterSchema, R as boundActivitySchema, S as OrderDirection, T as RelationKind, U as orderFields, V as gapSchema, W as participantSchema, X as scopeRootsInputSchema, Y as scopeListingSchema, Z as sourceDescriptionSchema, _ as BadRequestReason, a as assembleSync, b as Gap, c as GraphSourceRouter, d as PageRequest, et as syncPageSchema, f as createGraphSourceRouter, g as graphSourceContract, h as GraphSourceClient, i as AssembledSync, j as SourceDescription, k as ScopeListingInput, l as GraphSourceScopes, m as GraphSourceFailure, n as FakePage, o as ChildrenRequest, p as GraphSourceError, q as scopeChildrenInputSchema, r as createFakeGraphSource, s as GraphSourcePager, t as FakeGraphSourceOptions, tt as transitionSchema, u as ListingRequest, v as BoundActivity, w as Relation, x as GapReason, y as FilterState, z as filterStates } from "../index-Cs1CWlEg.js";
|
|
2
|
+
import { n as GraphqlFetch, r as githubGraphqlEndpoint, t as GitHubTokenPort } from "../graphql-3DSUSUvL.js";
|
|
3
|
+
import { a as GitHubIssuesSourceOptions, i as storedTokenPort, n as StoredTokenPortOptions, o as createGitHubIssuesSource, r as selectStoredToken, t as StoredGitHubToken } from "../index-Cp5selgs.js";
|
|
3
4
|
//#region ../../core/graph/source-contract/dist/paginate.d.ts
|
|
4
5
|
/**
|
|
5
6
|
* Pages through a cursor-linked sequence on demand: each `next()` reads one page, starting after `first`, and the sequence ends after the page whose `next` is absent. Nothing is read ahead of the consumer, so a consumer that stops early stops the reads.
|