import { z } from 'zod'; export const lockResult = z.object({ id: z.string(), expiresAt: z.number().int(), }); export const acquireInterruptLockResponse = z .object({ requestId: z.string(), lock: lockResult.optional(), error: z.object({ message: z.string() }).optional(), }) .refine( (data) => !!data.lock || !!data.error, 'One of lock or error must be provided.' ); export const renewInterruptLockResponse = z .object({ requestId: z.string(), lock: lockResult.optional(), error: z.object({ message: z.string() }).optional(), }) .refine( (data) => !!data.lock || !!data.error, 'One of lock or error must be provided.' ); export const releaseInterruptLockResponse = z .object({ requestId: z.string(), lock: lockResult.optional(), error: z.object({ message: z.string() }).optional(), }) .refine( (data) => !!data.lock || !!data.error, 'One of lock or error must be provided.' );