@x12i/map-store-playground 0.1.0 → 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 +1 -1
- package/src/catalog.js +5 -5
- package/src/renderers.js +55 -0
package/package.json
CHANGED
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: "
|
|
291
|
-
purpose: "Published
|
|
292
|
-
useWhen: ["
|
|
293
|
-
avoidWhen: ["Do not promote finding
|
|
294
|
-
responseDescription: "
|
|
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 = "—";
|