mirror of
https://github.com/muerwre/vk-tg-bot.git
synced 2025-04-25 15:06:41 +07:00
added vk events handler stub
This commit is contained in:
parent
dfae42c197
commit
3f908da91e
11 changed files with 125 additions and 67 deletions
|
@ -3,14 +3,9 @@ import { VkConfig } from "../service/vk/types";
|
|||
import { HttpConfig } from "../api/http/types";
|
||||
import { LoggerConfig } from "../service/logger/types";
|
||||
|
||||
export interface WebhookConfig {
|
||||
url?: string;
|
||||
enabled?: boolean;
|
||||
}
|
||||
export interface Config extends Record<string, any> {
|
||||
http: HttpConfig;
|
||||
telegram: TelegramConfig;
|
||||
vk: VkConfig;
|
||||
logger?: LoggerConfig;
|
||||
webhook?: WebhookConfig;
|
||||
}
|
||||
|
|
|
@ -5,17 +5,11 @@ 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