/** * DEC-098 — SysML v2 interop S2 (spec: docs/sysml-interop.md §7, DEC-081). The * I/O adapter: fetch a referenced element from the SysML v2 API & Services and * canonical-hash it for content-integrity (trust level (b), §4). Pure ref types * stay in core (S1); all I/O lives here. The verify path + CLI are S3. * * Endpoint follows the OMG SysML v2 API & Services REST/HTTP PSM: * GET {apiBase}/projects/{project}/commits/{commit}/elements/{element} * * The HTTP client is injectable (`fetchImpl`) so the adapter is unit-testable * against a mock API with no network. API credentials are held out-of-band and * passed per call (`auth`); h2a never embeds them in envelopes (§6). */ import { type H2ASysmlRef } from "@sentropic/h2a"; /** Minimal subset of the Fetch `Response` the adapter needs (global `fetch` satisfies it). */ export interface SysmlFetchResponse { readonly ok: boolean; readonly status: number; json(): Promise; } export type SysmlFetchImpl = (url: string, init?: { headers?: Record; }) => Promise; export interface ResolveSysmlOptions { /** Repository base URL; falls back to `ref.apiBase`. */ readonly apiBase?: string; /** Bearer token for the SysML API (held out-of-band, never in an envelope). */ readonly auth?: string; /** Injected HTTP client; defaults to global `fetch`. */ readonly fetchImpl?: SysmlFetchImpl; } /** * Fetch the referenced element at its immutable commit. Requires `ref.element` * (whole-project resolution — `element` omitted — is a later slice; default * documented in docs/loop-decisions.md). Throws on a non-OK HTTP status. */ export declare function resolveSysmlElement(ref: H2ASysmlRef, options?: ResolveSysmlOptions): Promise; /** * Canonical hash of a fetched element, for content-integrity (trust level (b)). * Reuses the core canonical hashing (DEC-035) so the value is comparable to a * `ref.elementHash` embedded at sign time. */ export declare function hashSysmlElement(element: unknown): string; //# sourceMappingURL=client.d.ts.map