mirror of
https://github.com/muerwre/vk-tg-bot.git
synced 2025-04-25 15:06:41 +07:00
added webhook parser
This commit is contained in:
parent
9433cc327a
commit
87da9078fe
7 changed files with 32 additions and 20 deletions
|
@ -1,15 +1,21 @@
|
|||
import { object } from "yup";
|
||||
import { boolean, object, string } from "yup";
|
||||
import { httpConfigSchema } from "../api/http/validation";
|
||||
import { Config } from "./types";
|
||||
import { vkConfigSchema } from "../service/vk/validation";
|
||||
import { telegramConfigSchema } from "../service/telegram/validation";
|
||||
import { loggerConfigSchema } from "../service/logger/config";
|
||||
|
||||
const webhookValidationSchema = object().optional().shape({
|
||||
url: string(),
|
||||
enabled: boolean(),
|
||||
});
|
||||
|
||||
const configSchema = object<Config>().required().shape({
|
||||
http: httpConfigSchema,
|
||||
vk: vkConfigSchema,
|
||||
telegram: telegramConfigSchema,
|
||||
logger: loggerConfigSchema,
|
||||
webhook: webhookValidationSchema,
|
||||
});
|
||||
|
||||
export const validateConfig = (config: Config) =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue