Skip to content
Français

JsonArtifactOptions

import type { JsonArtifactOptions } from "@elie-laloum/outpost";
  • nameRequired
    string
    Contract name, nonempty and at most 1024 characters. A read requires the same name.
  • versionRequired
    string
    Contract version you choose, nonempty and at most 1024 characters. A read requires the same version, so change it when the format changes.
  • schemaRequired
    StandardValidator<T> | ((input: unknown) => T | Promise<T>)
    Standard Schema validator (Zod, Valibot…) or a function that returns the checked value or throws. Runs before encoding and after decoding; its output is the value stored and returned.
export type JsonArtifactOptions<T> = ArtifactContractOptions & {
  readonly schema: StandardValidator<T> | ((input: unknown) => T | Promise<T>);
};