@fougere/admin 0.6.0-alpha.0 → 0.7.0-alpha.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/src/topology.ts CHANGED
@@ -1,13 +1,4 @@
1
- /**
2
- * How the system is arranged, as the app itself reports it.
3
- *
4
- * The card answers what a process HOSTS; this answers what SHAPE it is in — which fronds
5
- * run here, which answered from somewhere else, and who called whom. It is served by
6
- * `@fougere/observability` on `rpc.topology`, so absence is an ordinary answer: an app
7
- * that never installed the package has no topology to publish, and says so by refusing
8
- * the op. Nothing here is declared — a frond is remote because it answered a call nobody
9
- * hosts, never because a config line said so.
10
- */
1
+ /** How the system is arranged, as the app itself reports it. */
11
2
  import {
12
3
  CALL_ENDPOINT,
13
4
  fetcher as browserFetcher,
@@ -24,13 +15,7 @@ import {
24
15
 
25
16
  export type { TopologyReport, FrondPlacement, Edge };
26
17
 
27
- /**
28
- * The report, or `undefined` when the app serves no topology at all.
29
- *
30
- * The refusal is DISTINGUISHED, not swallowed: a `NOT_FOUND` on the op is the package not
31
- * being wired — something the panel can explain — while anything else is a real failure
32
- * and stays a failure. One reserved op that is absent must not read as an app that is down.
33
- */
18
+ /** The report, or `undefined` when the app serves no topology at all. */
34
19
  export async function fetchTopology(
35
20
  endpoint = CALL_ENDPOINT,
36
21
  fetcher: Fetcher = browserFetcher,
@@ -56,13 +41,7 @@ export interface TopologyNode extends FrondPlacement {
56
41
  calledBy: Edge[];
57
42
  }
58
43
 
59
- /**
60
- * The report read as a graph, local fronds first.
61
- *
62
- * Two passes over `edges` rather than one index per direction: a topology is bounded by
63
- * fronds², so the whole thing is smaller than one page of rows and an index would be a
64
- * second structure to keep true.
65
- */
44
+ /** The report read as a graph, local fronds first. */
66
45
  export function nodesOf(report: TopologyReport): TopologyNode[] {
67
46
  const order = { local: 0, remote: 1 };
68
47
  return [...report.fronds]
@@ -74,14 +53,7 @@ export function nodesOf(report: TopologyReport): TopologyNode[] {
74
53
  }));
75
54
  }
76
55
 
77
- /**
78
- * A frond this process called that publishes nothing of its own shape.
79
- *
80
- * The honest reading of `entities: 0, doors: 0` on a remote: its shape is published by the
81
- * process that owns it, under its own service name — so a panel pointed here can say the
82
- * frond is reachable and cannot say what it holds. Worth naming rather than drawing as an
83
- * empty frond, which reads as a frond with nothing in it.
84
- */
56
+ /** A frond this process called that publishes nothing of its own shape. */
85
57
  export function isOpaque(node: FrondPlacement): boolean {
86
58
  return node.placement === 'remote' && node.entities === 0 && node.doors === 0;
87
59
  }