| 1 | import { body, param } from "express-validator"; |
| 2 | |
| 3 | export const getVideoInfoValidation = [ |
| 4 | body("url") |
| 5 | .notEmpty() |
| 6 | .withMessage("URL is required") |
| 7 | .isURL() |
| 8 | .withMessage("Please provide a valid URL"), |
| 9 | ]; |
| 10 | |
| 11 | export const downloadAudioValidation = [ |
| 12 | body("url") |
| 13 | .notEmpty() |
| 14 | .withMessage("URL is required") |
| 15 | .isURL() |
| 16 | .withMessage("Please provide a valid URL"), |
| 17 | ]; |
| 18 | |
| 19 | export const transcribeVideoValidation = [ |
| 20 | body("url") |
| 21 | .notEmpty() |
| 22 | .withMessage("URL is required") |
| 23 | .isURL() |
| 24 | .withMessage("Please provide a valid URL"), |
| 25 | ]; |
| 26 | |
| 27 | export const getTranscriptionStatusValidation = [ |
| 28 | param("jobId") |
| 29 | .notEmpty() |
| 30 | .withMessage("Job ID is required") |
| 31 | .isString() |
| 32 | .withMessage("Job ID must be a string"), |
| 33 | ]; |
| 34 | |
| 35 | export const getVideoByIdValidation = [ |
| 36 | param("id") |
| 37 | .notEmpty() |
| 38 | .withMessage("Video ID is required") |
| 39 | .isString() |
| 40 | .withMessage("Video ID must be a string"), |
| 41 | ]; |
| 42 | |
| 43 | export const cancelJobValidation = [ |
| 44 | param("jobId") |
| 45 | .notEmpty() |
| 46 | .withMessage("Job ID is required") |
| 47 | .isString() |
| 48 | .withMessage("Job ID must be a string"), |
| 49 | ]; |