import { useEffect, useState } from 'react'; const SERVICE = 'http://localhost:3200'; const APP_ID = 'portal-demo'; interface RawEvent { id: string; channelType: string; externalEventId?: string | null; signatureStatus: string; status: string; interactionId?: string | null; } interface Command { id: string; channelType: string; target: string; status: string; providerRef?: string | null; attempts?: Array<{ id: string; status: string }>; } async function devToken(userId: string): Promise { const r = await fetch(`${SERVICE}/v1/dev/token`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ appId: APP_ID, userId, name: userId }), }); if (!r.ok) throw new Error(`devToken ${r.status} (service running with IIOS_DEV_TOKENS=1?)`); return ((await r.json()) as { token: string }).token; } async function api(token: string, path: string, method = 'GET', body?: unknown): Promise { const r = await fetch(`${SERVICE}${path}`, { method, headers: { 'content-type': 'application/json', authorization: `Bearer ${token}` }, body: body ? JSON.stringify(body) : undefined, }); return (await r.json()) as T; } export function App() { const [token, setToken] = useState(null); const [inbound, setInbound] = useState([]); const [outbound, setOutbound] = useState([]); useEffect(() => { void devToken('inspector').then(setToken); }, []); useEffect(() => { if (!token) return; const load = async () => { setInbound(await api(token, '/v1/adapters/inbound')); setOutbound(await api(token, '/v1/adapters/outbound')); }; void load(); const t = setInterval(() => void load(), 2000); return () => clearInterval(t); }, [token]); if (!token) return
loading…
; const cell: React.CSSProperties = { padding: '4px 8px', borderBottom: '1px solid #eee' }; return (

IIOS P5 — Adapter Inspector

All simulated — no real provider is contacted.

Inbound raw events ({inbound.length})

{inbound.map((e) => (
{e.channelType} · sig:{e.signatureStatus} · {e.status} {e.interactionId ? ` · → ${e.interactionId.slice(0, 8)}` : ''}
))}

Outbound commands ({outbound.length})

{outbound.map((c) => (
{c.channelType} → {c.target} · {c.status} {c.providerRef ? ` · ${c.providerRef}` : ''} · attempts:{c.attempts?.length ?? 0}
))}
); }