@x12i/map-store-client
v0.1.2
Published
Browser HTTP client for map-store /map-store/v1 (Memorix estate via map-store only)
Readme
@x12i/map-store-client
Browser HTTP client for map-store /map-store/v1. Estate JSON is Memorix behind map-store — call map-store only (never Memorix :5100, Map BFF :9222, or SEAP :7540 from the browser).
Setup
Inject how to resolve the map-store origin once at app startup:
import { configureMapStore, stripMapStoreOrigin } from '@x12i/map-store-client';
const BLOCKED = new Set(['5100', '9222', '7540', '7541']);
configureMapStore({
resolveOrigin: () => {
const raw = (import.meta.env.VITE_MAP_STORE_URL as string | undefined)?.trim() ?? '';
if (!raw) return ''; // same-origin (dev proxy)
const origin = stripMapStoreOrigin(raw);
try {
const u = new URL(origin.includes('://') ? origin : `http://${origin}`);
if (BLOCKED.has(u.port)) {
throw new Error(`Map-store URL must not use port ${u.port}`);
}
} catch (err) {
if (err instanceof Error && err.message.includes('must not use')) throw err;
}
return origin;
},
});Usage
import { fetchBootstrap, walkWorkingPages, mapFetch } from '@x12i/map-store-client';
import { asRecord } from '@x12i/map-store-client/util';Subpath exports: /util, /types, /errors, /products, /bagCatalog, /attackSurfaces, /packets.
