2022-03-30 12:17:55 +00:00
|
|
|
import { z } from "zod";
|
|
|
|
|
|
|
|
// Extracted out as utility function so can be reused
|
|
|
|
// at different endpoints that require this validation.
|
|
|
|
export const baseApiParams = z
|
|
|
|
.object({
|
|
|
|
// since we added apiKey as query param this is required by next-validations helper
|
|
|
|
// for query params to work properly and not fail.
|
2022-04-07 19:55:43 +00:00
|
|
|
apiKey: z.string().optional(),
|
2022-03-30 12:17:55 +00:00
|
|
|
// version required for supporting /v1/ redirect to query in api as *?version=1
|
|
|
|
version: z.string().optional(),
|
|
|
|
})
|
|
|
|
.strict();
|