pi-mono/packages/chord/test/fixtures/echo.ts
Mario Zechner be039fb316 feat(chord): Chord v1 and v2 on pi-schema, drop TypeBox
Schema helpers are a thin layer over pi-schema's builders with the same JSON,
so fingerprints and stored data are unchanged (proven by schema-switch tests and
a store written by the TypeBox code). Checks through pi-schema; error messages
are pi-schema's; format is an annotation. v1 contracts take any JSON Schema.
map(bytes()) works.
2026-11-01 10:15:02 +00:00

11 lines
338 B
TypeScript

import { num, obj, str } from "@earendil-works/pi-schema";
import { hostNamed, method, remote } from "../../src/index.ts";
export const Echo = remote("t.echo", {
version: 1,
input: obj({}, { open: true }),
host: hostNamed("w1"),
variants: {
main: { methods: { echo: method(str(), str()), pid: method(undefined, num()) } },
},
});