@x12i/map-store-client 0.1.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 +39 -0
- package/dist/attackSurfaces.d.ts +15 -0
- package/dist/attackSurfaces.d.ts.map +1 -0
- package/dist/attackSurfaces.js +287 -0
- package/dist/attackSurfaces.js.map +1 -0
- package/dist/bagCatalog.d.ts +62 -0
- package/dist/bagCatalog.d.ts.map +1 -0
- package/dist/bagCatalog.js +356 -0
- package/dist/bagCatalog.js.map +1 -0
- package/dist/bootstrap.d.ts +16 -0
- package/dist/bootstrap.d.ts.map +1 -0
- package/dist/bootstrap.js +98 -0
- package/dist/bootstrap.js.map +1 -0
- package/dist/census.d.ts +6 -0
- package/dist/census.d.ts.map +1 -0
- package/dist/census.js +41 -0
- package/dist/census.js.map +1 -0
- package/dist/config.d.ts +13 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +24 -0
- package/dist/config.js.map +1 -0
- package/dist/errors.d.ts +7 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +31 -0
- package/dist/errors.js.map +1 -0
- package/dist/fetch.d.ts +5 -0
- package/dist/fetch.d.ts.map +1 -0
- package/dist/fetch.js +61 -0
- package/dist/fetch.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/objects.d.ts +12 -0
- package/dist/objects.d.ts.map +1 -0
- package/dist/objects.js +34 -0
- package/dist/objects.js.map +1 -0
- package/dist/packets.d.ts +31 -0
- package/dist/packets.d.ts.map +1 -0
- package/dist/packets.js +76 -0
- package/dist/packets.js.map +1 -0
- package/dist/paths.d.ts +2 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +2 -0
- package/dist/paths.js.map +1 -0
- package/dist/products.d.ts +31 -0
- package/dist/products.d.ts.map +1 -0
- package/dist/products.js +30 -0
- package/dist/products.js.map +1 -0
- package/dist/types.d.ts +248 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +19 -0
- package/dist/types.js.map +1 -0
- package/dist/util.d.ts +6 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +28 -0
- package/dist/util.js.map +1 -0
- package/dist/working.d.ts +48 -0
- package/dist/working.d.ts.map +1 -0
- package/dist/working.js +219 -0
- package/dist/working.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../src/fetch.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAiBF,wBAAsB,QAAQ,CAAC,CAAC,GAAG,OAAO,EACxC,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,eAAoB,GACzB,OAAO,CAAC,CAAC,CAAC,CA+CZ"}
|
package/dist/fetch.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { mapStoreBasePath } from './config';
|
|
2
|
+
import { asRecord, nonNegInt } from './util';
|
|
3
|
+
import { MapStoreError } from './types';
|
|
4
|
+
import { messageFromMapStoreBody } from './errors';
|
|
5
|
+
function mapErrorCode(status, body) {
|
|
6
|
+
const rec = asRecord(body);
|
|
7
|
+
const code = (typeof rec?.code === 'string' && rec.code) ||
|
|
8
|
+
(typeof rec?.error === 'string' && rec.error) ||
|
|
9
|
+
(typeof rec?.errorCode === 'string' && rec.errorCode) ||
|
|
10
|
+
(typeof rec?.status === 'string' && rec.status) ||
|
|
11
|
+
undefined;
|
|
12
|
+
if (status === 409 || code === 'mixed-generation')
|
|
13
|
+
return 'mixed-generation';
|
|
14
|
+
if (code === 'incomplete-publication')
|
|
15
|
+
return 'incomplete-publication';
|
|
16
|
+
if (code === 'live-unavailable')
|
|
17
|
+
return 'live-unavailable';
|
|
18
|
+
if (status === 503 || code === 'memorix-unavailable')
|
|
19
|
+
return 'memorix-unavailable';
|
|
20
|
+
return 'http-error';
|
|
21
|
+
}
|
|
22
|
+
export async function mapFetch(path, opts = {}) {
|
|
23
|
+
const base = mapStoreBasePath();
|
|
24
|
+
const url = path.startsWith('http')
|
|
25
|
+
? path
|
|
26
|
+
: `${base}${path.startsWith('/') ? path : `/${path}`}`;
|
|
27
|
+
let res;
|
|
28
|
+
try {
|
|
29
|
+
res = await fetch(url, {
|
|
30
|
+
method: 'GET',
|
|
31
|
+
headers: { Accept: 'application/json' },
|
|
32
|
+
signal: opts.signal,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
throw new MapStoreError(err instanceof Error ? err.message : 'Network error talking to map-store', { code: 'memorix-unavailable', status: 0 });
|
|
37
|
+
}
|
|
38
|
+
const text = await res.text();
|
|
39
|
+
let body = null;
|
|
40
|
+
if (text) {
|
|
41
|
+
try {
|
|
42
|
+
body = JSON.parse(text);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
body = { raw: text };
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (!res.ok) {
|
|
49
|
+
const message = messageFromMapStoreBody(body, `map-store ${res.status} for ${path}`);
|
|
50
|
+
const rec = asRecord(body);
|
|
51
|
+
const retryAfterMs = nonNegInt(rec?.retryAfterMs) ?? (res.status === 503 ? 5000 : undefined);
|
|
52
|
+
throw new MapStoreError(message, {
|
|
53
|
+
code: mapErrorCode(res.status, body),
|
|
54
|
+
status: res.status,
|
|
55
|
+
retryAfterMs,
|
|
56
|
+
body,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return body;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=fetch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../src/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,QAAQ,E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C,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC;YACpC,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,YAAY;YACZ,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAED,OAAO,IAAS,CAAC;AACnB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { configureMapStore, mapStoreBasePath, resolveMapStoreOrigin, stripMapStoreOrigin, } from './config';
|
|
2
|
+
export type { MapStoreConfig } from './config';
|
|
3
|
+
export { MAP_STORE_API_PREFIX } from './paths';
|
|
4
|
+
export { mapFetch } from './fetch';
|
|
5
|
+
export { MapStoreError } from './types';
|
|
6
|
+
export { formatMapStoreError, messageFromMapStoreBody } from './errors';
|
|
7
|
+
export { asRecord, asList, firstString, nonNegInt } from './util';
|
|
8
|
+
export { parseTypedRecordCensus } from './census';
|
|
9
|
+
export { fetchHealth, fetchBootstrap, fetchLiveBootstrap, flattenBootstrap, unwrapWorkingProduct, normalizeLiveBootstrap, isLiveHealthy, } from './bootstrap';
|
|
10
|
+
export { fetchWorkingProduct, walkWorkingPages, parseInventoryObject, normalizePagedProduct, readWorkingPins, assertCoveringPair, resolveEntryVariant, } from './working';
|
|
11
|
+
export type { PageWalkProgress, PageWalkResult, WorkingFetchOptions } from './working';
|
|
12
|
+
export { fetchObjectSecurityContext, normalizeObjectSecurityContext, } from './objects';
|
|
13
|
+
export { fetchInvestigationPackets, fetchInvestigationPacket, parsePacketIndex, } from './packets';
|
|
14
|
+
export type { InvestigationPacketSummary } from './packets';
|
|
15
|
+
export { ALL_BROWSEABLE_WORKING_PRODUCTS, ON_DEMAND_WORKING_PRODUCTS, browseableProduct, } from './products';
|
|
16
|
+
export type { BrowseableProduct } from './products';
|
|
17
|
+
export { BAG_PRODUCTS, SERVING_OBJECT_TYPE, DISALLOWED_SECURITY_MAP_CONTENT_TYPES, bagProduct, isDisallowedSecurityMapContentType, memorixRecordId, mapStoreWorkingPath, } from './bagCatalog';
|
|
18
|
+
export type { BagProductDef, BagProductKind } from './bagCatalog';
|
|
19
|
+
export { fetchAttackSurfacesIndex, fetchAttackSurfaceDossier, fetchVpnSitesIndex, fetchVpnSiteDossier, fetchAttackCasePacketsIndex, fetchAttackCasePacket, readEntrySurfaces, recordRefToRoute, defaultEpistemicChrome, parseEpistemicBuckets, } from './attackSurfaces';
|
|
20
|
+
export type * from './types';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EACL,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACvF,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,GAC/B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EACL,+BAA+B,EAC/B,0BAA0B,EAC1B,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,qCAAqC,EACrC,UAAU,EACV,kCAAkC,EAClC,eAAe,EACf,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,2BAA2B,EAC3B,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAC1B,mBAAmB,SAAS,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { configureMapStore, mapStoreBasePath, resolveMapStoreOrigin, stripMapStoreOrigin, } from './config';
|
|
2
|
+
export { MAP_STORE_API_PREFIX } from './paths';
|
|
3
|
+
export { mapFetch } from './fetch';
|
|
4
|
+
export { MapStoreError } from './types';
|
|
5
|
+
export { formatMapStoreError, messageFromMapStoreBody } from './errors';
|
|
6
|
+
export { asRecord, asList, firstString, nonNegInt } from './util';
|
|
7
|
+
export { parseTypedRecordCensus } from './census';
|
|
8
|
+
export { fetchHealth, fetchBootstrap, fetchLiveBootstrap, flattenBootstrap, unwrapWorkingProduct, normalizeLiveBootstrap, isLiveHealthy, } from './bootstrap';
|
|
9
|
+
export { fetchWorkingProduct, walkWorkingPages, parseInventoryObject, normalizePagedProduct, readWorkingPins, assertCoveringPair, resolveEntryVariant, } from './working';
|
|
10
|
+
export { fetchObjectSecurityContext, normalizeObjectSecurityContext, } from './objects';
|
|
11
|
+
export { fetchInvestigationPackets, fetchInvestigationPacket, parsePacketIndex, } from './packets';
|
|
12
|
+
export { ALL_BROWSEABLE_WORKING_PRODUCTS, ON_DEMAND_WORKING_PRODUCTS, browseableProduct, } from './products';
|
|
13
|
+
export { BAG_PRODUCTS, SERVING_OBJECT_TYPE, DISALLOWED_SECURITY_MAP_CONTENT_TYPES, bagProduct, isDisallowedSecurityMapContentType, memorixRecordId, mapStoreWorkingPath, } from './bagCatalog';
|
|
14
|
+
export { fetchAttackSurfacesIndex, fetchAttackSurfaceDossier, fetchVpnSitesIndex, fetchVpnSiteDossier, fetchAttackCasePacketsIndex, fetchAttackCasePacket, readEntrySurfaces, recordRefToRoute, defaultEpistemicChrome, parseEpistemicBuckets, } from './attackSurfaces';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EACL,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,GAC/B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,+BAA+B,EAC/B,0BAA0B,EAC1B,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,qCAAqC,EACrC,UAAU,EACV,kCAAkC,EAClC,eAAe,EACf,mBAAmB,GACpB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,2BAA2B,EAC3B,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type MapFetchOptions } from './fetch';
|
|
2
|
+
import type { CoveringPair, ObjectSecurityContextJoin } from './types';
|
|
3
|
+
export type ObjectSecurityContextOptions = MapFetchOptions & {
|
|
4
|
+
expectedPair?: CoveringPair;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Preferred detail path: station joins OSC + classification + pre-AI + live overlay.
|
|
8
|
+
* Classification may be null / incomplete — degrade honestly, do not crash.
|
|
9
|
+
*/
|
|
10
|
+
export declare function normalizeObjectSecurityContext(payload: unknown): ObjectSecurityContextJoin;
|
|
11
|
+
export declare function fetchObjectSecurityContext(objectId: string, opts?: ObjectSecurityContextOptions): Promise<ObjectSecurityContextJoin>;
|
|
12
|
+
//# sourceMappingURL=objects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objects.d.ts","sourceRoot":"","sources":["../src/objects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAGvE,MAAM,MAAM,4BAA4B,GAAG,eAAe,GAAG;IAC3D,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,OAAO,GACf,yBAAyB,CA+B3B;AAED,wBAAsB,0BAA0B,CAC9C,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,4BAA4B,GAClC,OAAO,CAAC,yBAAyB,CAAC,CAWpC"}
|
package/dist/objects.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { mapFetch } from './fetch';
|
|
2
|
+
import { asRecord, firstString } from './util';
|
|
3
|
+
import { assertCoveringPair } from './working';
|
|
4
|
+
/**
|
|
5
|
+
* Preferred detail path: station joins OSC + classification + pre-AI + live overlay.
|
|
6
|
+
* Classification may be null / incomplete — degrade honestly, do not crash.
|
|
7
|
+
*/
|
|
8
|
+
export function normalizeObjectSecurityContext(payload) {
|
|
9
|
+
const top = asRecord(payload) ?? {};
|
|
10
|
+
const context = top.context ?? null;
|
|
11
|
+
const preAi = asRecord(top.preAiContext) ??
|
|
12
|
+
asRecord(asRecord(context)?.preAiContext) ??
|
|
13
|
+
null;
|
|
14
|
+
const objectId = firstString(top.objectId, asRecord(context)?.objectId, preAi?.objectId) ?? '';
|
|
15
|
+
const objectType = firstString(top.objectType, asRecord(context)?.objectType, preAi?.objectType);
|
|
16
|
+
return {
|
|
17
|
+
snapshotSetId: firstString(top.snapshotSetId),
|
|
18
|
+
liveGenerationId: firstString(top.liveGenerationId) ?? null,
|
|
19
|
+
objectId,
|
|
20
|
+
objectType,
|
|
21
|
+
context,
|
|
22
|
+
classification: top.classification ?? null,
|
|
23
|
+
preAiContext: top.preAiContext ?? preAi,
|
|
24
|
+
liveOverlay: top.liveOverlay ?? null,
|
|
25
|
+
retrieval: top.retrieval,
|
|
26
|
+
liveAuthority: top.liveAuthority,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export async function fetchObjectSecurityContext(objectId, opts) {
|
|
30
|
+
const payload = await mapFetch(`/objects/${encodeURIComponent(objectId)}/security-context`, opts);
|
|
31
|
+
assertCoveringPair(payload, opts?.expectedPair, `objects/${objectId}/security-context`);
|
|
32
|
+
return normalizeObjectSecurityContext(payload);
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=objects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objects.js","sourceRoot":"","sources":["../src/objects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAwB,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAM/C;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAC5C,OAAgB;IAEhB,MAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACpC,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,IAAI,IAAI,CAAC;IACpC,MAAM,KAAK,GACT,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC;QAC1B,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;QACzC,IAAI,CAAC;IACP,MAAM,QAAQ,GACZ,WAAW,CACT,GAAG,CAAC,QAAQ,EACZ,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,EAC3B,KAAK,EAAE,QAAQ,CAChB,IAAI,EAAE,CAAC;IACV,MAAM,UAAU,GAAG,WAAW,CAC5B,GAAG,CAAC,UAAU,EACd,QAAQ,CAAC,OAAO,CAAC,EAAE,UAAU,EAC7B,KAAK,EAAE,UAAU,CAClB,CAAC;IAEF,OAAO;QACL,aAAa,EAAE,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC;QAC7C,gBAAgB,EAAE,WAAW,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,IAAI;QAC3D,QAAQ;QACR,UAAU;QACV,OAAO;QACP,cAAc,EAAE,GAAG,CAAC,cAAc,IAAI,IAAI;QAC1C,YAAY,EAAE,GAAG,CAAC,YAAY,IAAI,KAAK;QACvC,WAAW,EAAE,GAAG,CAAC,WAAW,IAAI,IAAI;QACpC,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,aAAa,EAAE,GAAG,CAAC,aAAa;KACjC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,QAAgB,EAChB,IAAmC;IAEnC,MAAM,OAAO,GAAG,MAAM,QAAQ,CAC5B,YAAY,kBAAkB,CAAC,QAAQ,CAAC,mBAAmB,EAC3D,IAAI,CACL,CAAC;IACF,kBAAkB,CAChB,OAAO,EACP,IAAI,EAAE,YAAY,EAClB,WAAW,QAAQ,mBAAmB,CACvC,CAAC;IACF,OAAO,8BAA8B,CAAC,OAAO,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type MapFetchOptions } from './fetch';
|
|
2
|
+
import type { CoveringPair } from './types';
|
|
3
|
+
export type PacketFetchOptions = MapFetchOptions & {
|
|
4
|
+
expectedPair?: CoveringPair;
|
|
5
|
+
};
|
|
6
|
+
export type InvestigationPacketSummary = {
|
|
7
|
+
packetId: string;
|
|
8
|
+
scope?: string;
|
|
9
|
+
objective?: string;
|
|
10
|
+
generatedAt?: string;
|
|
11
|
+
/** e.g. possible-attack — conditional seed, not activity claim */
|
|
12
|
+
scenarioKind?: string;
|
|
13
|
+
affectedObjectCount?: number;
|
|
14
|
+
affectedObjectIds?: string[];
|
|
15
|
+
guardrails?: string[];
|
|
16
|
+
raw: Record<string, unknown>;
|
|
17
|
+
};
|
|
18
|
+
export declare function parsePacketIndex(payload: unknown): {
|
|
19
|
+
snapshotSetId?: string;
|
|
20
|
+
analysisSnapshotId?: string;
|
|
21
|
+
liveGenerationId?: string | null;
|
|
22
|
+
packets: InvestigationPacketSummary[];
|
|
23
|
+
};
|
|
24
|
+
export declare function fetchInvestigationPackets(opts?: PacketFetchOptions): Promise<{
|
|
25
|
+
snapshotSetId?: string;
|
|
26
|
+
analysisSnapshotId?: string;
|
|
27
|
+
liveGenerationId?: string | null;
|
|
28
|
+
packets: InvestigationPacketSummary[];
|
|
29
|
+
}>;
|
|
30
|
+
export declare function fetchInvestigationPacket(packetId: string, opts?: PacketFetchOptions): Promise<unknown>;
|
|
31
|
+
//# sourceMappingURL=packets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packets.d.ts","sourceRoot":"","sources":["../src/packets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG;IACjD,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9B,CAAC;AAoBF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,OAAO,EAAE,0BAA0B,EAAE,CAAC;CACvC,CAiDA;AAED,wBAAsB,yBAAyB,CAAC,IAAI,CAAC,EAAE,kBAAkB;oBAvDvD,MAAM;yBACD,MAAM;uBACR,MAAM,GAAG,IAAI;aACvB,0BAA0B,EAAE;GAwDtC;AAED,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,kBAAkB,oBAY1B"}
|
package/dist/packets.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { mapFetch } from './fetch';
|
|
2
|
+
import { asRecord, asList, firstString } from './util';
|
|
3
|
+
import { assertCoveringPair } from './working';
|
|
4
|
+
function parseAffectedObjectIds(affected) {
|
|
5
|
+
const items = asList(affected.items ?? affected.objects ?? affected.inline);
|
|
6
|
+
const ids = [];
|
|
7
|
+
const seen = new Set();
|
|
8
|
+
for (const row of items) {
|
|
9
|
+
const rec = asRecord(row);
|
|
10
|
+
const id = rec
|
|
11
|
+
? firstString(rec.objectId, rec.id, rec.relatedObjectId)
|
|
12
|
+
: typeof row === 'string'
|
|
13
|
+
? row
|
|
14
|
+
: null;
|
|
15
|
+
if (!id || seen.has(id))
|
|
16
|
+
continue;
|
|
17
|
+
seen.add(id);
|
|
18
|
+
ids.push(id);
|
|
19
|
+
}
|
|
20
|
+
return ids;
|
|
21
|
+
}
|
|
22
|
+
export function parsePacketIndex(payload) {
|
|
23
|
+
const top = asRecord(payload) ?? {};
|
|
24
|
+
// map-store /investigation-packets: { index: { packets: [...] } }
|
|
25
|
+
// working/security-investigation-packet: { index: [ { packetId, ... } ], packetIds }
|
|
26
|
+
const indexRec = asRecord(top.index);
|
|
27
|
+
const packetsRaw = Array.isArray(top.index)
|
|
28
|
+
? top.index
|
|
29
|
+
: asList(indexRec?.packets ?? top.packets ?? top.items);
|
|
30
|
+
const packets = [];
|
|
31
|
+
for (const row of packetsRaw) {
|
|
32
|
+
const rec = asRecord(row);
|
|
33
|
+
if (!rec)
|
|
34
|
+
continue;
|
|
35
|
+
const identity = asRecord(rec.identity) ?? {};
|
|
36
|
+
const agentTask = asRecord(rec.agentTask) ?? {};
|
|
37
|
+
const sections = asRecord(rec.sections) ?? {};
|
|
38
|
+
const affected = asRecord(sections.affectedObjects) ?? {};
|
|
39
|
+
const packetId = firstString(identity.packetId, rec.packetId);
|
|
40
|
+
if (!packetId)
|
|
41
|
+
continue;
|
|
42
|
+
const affectedObjectIds = parseAffectedObjectIds(affected);
|
|
43
|
+
packets.push({
|
|
44
|
+
packetId,
|
|
45
|
+
scope: firstString(identity.scope, rec.scope),
|
|
46
|
+
objective: firstString(agentTask.objective, rec.objective),
|
|
47
|
+
generatedAt: firstString(identity.generatedAt, rec.generatedAt),
|
|
48
|
+
scenarioKind: firstString(identity.scenarioKind, rec.scenarioKind, agentTask.scenarioKind),
|
|
49
|
+
affectedObjectCount: typeof affected.itemCount === 'number'
|
|
50
|
+
? affected.itemCount
|
|
51
|
+
: affectedObjectIds.length || undefined,
|
|
52
|
+
affectedObjectIds: affectedObjectIds.length > 0 ? affectedObjectIds : undefined,
|
|
53
|
+
guardrails: Array.isArray(agentTask.guardrails)
|
|
54
|
+
? agentTask.guardrails.filter((g) => typeof g === 'string')
|
|
55
|
+
: undefined,
|
|
56
|
+
raw: rec,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
snapshotSetId: firstString(top.snapshotSetId),
|
|
61
|
+
analysisSnapshotId: firstString(top.analysisSnapshotId),
|
|
62
|
+
liveGenerationId: firstString(top.liveGenerationId) ?? null,
|
|
63
|
+
packets,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export async function fetchInvestigationPackets(opts) {
|
|
67
|
+
const payload = await mapFetch('/investigation-packets', opts);
|
|
68
|
+
assertCoveringPair(payload, opts?.expectedPair, 'investigation-packets');
|
|
69
|
+
return parsePacketIndex(payload);
|
|
70
|
+
}
|
|
71
|
+
export async function fetchInvestigationPacket(packetId, opts) {
|
|
72
|
+
const payload = await mapFetch(`/investigation-packets/${encodeURIComponent(packetId)}`, opts);
|
|
73
|
+
assertCoveringPair(payload, opts?.expectedPair, `investigation-packets/${packetId}`);
|
|
74
|
+
return payload;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=packets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packets.js","sourceRoot":"","sources":["../src/packets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAwB,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAmB/C,SAAS,sBAAsB,CAAC,QAAiC;IAC/D,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC5E,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;QACxB,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC1B,MAAM,EAAE,GAAG,GAAG;YACZ,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,eAAe,CAAC;YACxD,CAAC,CAAC,OAAO,GAAG,KAAK,QAAQ;gBACvB,CAAC,CAAC,GAAG;gBACL,CAAC,CAAC,IAAI,CAAC;QACX,IAAI,CAA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AM,CAAC,KAAK,UAAU,yBAAyB,CAAC,IAAyB;IACvE,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,wBAAwB,EAAE,IAAI,CAAC,CAAC;IAC/D,kBAAkB,CAAC,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,uBAAuB,CAAC,CAAC;IACzE,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,QAAgB,EAChB,IAAyB;IAEzB,MAAM,OAAO,GAAG,MAAM,QAAQ,CAC5B,0BAA0B,kBAAkB,CAAC,QAAQ,CAAC,EAAE,EACxD,IAAI,CACL,CAAC;IACF,kBAAkB,CAChB,OAAO,EACP,IAAI,EAAE,YAAY,EAClB,yBAAyB,QAAQ,EAAE,CACpC,CAAC;IACF,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/paths.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,kBAAkB,CAAC"}
|
package/dist/paths.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Published working products reachable on-demand via More Actions.
|
|
3
|
+
* Derived from BAG_PRODUCTS (OT=security-map CT alignment). Auto-loaded /
|
|
4
|
+
* alreadyLoaded products stay listed so UI can skip duplicate eager walks.
|
|
5
|
+
*/
|
|
6
|
+
export type BrowseableProduct = {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
/** Honesty / scope note shown next to the action */
|
|
10
|
+
note: string;
|
|
11
|
+
/** Prefer filtering loaded rows by objectId when present */
|
|
12
|
+
objectScoped?: boolean;
|
|
13
|
+
/** Already walked at session/deep-load — browse still available on demand */
|
|
14
|
+
alreadyLoaded?: boolean;
|
|
15
|
+
/** May 503 incomplete-publication on current bags */
|
|
16
|
+
mayBeMissing?: boolean;
|
|
17
|
+
/** Live overlay only — do not rewrite stable reachability/exploitability */
|
|
18
|
+
liveOverlay?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* When bare product index is incomplete, start walks at this family variant
|
|
21
|
+
* (e.g. graph → network, findings-query → open-vuln).
|
|
22
|
+
*/
|
|
23
|
+
entryVariant?: string;
|
|
24
|
+
};
|
|
25
|
+
/** Products not auto-loaded that humans should still be able to open. */
|
|
26
|
+
export declare const ON_DEMAND_WORKING_PRODUCTS: BrowseableProduct[];
|
|
27
|
+
/** Already loaded elsewhere — still offer browse for leftovers / re-load. */
|
|
28
|
+
export declare const ALREADY_LOADED_WORKING_PRODUCTS: BrowseableProduct[];
|
|
29
|
+
export declare const ALL_BROWSEABLE_WORKING_PRODUCTS: BrowseableProduct[];
|
|
30
|
+
export declare function browseableProduct(id: string): BrowseableProduct | undefined;
|
|
31
|
+
//# sourceMappingURL=products.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../src/products.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,6EAA6E;IAC7E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qDAAqD;IACrD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAeF,yEAAyE;AACzE,eAAO,MAAM,0BAA0B,EAAE,iBAAiB,EAEvC,CAAC;AAEpB,6EAA6E;AAC7E,eAAO,MAAM,+BAA+B,EAAE,iBAAiB,EAE5C,CAAC;AAEpB,eAAO,MAAM,+BAA+B,EAAE,iBAAiB,EAG9D,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAE3E"}
|
package/dist/products.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Published working products reachable on-demand via More Actions.
|
|
3
|
+
* Derived from BAG_PRODUCTS (OT=security-map CT alignment). Auto-loaded /
|
|
4
|
+
* alreadyLoaded products stay listed so UI can skip duplicate eager walks.
|
|
5
|
+
*/
|
|
6
|
+
import { BAG_PRODUCTS } from './bagCatalog';
|
|
7
|
+
function toBrowseable(def) {
|
|
8
|
+
return {
|
|
9
|
+
id: def.contentType,
|
|
10
|
+
label: def.label,
|
|
11
|
+
note: def.note,
|
|
12
|
+
objectScoped: def.objectScoped,
|
|
13
|
+
alreadyLoaded: def.alreadyLoaded,
|
|
14
|
+
mayBeMissing: def.mayBeMissing,
|
|
15
|
+
liveOverlay: def.liveOverlay,
|
|
16
|
+
entryVariant: def.entryVariant,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/** Products not auto-loaded that humans should still be able to open. */
|
|
20
|
+
export const ON_DEMAND_WORKING_PRODUCTS = BAG_PRODUCTS.filter((p) => !p.alreadyLoaded).map(toBrowseable);
|
|
21
|
+
/** Already loaded elsewhere — still offer browse for leftovers / re-load. */
|
|
22
|
+
export const ALREADY_LOADED_WORKING_PRODUCTS = BAG_PRODUCTS.filter((p) => p.alreadyLoaded).map(toBrowseable);
|
|
23
|
+
export const ALL_BROWSEABLE_WORKING_PRODUCTS = [
|
|
24
|
+
...ON_DEMAND_WORKING_PRODUCTS,
|
|
25
|
+
...ALREADY_LOADED_WORKING_PRODUCTS,
|
|
26
|
+
];
|
|
27
|
+
export function browseableProduct(id) {
|
|
28
|
+
return ALL_BROWSEABLE_WORKING_PRODUCTS.find((p) => p.id === id);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=products.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"products.js","sourceRoot":"","sources":["../src/products.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAsB,MAAM,cAAc,CAAC;AAsBhE,SAAS,YAAY,CAAC,GAAkB;IACtC,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,WAAW;QACnB,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,YAAY,EAAE,GAAG,CAAC,YAAY;QAC9B,aAAa,EAAE,GAAG,CAAC,aAAa;QAChC,YAAY,EAAE,GAAG,CAAC,YAAY;QAC9B,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,YAAY,EAAE,GAAG,CAAC,YAAY;KAC/B,CAAC;AACJ,CAAC;AAED,yEAAyE;AACzE,MAAM,CAAC,MAAM,0BAA0B,GAAwB,YAAY,CAAC,MAAM,CAChF,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,aAAa,CACxB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AAEpB,6EAA6E;AAC7E,MAAM,CAAC,MAAM,+BAA+B,GAAwB,YAAY,CAAC,MAAM,CACrF,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CACvB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AAEpB,MAAM,CAAC,MAAM,+BAA+B,GAAwB;IAClE,GAAG,0BAA0B;IAC7B,GAAG,+BAA+B;CACnC,CAAC;AAEF,MAAM,UAAU,iBAAiB,CAAC,EAAU;IAC1C,OAAO,+BAA+B,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin types for map-store /map-store/v1 responses.
|
|
3
|
+
* Generation tokens are opaque — display only; never send on product URLs.
|
|
4
|
+
*/
|
|
5
|
+
export type LiveAvailability = 'available' | 'unavailable' | 'stale-for-this-pair';
|
|
6
|
+
/** Locked covering pair from working/bootstrap — every later page must match. */
|
|
7
|
+
export type CoveringPair = {
|
|
8
|
+
snapshotSetId: string;
|
|
9
|
+
analysisSnapshotId?: string;
|
|
10
|
+
};
|
|
11
|
+
export type TypedRecordCensus = {
|
|
12
|
+
confirmedAssets: number;
|
|
13
|
+
unresolvedSubjects: number;
|
|
14
|
+
findingsAndAlerts: number;
|
|
15
|
+
findings?: number;
|
|
16
|
+
alerts?: number;
|
|
17
|
+
relationshipOnlyAliases?: number;
|
|
18
|
+
totalPublishedKnowledge?: number;
|
|
19
|
+
};
|
|
20
|
+
export type ProducerIdentity = {
|
|
21
|
+
publicationContractVersion?: string;
|
|
22
|
+
landerVersion?: string;
|
|
23
|
+
landerSha?: string;
|
|
24
|
+
productProjectionVersion?: string;
|
|
25
|
+
generatedAt?: string;
|
|
26
|
+
};
|
|
27
|
+
export type MapStoreHealth = {
|
|
28
|
+
ok?: boolean;
|
|
29
|
+
service?: string;
|
|
30
|
+
memorixReachable: boolean;
|
|
31
|
+
estateReady: boolean;
|
|
32
|
+
memorixOrgId?: string;
|
|
33
|
+
memorixUrl?: string;
|
|
34
|
+
userMessage?: string | null;
|
|
35
|
+
stationOk?: boolean;
|
|
36
|
+
estateFromMemorixOnly?: boolean;
|
|
37
|
+
};
|
|
38
|
+
export type SessionBootstrap = {
|
|
39
|
+
snapshotSetId: string;
|
|
40
|
+
analysisSnapshotId?: string;
|
|
41
|
+
liveGenerationId: string | null;
|
|
42
|
+
liveAvailability: LiveAvailability | null;
|
|
43
|
+
liveUnavailableReason?: string;
|
|
44
|
+
typedCensus: TypedRecordCensus | null;
|
|
45
|
+
producerIdentity: ProducerIdentity | null;
|
|
46
|
+
assessmentCoverage: Record<string, unknown> | null;
|
|
47
|
+
estateReady: boolean;
|
|
48
|
+
/** Nested Memorix bootstrap body (unwrapped). */
|
|
49
|
+
bootstrap: Record<string, unknown>;
|
|
50
|
+
liveBootstrapInline: unknown | null;
|
|
51
|
+
};
|
|
52
|
+
export type LiveBootstrap = {
|
|
53
|
+
liveGenerationId?: string;
|
|
54
|
+
relatedSnapshotSetId?: string;
|
|
55
|
+
relatedAnalysisSnapshotId?: string;
|
|
56
|
+
omStatus?: Record<string, unknown>;
|
|
57
|
+
observationUseLedger?: Record<string, unknown>;
|
|
58
|
+
edgeAccounting?: Record<string, unknown>;
|
|
59
|
+
admittedToServingAssessment?: boolean;
|
|
60
|
+
authority?: string;
|
|
61
|
+
disposition?: string;
|
|
62
|
+
[key: string]: unknown;
|
|
63
|
+
};
|
|
64
|
+
export type InventoryObject = {
|
|
65
|
+
objectId: string;
|
|
66
|
+
objectType: string;
|
|
67
|
+
displayName?: string | null;
|
|
68
|
+
addresses?: string[];
|
|
69
|
+
identityStatus?: string;
|
|
70
|
+
relationshipOnlyNonObject?: boolean;
|
|
71
|
+
observedTraffic?: boolean;
|
|
72
|
+
[key: string]: unknown;
|
|
73
|
+
};
|
|
74
|
+
export type PagedProduct = {
|
|
75
|
+
pageVariants?: string[];
|
|
76
|
+
pageCount?: number;
|
|
77
|
+
expectedItemCount?: number;
|
|
78
|
+
items?: unknown[];
|
|
79
|
+
objects?: unknown[];
|
|
80
|
+
coverage?: Record<string, unknown>;
|
|
81
|
+
[key: string]: unknown;
|
|
82
|
+
};
|
|
83
|
+
/** Epistemic plane labels — string unions only; never collapse to a boolean. */
|
|
84
|
+
export type EpistemicLabel = 'REACHABLE' | 'OBSERVED' | 'POLICY_CANDIDATE' | 'NO_ALLOW' | 'UNKNOWN' | string;
|
|
85
|
+
export type EpistemicBucketItem = {
|
|
86
|
+
kind?: string;
|
|
87
|
+
zone?: string;
|
|
88
|
+
statement?: string;
|
|
89
|
+
epistemic?: EpistemicLabel;
|
|
90
|
+
note?: string;
|
|
91
|
+
[key: string]: unknown;
|
|
92
|
+
};
|
|
93
|
+
export type EpistemicBuckets = {
|
|
94
|
+
knownCan: EpistemicBucketItem[];
|
|
95
|
+
observed: EpistemicBucketItem[];
|
|
96
|
+
knownCant: EpistemicBucketItem[];
|
|
97
|
+
maybeWorry: EpistemicBucketItem[];
|
|
98
|
+
};
|
|
99
|
+
export type AttackSurfaceIndexEntry = {
|
|
100
|
+
surfaceId: string;
|
|
101
|
+
priority?: string;
|
|
102
|
+
summary?: string;
|
|
103
|
+
recordRef?: string;
|
|
104
|
+
};
|
|
105
|
+
export type AttackSurfacesIndex = {
|
|
106
|
+
schemaVersion?: string;
|
|
107
|
+
snapshotSetId?: string;
|
|
108
|
+
analysisSnapshotId?: string;
|
|
109
|
+
generatedAt?: string;
|
|
110
|
+
suggestedOrder: string[];
|
|
111
|
+
surfaces: AttackSurfaceIndexEntry[];
|
|
112
|
+
honesty?: string[];
|
|
113
|
+
pageVariants?: string[];
|
|
114
|
+
expectedItemCount?: number;
|
|
115
|
+
};
|
|
116
|
+
export type VpnSiteInstanceSummary = {
|
|
117
|
+
siteId: string;
|
|
118
|
+
priority?: string;
|
|
119
|
+
peerPublicIp?: string;
|
|
120
|
+
nativeAcceptDestZones?: string[];
|
|
121
|
+
recordRef?: string;
|
|
122
|
+
};
|
|
123
|
+
export type AttackSurfaceDossier = {
|
|
124
|
+
schemaVersion?: string;
|
|
125
|
+
surfaceId: string;
|
|
126
|
+
generatedAt?: string;
|
|
127
|
+
priority?: string;
|
|
128
|
+
summary?: string;
|
|
129
|
+
suggestedNavOrder?: number;
|
|
130
|
+
outboundAcceptCount?: number;
|
|
131
|
+
destZones?: string[];
|
|
132
|
+
epistemicBuckets?: EpistemicBuckets;
|
|
133
|
+
epistemicChrome?: EpistemicLabel[];
|
|
134
|
+
honesty?: string[];
|
|
135
|
+
deliveryGapClosed?: boolean;
|
|
136
|
+
instanceCount?: number;
|
|
137
|
+
instances?: VpnSiteInstanceSummary[];
|
|
138
|
+
accepts?: unknown[];
|
|
139
|
+
[key: string]: unknown;
|
|
140
|
+
};
|
|
141
|
+
export type VpnPhase2Selector = {
|
|
142
|
+
phase2?: string;
|
|
143
|
+
localSelectorCidrs?: string[];
|
|
144
|
+
remoteSelectorCidrs?: string[];
|
|
145
|
+
freshness?: string;
|
|
146
|
+
[key: string]: unknown;
|
|
147
|
+
};
|
|
148
|
+
export type VpnOutboundAcceptRule = {
|
|
149
|
+
ruleId?: string;
|
|
150
|
+
destZones?: string[];
|
|
151
|
+
sourceZoneMatched?: string;
|
|
152
|
+
zonePairId?: string;
|
|
153
|
+
inheritance?: string;
|
|
154
|
+
[key: string]: unknown;
|
|
155
|
+
};
|
|
156
|
+
export type VpnSiteDossier = {
|
|
157
|
+
siteId: string;
|
|
158
|
+
entryClass?: string;
|
|
159
|
+
priority?: string;
|
|
160
|
+
peerPublicIp?: string | null;
|
|
161
|
+
peerUnresolved?: boolean;
|
|
162
|
+
tunnels?: string[];
|
|
163
|
+
phase2Selectors?: VpnPhase2Selector[];
|
|
164
|
+
remoteInnerOrigins?: string[];
|
|
165
|
+
localInnerSelectors?: string[];
|
|
166
|
+
outboundAcceptRules?: VpnOutboundAcceptRule[];
|
|
167
|
+
nativeAcceptDestZones?: string[];
|
|
168
|
+
sharedZoneInheritedAccepts?: unknown[];
|
|
169
|
+
intrazoneDefault?: string;
|
|
170
|
+
epistemicBuckets?: EpistemicBuckets;
|
|
171
|
+
honesty?: string[];
|
|
172
|
+
deliveryNarrativeClarity?: string;
|
|
173
|
+
[key: string]: unknown;
|
|
174
|
+
};
|
|
175
|
+
export type VpnSitesIndex = {
|
|
176
|
+
schemaVersion?: string;
|
|
177
|
+
snapshotSetId?: string;
|
|
178
|
+
analysisSnapshotId?: string;
|
|
179
|
+
generatedAt?: string;
|
|
180
|
+
siteCount?: number;
|
|
181
|
+
sites: VpnSiteInstanceSummary[];
|
|
182
|
+
pageVariants?: string[];
|
|
183
|
+
honesty?: string[];
|
|
184
|
+
};
|
|
185
|
+
export type AttackCasePacketPlanes = {
|
|
186
|
+
policy?: string;
|
|
187
|
+
observation?: string;
|
|
188
|
+
reachability?: string;
|
|
189
|
+
};
|
|
190
|
+
export type AttackCasePacket = {
|
|
191
|
+
schemaVersion?: string;
|
|
192
|
+
caseId: string;
|
|
193
|
+
planes?: AttackCasePacketPlanes;
|
|
194
|
+
summary?: Record<string, unknown>;
|
|
195
|
+
bucketCounts?: Record<string, number>;
|
|
196
|
+
modeledCandidate?: Record<string, unknown>;
|
|
197
|
+
packetRef?: string;
|
|
198
|
+
honesty?: string[];
|
|
199
|
+
[key: string]: unknown;
|
|
200
|
+
};
|
|
201
|
+
export type AttackCasePacketsIndex = {
|
|
202
|
+
schemaVersion?: string;
|
|
203
|
+
snapshotSetId?: string;
|
|
204
|
+
analysisSnapshotId?: string;
|
|
205
|
+
generatedAt?: string;
|
|
206
|
+
caseCount?: number;
|
|
207
|
+
cases: Array<{
|
|
208
|
+
caseId: string;
|
|
209
|
+
recordRef?: string;
|
|
210
|
+
}>;
|
|
211
|
+
pageVariants?: string[];
|
|
212
|
+
honesty?: string[];
|
|
213
|
+
};
|
|
214
|
+
/** Optional reverse links from object-security-context. */
|
|
215
|
+
export type EntrySurfaceLink = {
|
|
216
|
+
surfaceId?: string;
|
|
217
|
+
siteId?: string;
|
|
218
|
+
relation?: string;
|
|
219
|
+
epistemic?: EpistemicLabel;
|
|
220
|
+
recordRefs?: string[];
|
|
221
|
+
[key: string]: unknown;
|
|
222
|
+
};
|
|
223
|
+
export type ObjectSecurityContextJoin = {
|
|
224
|
+
snapshotSetId?: string;
|
|
225
|
+
liveGenerationId?: string | null;
|
|
226
|
+
objectId: string;
|
|
227
|
+
objectType?: string;
|
|
228
|
+
context: unknown;
|
|
229
|
+
classification: unknown | null;
|
|
230
|
+
preAiContext: unknown | null;
|
|
231
|
+
liveOverlay: unknown | null;
|
|
232
|
+
retrieval?: unknown;
|
|
233
|
+
liveAuthority?: unknown;
|
|
234
|
+
};
|
|
235
|
+
export type MapStoreErrorCode = 'memorix-unavailable' | 'incomplete-publication' | 'mixed-generation' | 'live-unavailable' | 'http-error' | 'config-error';
|
|
236
|
+
export declare class MapStoreError extends Error {
|
|
237
|
+
readonly code: MapStoreErrorCode;
|
|
238
|
+
readonly status: number;
|
|
239
|
+
readonly retryAfterMs?: number;
|
|
240
|
+
readonly body?: unknown;
|
|
241
|
+
constructor(message: string, opts: {
|
|
242
|
+
code: MapStoreErrorCode;
|
|
243
|
+
status: number;
|
|
244
|
+
retryAfterMs?: number;
|
|
245
|
+
body?: unknown;
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
//# sourceMappingURL=types.d.ts.map
|