@zarpyon/support-core
v0.0.1
Published
Canonical Support contracts compatible with Rust and WASM; no runtime logic.
Readme
@zarpyon/support-core
Proprietary Zarpyon public types. See LICENSE. No runtime dependencies or business
logic, DOM, network APIs or validators. Import contracts with import type.
Includes ticket create/receipt/summary/detail/message models, enums, safe error shape, UnixSeconds, structured WASM operations/results and existing scalar/widget interfaces. These are camel-case public models, not Backend snake-case envelopes.
Creation has a closed category union; response enums additionally allow unknown. Optional input null is accepted and normalized by Rust. Decoded output optionals are absent rather than null. UnixSeconds is a number alias: Rust enforces finite, nonnegative bounds and fractional epoch seconds. Error strings still require Rust SDK sanitization; types alone do not protect secret values.
TypeScript's structural typing is not an exact-object validator: excess-property checks help literal callers, but runtime strictness, numeric bounds and future response normalization remain Rust responsibilities. Do not cast untrusted JSON to these interfaces and treat it as validated.
SupportOperation describes the low-level WASM dispatch input; SupportOperationResult maps each operation to its decoded result. Generated wasm-bindgen functions remain broadly typed until an ergonomic facade wraps them. The existing SupportMessageRequest is a local widget preparation envelope, not the structured WASM operation format.
Build from repository root with npm run build. npm test runs a clean packed-package consumer check using every canonical JSON fixture; Rust tests round-trip the same fixtures. Compile checks use ES2022 without DOM libraries and include negative cases.
