mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-06 23:44:36 +00:00
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.
11 lines
338 B
TypeScript
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()) } },
|
|
},
|
|
});
|