17 lines
362 B
TypeScript
17 lines
362 B
TypeScript
import { z, type ZodType } from 'zod';
|
|
|
|
const createListResultSchema = <T extends ZodType>(schema: T) =>
|
|
z.object({
|
|
items: z.array(schema),
|
|
});
|
|
|
|
const queryDSLSchema = z
|
|
.string()
|
|
.describe('Query DSL based filter')
|
|
.meta({
|
|
id: 'QueryDSLString',
|
|
examples: ["metadata.foo = 'bar'"],
|
|
});
|
|
|
|
export { createListResultSchema, queryDSLSchema };
|