Temporal Utils by Ian Macalinao
    Preparing search index...

    Variable temporalJsonSchemaInterceptorConst

    temporalJsonSchemaInterceptor: TemporalJsonSchemaInterceptor = ...

    Makes oRPC's ZodToJsonSchemaConverter honor a temporal-zod validator's full JSON Schema metadata.

    oRPC's interceptors are onion-middleware around every node's conversion: an interceptor may short-circuit by returning its own [required, jsonSchema] instead of calling next(), fully replacing the structural conversion (so no leftover anyOf from the underlying z.union). For a schema in temporalRegistry we return its registered JSON Schema directly, so zInstant{ type: "string", format: "date-time", pattern, … }. This is general over every Temporal type (zPlainDatedate, zDurationduration, …).

    The lookup is scoped to temporal-zod's own registry rather than z.globalRegistry. The global registry is shared with the whole application, so matching on the shape of its metadata would also short-circuit a consumer's own .meta({ type: "string", format: "email" }) — replacing its structural conversion and silently dropping the constraints oRPC derives from the schema's checks. Every other schema, annotated or not, falls through to next() untouched, leaving oRPC's $ref dedup and example rendering alone.

    new ZodToJsonSchemaConverter({
    interceptors: [temporalJsonSchemaInterceptor],
    });