@openmerge/sdk
v0.2.0
Published
Authoring SDK for OpenMerge models, mappings, overlays, expressions, and WASM functions
Readme
@openmerge/sdk
Typed authoring SDK for OpenMerge model, mapping, overlay, expression, and sandboxed-function IR.
JavaScript to immutable WASM
Install Javy v9 and compile a synchronous pure transform:
import { compileJavaScriptFunction } from "@openmerge/sdk"
const registration = compileJavaScriptFunction({
workspaceId: "ws_123",
id: "normalize/trim",
version: 1,
signature: { in: ["string"], out: "string" },
provenance: { author: "human:[email protected]", reason: "CRM normalization" },
transform: (value) => String(value).trim(),
})
await fetch(`${api}/functions?wsid=ws_123`, {
method: "POST",
headers: { Authorization: `Bearer ${key}`, "Content-Type": "application/json" },
body: JSON.stringify({ document: registration.document, bundle_base64: registration.bundleBase64 }),
})Compilation runs without a shell. The SDK rejects oversized or malformed WASM and any imports outside OpenMerge's minimal stdin/stdout WASI capability set. packageWasmFunction supports other compilers while preserving the same immutable registry contract.
