@x12i/map-store-playground 0.1.1 → 0.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x12i/map-store-playground",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Map-store /map-store/v1 catalog and response previews for @x12i/api-playground",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
package/src/catalog.js CHANGED
@@ -287,11 +287,11 @@ export const endpoints = [
287
287
  workingProduct({
288
288
  id: "object-exploitability-assessments",
289
289
  name: "Object exploitability assessments",
290
- summary: "EPA rows (attachment ≠ local asset exploitability).",
291
- purpose: "Published EPA. Finding/alert EPA must not be promoted to “asset locally exploitable”.",
292
- useWhen: ["EPA sections on findings/alerts/assets"],
293
- avoidWhen: ["Do not promote finding EPA to asset exploitability"],
294
- responseDescription: "EPA rows in data.",
290
+ summary: "Exploitability assessment records (attachment ≠ local asset exploitability).",
291
+ purpose: "Published exploitability assessments. A finding/alert assessment must not be promoted to “asset locally exploitable”.",
292
+ useWhen: ["Exploitability assessment sections on findings/alerts/assets"],
293
+ avoidWhen: ["Do not promote a finding exploitability assessment to asset exploitability"],
294
+ responseDescription: "Exploitability assessment records in data.",
295
295
  }),
296
296
 
297
297
  workingProduct({
package/src/renderers.js CHANGED
@@ -121,6 +121,61 @@ function buildPreviewHtml(body, endpointId) {
121
121
  ]);
122
122
  }
123
123
 
124
+ if (
125
+ endpointId === "nexum-graph-direct" ||
126
+ endpointId === "nexum-graph-extended" ||
127
+ (Array.isArray(o.edges) && (o.nodes != null || o.truncated != null))
128
+ ) {
129
+ const edges = Array.isArray(o.edges) ? o.edges : [];
130
+ const nodes = Array.isArray(o.nodes) ? o.nodes : [];
131
+ const rows = [
132
+ ["mode", endpointId === "nexum-graph-extended" ? "extended (depth 2)" : endpointId === "nexum-graph-direct" ? "direct (depth 1)" : "graph query"],
133
+ ["nodes", String(nodes.length)],
134
+ ["edges", String(edges.length)],
135
+ ["truncated", fmt(o.truncated)],
136
+ ["revisionNumber", fmt(o.revisionNumber)],
137
+ ];
138
+ const edgeLines = edges.slice(0, 40).map((e) => {
139
+ const rec = asRecord(e);
140
+ if (!rec) return `<li class="muted">—</li>`;
141
+ return `<li><code>${escape(String(rec.sourceNodeId ?? ""))}</code> —<em>${escape(String(rec.relation ?? ""))}</em>→ <code>${escape(String(rec.targetNodeId ?? ""))}</code></li>`;
142
+ });
143
+ const more =
144
+ edges.length > 40
145
+ ? `<p class="field-hint">${edges.length - 40} more edges in JSON tab.</p>`
146
+ : "";
147
+ return (
148
+ kvGrid(rows) +
149
+ (edgeLines.length
150
+ ? `<h3 style="margin-top:12px;font-size:13px">Links</h3><ul class="simple-list">${edgeLines.join("")}</ul>${more}`
151
+ : `<p class="field-hint" style="margin-top:12px">No edges in this neighborhood.</p>`)
152
+ );
153
+ }
154
+
155
+ if (endpointId === "nexum-entities-list") {
156
+ const items = Array.isArray(o.items) ? o.items : [];
157
+ const sample = items
158
+ .slice(0, 12)
159
+ .map((it) => {
160
+ const rec = asRecord(it);
161
+ return rec ? String(rec.nodeId ?? "") : "";
162
+ })
163
+ .filter(Boolean);
164
+ return kvGrid([
165
+ ["items", String(items.length)],
166
+ ["cursor", fmt(o.cursor)],
167
+ ["sample nodeIds", sample.length ? sample.join(", ") : "—"],
168
+ ]);
169
+ }
170
+
171
+ if (endpointId === "nexum-statistics" || endpointId === "nexum-signals") {
172
+ return kvGrid(
173
+ Object.keys(o)
174
+ .slice(0, 16)
175
+ .map((k) => [k, summarizeValue(o[k])]),
176
+ );
177
+ }
178
+
124
179
  if (endpointId === "investigation-packets-index" || endpointId === "ui-packets-index" || endpointId === "ui-evidence") {
125
180
  const index = o.index;
126
181
  let count = "—";