@living-architecture/riviere-query 0.3.5 → 0.4.1
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/dist/RiviereQuery.d.ts +1 -1
- package/dist/RiviereQuery.d.ts.map +1 -1
- package/dist/RiviereQuery.js +3 -3
- package/dist/component-queries.d.ts.map +1 -1
- package/dist/cross-domain-queries.d.ts.map +1 -1
- package/dist/cross-domain-queries.js +13 -4
- package/dist/depth-queries.d.ts.map +1 -1
- package/dist/depth-queries.js +8 -2
- package/dist/domain-queries.d.ts.map +1 -1
- package/dist/domain-queries.js +28 -6
- package/dist/domain-types.d.ts.map +1 -1
- package/dist/event-queries.d.ts.map +1 -1
- package/dist/event-queries.js +39 -10
- package/dist/external-system-queries.d.ts.map +1 -1
- package/dist/flow-queries.d.ts.map +1 -1
- package/dist/flow-queries.js +30 -7
- package/dist/graph-diff.d.ts.map +1 -1
- package/dist/graph-diff.js +15 -3
- package/dist/graph-validation.d.ts.map +1 -1
- package/dist/graph-validation.js +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/riviere-graph-fixtures.d.ts.map +1 -1
- package/dist/riviere-graph-fixtures.js +10 -2
- package/dist/stats-queries.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/RiviereQuery.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { Entity, EntityTransition, PublishedEvent, EventHandlerInfo } from
|
|
|
3
3
|
import type { State, ComponentId, LinkId, ValidationResult, GraphDiff, Domain, Flow, SearchWithFlowResult, CrossDomainLink, DomainConnection, GraphStats, ExternalDomain } from './domain-types';
|
|
4
4
|
import { type SearchWithFlowOptions } from './flow-queries';
|
|
5
5
|
export type { Entity, EntityTransition } from './event-types';
|
|
6
|
-
export type { ComponentId, LinkId, ValidationErrorCode, ValidationError, ValidationResult, Domain, ComponentCounts, ComponentModification, DiffStats, GraphDiff, Flow, FlowStep, LinkType, SearchWithFlowResult, CrossDomainLink, DomainConnection, GraphStats, ExternalDomain } from './domain-types';
|
|
6
|
+
export type { ComponentId, LinkId, ValidationErrorCode, ValidationError, ValidationResult, Domain, ComponentCounts, ComponentModification, DiffStats, GraphDiff, Flow, FlowStep, LinkType, SearchWithFlowResult, CrossDomainLink, DomainConnection, GraphStats, ExternalDomain, } from './domain-types';
|
|
7
7
|
export type { SearchWithFlowOptions } from './flow-queries';
|
|
8
8
|
export { parseComponentId } from './domain-types';
|
|
9
9
|
export { ComponentNotFoundError } from './errors';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RiviereQuery.d.ts","sourceRoot":"","sources":["../src/RiviereQuery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"RiviereQuery.d.ts","sourceRoot":"","sources":["../src/RiviereQuery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,IAAI,EACJ,aAAa,EACb,iBAAiB,EACjB,YAAY,EACb,MAAM,qCAAqC,CAAA;AAC5C,OAAO,KAAK,EACV,MAAM,EAAE,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAC3D,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,MAAM,EACN,gBAAgB,EAChB,SAAS,EACT,MAAM,EACN,IAAI,EACJ,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,cAAc,EACf,MAAM,gBAAgB,CAAA;AAoBvB,OAAO,EAKL,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAA;AAcvB,YAAY,EACV,MAAM,EAAE,gBAAgB,EACzB,MAAM,eAAe,CAAA;AACtB,YAAY,EACV,WAAW,EACX,MAAM,EACN,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,MAAM,EACN,eAAe,EACf,qBAAqB,EACrB,SAAS,EACT,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,oBAAoB,EACpB,eAAe,EACf,gB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;;;;;;;;;;;;OAYG;IACH,KAAK,IAAI,UAAU;IAInB;;;;;;;;;;;;;;OAcG;IACH,UAAU,IAAI,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC;IAItC;;;;;;;;;;;;;;;OAeG;IACH,aAAa,IAAI,YAAY,EAAE;IAI/B;;;;;;;;;;;;;;;OAeG;IACH,eAAe,IAAI,cAAc,EAAE;CAGpC"}
|
package/dist/RiviereQuery.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { parseRiviereGraph } from '@living-architecture/riviere-schema';
|
|
2
|
-
import { findComponent, findAllComponents, componentById as lookupComponentById, searchComponents, componentsInDomain as filterByDomain, componentsByType as filterByType } from './component-queries';
|
|
3
|
-
import { queryDomains, operationsForEntity, queryEntities, businessRulesForEntity, transitionsForEntity, statesForEntity } from './domain-queries';
|
|
2
|
+
import { findComponent, findAllComponents, componentById as lookupComponentById, searchComponents, componentsInDomain as filterByDomain, componentsByType as filterByType, } from './component-queries';
|
|
3
|
+
import { queryDomains, operationsForEntity, queryEntities, businessRulesForEntity, transitionsForEntity, statesForEntity, } from './domain-queries';
|
|
4
4
|
import { queryExternalDomains } from './external-system-queries';
|
|
5
|
-
import { findEntryPoints, traceFlowFrom, queryFlows, searchWithFlowContext } from './flow-queries';
|
|
5
|
+
import { findEntryPoints, traceFlowFrom, queryFlows, searchWithFlowContext, } from './flow-queries';
|
|
6
6
|
import { queryCrossDomainLinks, queryDomainConnections } from './cross-domain-queries';
|
|
7
7
|
import { queryPublishedEvents, queryEventHandlers } from './event-queries';
|
|
8
8
|
import { validateGraph, detectOrphanComponents } from './graph-validation';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-queries.d.ts","sourceRoot":"","sources":["../src/component-queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"component-queries.d.ts","sourceRoot":"","sources":["../src/component-queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAAE,SAAS,EAAE,aAAa,EACvC,MAAM,qCAAqC,CAAA;AAE5C,wBAAgB,aAAa,CAC3B,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,GAC3C,SAAS,GAAG,SAAS,CAEvB;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,GAC3C,SAAS,EAAE,CAEb;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAEpF;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,CAYhF;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,CAEvF;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,GAAG,SAAS,EAAE,CAEtF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross-domain-queries.d.ts","sourceRoot":"","sources":["../src/cross-domain-queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AACvE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"cross-domain-queries.d.ts","sourceRoot":"","sources":["../src/cross-domain-queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AACvE,OAAO,KAAK,EACV,eAAe,EAAE,gBAAgB,EAClC,MAAM,gBAAgB,CAAA;AAOvB,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,eAAe,EAAE,CA+BhG;AA8FD,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,MAAM,GACjB,gBAAgB,EAAE,CAYpB"}
|
|
@@ -15,7 +15,7 @@ export function queryCrossDomainLinks(graph, domainName) {
|
|
|
15
15
|
if (targetDomain === undefined) {
|
|
16
16
|
continue;
|
|
17
17
|
}
|
|
18
|
-
const linkTypeKey = link.type
|
|
18
|
+
const linkTypeKey = link.type ?? 'UNDEFINED_LINK_TYPE';
|
|
19
19
|
const key = `${targetDomain}:${linkTypeKey}`;
|
|
20
20
|
if (seen.has(key)) {
|
|
21
21
|
continue;
|
|
@@ -41,7 +41,10 @@ function compareCrossDomainLinks(a, b) {
|
|
|
41
41
|
return linkTypeForSort(a.linkType).localeCompare(linkTypeForSort(b.linkType));
|
|
42
42
|
}
|
|
43
43
|
function initializeConnectionCounts() {
|
|
44
|
-
return {
|
|
44
|
+
return {
|
|
45
|
+
apiCount: 0,
|
|
46
|
+
eventCount: 0,
|
|
47
|
+
};
|
|
45
48
|
}
|
|
46
49
|
function getOrInitializeConnectionCounts(map, domain) {
|
|
47
50
|
const existing = map.get(domain);
|
|
@@ -73,7 +76,10 @@ function collectConnections(graph, domainName, nodeIdToDomain, nodeById) {
|
|
|
73
76
|
incrementConnectionCount(incoming, sourceDomain, targetType);
|
|
74
77
|
}
|
|
75
78
|
}
|
|
76
|
-
return {
|
|
79
|
+
return {
|
|
80
|
+
outgoing,
|
|
81
|
+
incoming,
|
|
82
|
+
};
|
|
77
83
|
}
|
|
78
84
|
function toConnectionResults(connections, direction) {
|
|
79
85
|
return Array.from(connections.entries()).map(([domain, counts]) => ({
|
|
@@ -87,6 +93,9 @@ export function queryDomainConnections(graph, domainName) {
|
|
|
87
93
|
const nodeIdToDomain = buildNodeIdToDomain(graph);
|
|
88
94
|
const nodeById = new Map(graph.components.map((c) => [c.id, { type: c.type }]));
|
|
89
95
|
const { outgoing, incoming } = collectConnections(graph, domainName, nodeIdToDomain, nodeById);
|
|
90
|
-
const results = [
|
|
96
|
+
const results = [
|
|
97
|
+
...toConnectionResults(outgoing, 'outgoing'),
|
|
98
|
+
...toConnectionResults(incoming, 'incoming'),
|
|
99
|
+
];
|
|
91
100
|
return results.sort((a, b) => a.targetDomain.localeCompare(b.targetDomain));
|
|
92
101
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"depth-queries.d.ts","sourceRoot":"","sources":["../src/depth-queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"depth-queries.d.ts","sourceRoot":"","sources":["../src/depth-queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACb,MAAM,qCAAqC,CAAA;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAQjD,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAiB7E"}
|
package/dist/depth-queries.js
CHANGED
|
@@ -6,7 +6,10 @@ export function queryNodeDepths(graph) {
|
|
|
6
6
|
return depths;
|
|
7
7
|
}
|
|
8
8
|
const outgoingEdges = buildOutgoingEdges(graph);
|
|
9
|
-
const queue = entryPoints.map((id) => ({
|
|
9
|
+
const queue = entryPoints.map((id) => ({
|
|
10
|
+
id,
|
|
11
|
+
depth: 0,
|
|
12
|
+
}));
|
|
10
13
|
processQueue(queue, depths, outgoingEdges);
|
|
11
14
|
return depths;
|
|
12
15
|
}
|
|
@@ -26,7 +29,10 @@ function enqueueChildren(outgoingEdges, current, queue) {
|
|
|
26
29
|
const edges = outgoingEdges.get(current.id);
|
|
27
30
|
if (edges) {
|
|
28
31
|
for (const targetId of edges) {
|
|
29
|
-
queue.push({
|
|
32
|
+
queue.push({
|
|
33
|
+
id: targetId,
|
|
34
|
+
depth: current.depth + 1,
|
|
35
|
+
});
|
|
30
36
|
}
|
|
31
37
|
}
|
|
32
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-queries.d.ts","sourceRoot":"","sources":["../src/domain-queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"domain-queries.d.ts","sourceRoot":"","sources":["../src/domain-queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAAE,iBAAiB,EAChC,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,KAAK,EACV,KAAK,EAAE,MAAM,EACd,MAAM,gBAAgB,CAAA;AAMvB,wBAAgB,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,EAAE,CAqB1D;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAIhG;AAQD,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CA0BhF;AAgBD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAQxF;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAchG;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,KAAK,EAAE,CAWhF"}
|
package/dist/domain-queries.js
CHANGED
|
@@ -6,10 +6,21 @@ export function queryDomains(graph) {
|
|
|
6
6
|
const dc = componentsInDomain(graph, name);
|
|
7
7
|
const count = (type) => dc.filter((c) => c.type === type).length;
|
|
8
8
|
const componentCounts = {
|
|
9
|
-
UI: count('UI'),
|
|
10
|
-
|
|
9
|
+
UI: count('UI'),
|
|
10
|
+
API: count('API'),
|
|
11
|
+
UseCase: count('UseCase'),
|
|
12
|
+
DomainOp: count('DomainOp'),
|
|
13
|
+
Event: count('Event'),
|
|
14
|
+
EventHandler: count('EventHandler'),
|
|
15
|
+
Custom: count('Custom'),
|
|
16
|
+
total: dc.length,
|
|
17
|
+
};
|
|
18
|
+
return {
|
|
19
|
+
name,
|
|
20
|
+
description: metadata.description,
|
|
21
|
+
systemType: metadata.systemType,
|
|
22
|
+
componentCounts,
|
|
11
23
|
};
|
|
12
|
-
return { name, description: metadata.description, systemType: metadata.systemType, componentCounts };
|
|
13
24
|
});
|
|
14
25
|
}
|
|
15
26
|
export function operationsForEntity(graph, entityName) {
|
|
@@ -23,10 +34,17 @@ export function queryEntities(graph, domainName) {
|
|
|
23
34
|
const key = `${op.domain}:${op.entity}`;
|
|
24
35
|
const existing = entityMap.get(key);
|
|
25
36
|
if (existing === undefined) {
|
|
26
|
-
entityMap.set(key, {
|
|
37
|
+
entityMap.set(key, {
|
|
38
|
+
name: op.entity,
|
|
39
|
+
domain: op.domain,
|
|
40
|
+
operations: [op],
|
|
41
|
+
});
|
|
27
42
|
}
|
|
28
43
|
else {
|
|
29
|
-
entityMap.set(key, {
|
|
44
|
+
entityMap.set(key, {
|
|
45
|
+
...existing,
|
|
46
|
+
operations: [...existing.operations, op],
|
|
47
|
+
});
|
|
30
48
|
}
|
|
31
49
|
}
|
|
32
50
|
return Array.from(entityMap.values())
|
|
@@ -54,7 +72,11 @@ export function transitionsForEntity(graph, entityName) {
|
|
|
54
72
|
if (op.stateChanges === undefined)
|
|
55
73
|
continue;
|
|
56
74
|
for (const sc of op.stateChanges) {
|
|
57
|
-
transitions.push({
|
|
75
|
+
transitions.push({
|
|
76
|
+
from: parseState(sc.from),
|
|
77
|
+
to: parseState(sc.to),
|
|
78
|
+
triggeredBy: parseOperationName(op.operationName),
|
|
79
|
+
});
|
|
58
80
|
}
|
|
59
81
|
}
|
|
60
82
|
return transitions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-types.d.ts","sourceRoot":"","sources":["../src/domain-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"domain-types.d.ts","sourceRoot":"","sources":["../src/domain-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EAAE,IAAI,EAAE,YAAY,EAC9B,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,gBAAgB;AAChB,QAAA,MAAM,iBAAiB,gDAAoC,CAAA;AAC3D,gBAAgB;AAChB,QAAA,MAAM,YAAY,2CAA+B,CAAA;AACjD,gBAAgB;AAChB,QAAA,MAAM,gBAAgB,+CAAmC,CAAA;AACzD,gBAAgB;AAChB,QAAA,MAAM,gBAAgB,+CAAmC,CAAA;AACzD,gBAAgB;AAChB,QAAA,MAAM,WAAW,0CAA8B,CAAA;AAC/C,gBAAgB;AAChB,QAAA,MAAM,mBAAmB,kDAAsC,CAAA;AAC/D,gBAAgB;AAChB,QAAA,MAAM,aAAa,4CAAgC,CAAA;AACnD,gBAAgB;AAChB,QAAA,MAAM,eAAe,8CAAkC,CAAA;AACvD,gBAAgB;AAChB,QAAA,MAAM,eAAe,8CAAkC,CAAA;AACvD,gBAAgB;AAChB,QAAA,MAAM,iBAAiB,gDAAoC,CAAA;AAE3D,8CAA8C;AAC9C,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D,yCAAyC;AACzC,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAEjD,qCAAqC;AACrC,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEzD,qCAAqC;AACrC,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEzD,6DAA6D;AAC7D,MAAM,MAAM,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1
|
+
{"version":3,"file":"event-queries.d.ts","sourceRoot":"","sources":["../src/event-queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAGb,MAAM,qCAAqC,CAAA;AAC5C,OAAO,KAAK,EACV,cAAc,EAEd,gBAAgB,EAGjB,MAAM,eAAe,CAAA;AAStB,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,cAAc,EAAE,CAwB/F;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAO9F"}
|
package/dist/event-queries.js
CHANGED
|
@@ -1,22 +1,38 @@
|
|
|
1
|
-
import { parseDomainName, parseEventId, parseEventName, parseHandlerId, parseHandlerName } from './domain-types';
|
|
1
|
+
import { parseDomainName, parseEventId, parseEventName, parseHandlerId, parseHandlerName, } from './domain-types';
|
|
2
2
|
export function queryPublishedEvents(graph, domainName) {
|
|
3
3
|
const eventComponents = graph.components.filter((c) => c.type === 'Event');
|
|
4
|
-
const filtered = domainName
|
|
4
|
+
const filtered = domainName
|
|
5
|
+
? eventComponents.filter((e) => e.domain === domainName)
|
|
6
|
+
: eventComponents;
|
|
5
7
|
const handlers = graph.components.filter((c) => c.type === 'EventHandler');
|
|
6
8
|
return filtered.map((event) => {
|
|
7
|
-
const subscribers = handlers
|
|
8
|
-
.
|
|
9
|
-
|
|
9
|
+
const subscribers = handlers
|
|
10
|
+
.filter((h) => h.subscribedEvents.includes(event.eventName))
|
|
11
|
+
.map((h) => ({
|
|
12
|
+
handlerId: parseHandlerId(h.id),
|
|
13
|
+
handlerName: parseHandlerName(h.name),
|
|
14
|
+
domain: parseDomainName(h.domain),
|
|
15
|
+
}));
|
|
16
|
+
return {
|
|
17
|
+
id: parseEventId(event.id),
|
|
18
|
+
eventName: parseEventName(event.eventName),
|
|
19
|
+
domain: parseDomainName(event.domain),
|
|
20
|
+
handlers: subscribers,
|
|
21
|
+
};
|
|
10
22
|
});
|
|
11
23
|
}
|
|
12
24
|
export function queryEventHandlers(graph, eventName) {
|
|
13
25
|
const eventByName = buildEventNameMap(graph);
|
|
14
26
|
const handlers = findEventHandlerComponents(graph);
|
|
15
|
-
const filtered = eventName
|
|
27
|
+
const filtered = eventName
|
|
28
|
+
? handlers.filter((h) => h.subscribedEvents.includes(eventName))
|
|
29
|
+
: handlers;
|
|
16
30
|
return filtered.map((h) => buildEventHandlerInfo(h, eventByName));
|
|
17
31
|
}
|
|
18
32
|
function buildEventNameMap(graph) {
|
|
19
|
-
return new Map(graph.components
|
|
33
|
+
return new Map(graph.components
|
|
34
|
+
.filter((c) => c.type === 'Event')
|
|
35
|
+
.map((e) => [e.eventName, e]));
|
|
20
36
|
}
|
|
21
37
|
function findEventHandlerComponents(graph) {
|
|
22
38
|
return graph.components.filter((c) => c.type === 'EventHandler');
|
|
@@ -25,8 +41,21 @@ function buildEventHandlerInfo(handler, eventByName) {
|
|
|
25
41
|
const subscribedEventsWithDomain = handler.subscribedEvents.map((name) => {
|
|
26
42
|
const event = eventByName.get(name);
|
|
27
43
|
if (event)
|
|
28
|
-
return {
|
|
29
|
-
|
|
44
|
+
return {
|
|
45
|
+
eventName: parseEventName(name),
|
|
46
|
+
sourceDomain: parseDomainName(event.domain),
|
|
47
|
+
sourceKnown: true,
|
|
48
|
+
};
|
|
49
|
+
return {
|
|
50
|
+
eventName: parseEventName(name),
|
|
51
|
+
sourceKnown: false,
|
|
52
|
+
};
|
|
30
53
|
});
|
|
31
|
-
return {
|
|
54
|
+
return {
|
|
55
|
+
id: parseHandlerId(handler.id),
|
|
56
|
+
handlerName: parseHandlerName(handler.name),
|
|
57
|
+
domain: parseDomainName(handler.domain),
|
|
58
|
+
subscribedEvents: handler.subscribedEvents.map(parseEventName),
|
|
59
|
+
subscribedEventsWithDomain,
|
|
60
|
+
};
|
|
32
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external-system-queries.d.ts","sourceRoot":"","sources":["../src/external-system-queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"external-system-queries.d.ts","sourceRoot":"","sources":["../src/external-system-queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAqDpD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,YAAY,GAAG,cAAc,EAAE,CAQ1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-queries.d.ts","sourceRoot":"","sources":["../src/flow-queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"flow-queries.d.ts","sourceRoot":"","sources":["../src/flow-queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EAIV,MAAM,qCAAqC,CAAA;AAC5C,OAAO,KAAK,EACV,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,EAChD,MAAM,gBAAgB,CAAA;AASvB,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,EAAE,CAIhE;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,YAAY,EACnB,gBAAgB,EAAE,WAAW,GAC5B;IACD,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB,CAiCA;AASD,wBAAgB,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,EAAE,CA2CtD;AA+CD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,+DAA+D;IAC/D,qBAAqB,EAAE,OAAO,CAAA;CAC/B;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,qBAAqB,GAC7B,oBAAoB,CAwCtB"}
|
package/dist/flow-queries.js
CHANGED
|
@@ -32,7 +32,10 @@ export function traceFlowFrom(graph, startComponentId) {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
return {
|
|
35
|
+
return {
|
|
36
|
+
componentIds: Array.from(visited),
|
|
37
|
+
linkIds: Array.from(visitedLinks),
|
|
38
|
+
};
|
|
36
39
|
}
|
|
37
40
|
function createLinkKey(link) {
|
|
38
41
|
if (link.id !== undefined) {
|
|
@@ -58,7 +61,12 @@ export function queryFlows(graph) {
|
|
|
58
61
|
const firstEdge = edges !== undefined && edges.length > 0 ? edges[0] : undefined;
|
|
59
62
|
const linkType = firstEdge === undefined ? undefined : firstEdge.type;
|
|
60
63
|
const externalLinks = externalLinksBySource.get(nodeId) ?? [];
|
|
61
|
-
steps.push({
|
|
64
|
+
steps.push({
|
|
65
|
+
component,
|
|
66
|
+
linkType,
|
|
67
|
+
depth,
|
|
68
|
+
externalLinks,
|
|
69
|
+
});
|
|
62
70
|
if (edges) {
|
|
63
71
|
for (const edge of edges) {
|
|
64
72
|
traverse(edge.target, depth + 1);
|
|
@@ -90,7 +98,10 @@ function buildExternalLinksBySource(graph) {
|
|
|
90
98
|
function buildOutgoingEdges(graph) {
|
|
91
99
|
const edges = new Map();
|
|
92
100
|
for (const link of graph.links) {
|
|
93
|
-
const entry = {
|
|
101
|
+
const entry = {
|
|
102
|
+
target: link.target,
|
|
103
|
+
type: link.type,
|
|
104
|
+
};
|
|
94
105
|
const existing = edges.get(link.source);
|
|
95
106
|
if (existing) {
|
|
96
107
|
existing.push(entry);
|
|
@@ -107,13 +118,22 @@ export function searchWithFlowContext(graph, query, options) {
|
|
|
107
118
|
if (isEmptyQuery) {
|
|
108
119
|
if (options.returnAllOnEmptyQuery) {
|
|
109
120
|
const allIds = graph.components.map((c) => parseComponentId(c.id));
|
|
110
|
-
return {
|
|
121
|
+
return {
|
|
122
|
+
matchingIds: allIds,
|
|
123
|
+
visibleIds: allIds,
|
|
124
|
+
};
|
|
111
125
|
}
|
|
112
|
-
return {
|
|
126
|
+
return {
|
|
127
|
+
matchingIds: [],
|
|
128
|
+
visibleIds: [],
|
|
129
|
+
};
|
|
113
130
|
}
|
|
114
131
|
const matchingComponents = searchComponents(graph, query);
|
|
115
132
|
if (matchingComponents.length === 0) {
|
|
116
|
-
return {
|
|
133
|
+
return {
|
|
134
|
+
matchingIds: [],
|
|
135
|
+
visibleIds: [],
|
|
136
|
+
};
|
|
117
137
|
}
|
|
118
138
|
const matchingIds = matchingComponents.map((c) => parseComponentId(c.id));
|
|
119
139
|
const visibleIds = new Set();
|
|
@@ -123,5 +143,8 @@ export function searchWithFlowContext(graph, query, options) {
|
|
|
123
143
|
visibleIds.add(id);
|
|
124
144
|
}
|
|
125
145
|
}
|
|
126
|
-
return {
|
|
146
|
+
return {
|
|
147
|
+
matchingIds,
|
|
148
|
+
visibleIds: Array.from(visibleIds),
|
|
149
|
+
};
|
|
127
150
|
}
|
package/dist/graph-diff.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-diff.d.ts","sourceRoot":"","sources":["../src/graph-diff.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"graph-diff.d.ts","sourceRoot":"","sources":["../src/graph-diff.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACb,MAAM,qCAAqC,CAAA;AAC5C,OAAO,KAAK,EACa,SAAS,EACjC,MAAM,gBAAgB,CAAA;AAKvB,wBAAgB,UAAU,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,GAAG,SAAS,CA8ChF"}
|
package/dist/graph-diff.js
CHANGED
|
@@ -12,7 +12,12 @@ export function diffGraphs(current, other) {
|
|
|
12
12
|
continue;
|
|
13
13
|
const changedFields = findChangedFields(tc, oc);
|
|
14
14
|
if (changedFields.length > 0) {
|
|
15
|
-
modified.push({
|
|
15
|
+
modified.push({
|
|
16
|
+
id: parseComponentId(tc.id),
|
|
17
|
+
before: tc,
|
|
18
|
+
after: oc,
|
|
19
|
+
changedFields,
|
|
20
|
+
});
|
|
16
21
|
}
|
|
17
22
|
}
|
|
18
23
|
const thisLinkKeys = new Set(current.links.map((l) => createLinkKey(l)));
|
|
@@ -20,8 +25,15 @@ export function diffGraphs(current, other) {
|
|
|
20
25
|
const linksAdded = other.links.filter((l) => !thisLinkKeys.has(createLinkKey(l)));
|
|
21
26
|
const linksRemoved = current.links.filter((l) => !otherLinkKeys.has(createLinkKey(l)));
|
|
22
27
|
return {
|
|
23
|
-
components: {
|
|
24
|
-
|
|
28
|
+
components: {
|
|
29
|
+
added,
|
|
30
|
+
removed,
|
|
31
|
+
modified,
|
|
32
|
+
},
|
|
33
|
+
links: {
|
|
34
|
+
added: linksAdded,
|
|
35
|
+
removed: linksRemoved,
|
|
36
|
+
},
|
|
25
37
|
stats: {
|
|
26
38
|
componentsAdded: added.length,
|
|
27
39
|
componentsRemoved: removed.length,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-validation.d.ts","sourceRoot":"","sources":["../src/graph-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"graph-validation.d.ts","sourceRoot":"","sources":["../src/graph-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACb,MAAM,qCAAqC,CAAA;AAC5C,OAAO,KAAK,EACV,WAAW,EAAmB,gBAAgB,EAC/C,MAAM,gBAAgB,CAAA;AAOvB,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,gBAAgB,CA2BnE;AAyBD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,YAAY,GAAG,WAAW,EAAE,CAUzE"}
|
package/dist/graph-validation.js
CHANGED
|
@@ -22,7 +22,10 @@ export function validateGraph(graph) {
|
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
errors.push(...validateCustomTypes(graph));
|
|
25
|
-
return {
|
|
25
|
+
return {
|
|
26
|
+
valid: errors.length === 0,
|
|
27
|
+
errors,
|
|
28
|
+
};
|
|
26
29
|
}
|
|
27
30
|
function validateCustomTypes(graph) {
|
|
28
31
|
const errors = [];
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"riviere-graph-fixtures.d.ts","sourceRoot":"","sources":["../src/riviere-graph-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACf,MAAM,qCAAqC,CAAA;AAE5C,eAAO,MAAM,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"riviere-graph-fixtures.d.ts","sourceRoot":"","sources":["../src/riviere-graph-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACf,MAAM,qCAAqC,CAAA;AAE5C,eAAO,MAAM,qBAAqB,EAAE,cAGnC,CAAA;AAED,wBAAgB,uBAAuB,IAAI,YAAY,CAwBtD;AAED,wBAAgB,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Location = {
|
|
1
|
+
export const defaultSourceLocation = {
|
|
2
|
+
repository: 'test-repo',
|
|
3
|
+
filePath: 'test.ts',
|
|
4
|
+
};
|
|
2
5
|
export function createMinimalValidGraph() {
|
|
3
6
|
return {
|
|
4
7
|
version: '1.0',
|
|
5
8
|
metadata: {
|
|
6
|
-
domains: {
|
|
9
|
+
domains: {
|
|
10
|
+
test: {
|
|
11
|
+
description: 'Test domain',
|
|
12
|
+
systemType: 'domain',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
7
15
|
},
|
|
8
16
|
components: [
|
|
9
17
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats-queries.d.ts","sourceRoot":"","sources":["../src/stats-queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"stats-queries.d.ts","sourceRoot":"","sources":["../src/stats-queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACb,MAAM,qCAAqC,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,wBAAgB,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,CAgB1D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@living-architecture/riviere-query",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -23,6 +23,6 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"zod": "^4.2.1",
|
|
26
|
-
"@living-architecture/riviere-schema": "0.
|
|
26
|
+
"@living-architecture/riviere-schema": "0.4.1"
|
|
27
27
|
}
|
|
28
28
|
}
|