mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-22 12:06:54 -06:00
22 lines
632 B
TypeScript
22 lines
632 B
TypeScript
import { Schema } from 'mongoose';
|
|
import { dbserver } from '../../db/db.connect';
|
|
|
|
export class WebhookRaw {
|
|
_id?: string;
|
|
url?: string;
|
|
enabled?: boolean;
|
|
events?: string[];
|
|
webhook_by_events?: boolean;
|
|
}
|
|
|
|
const webhookSchema = new Schema<WebhookRaw>({
|
|
_id: { type: String, _id: true },
|
|
url: { type: String, required: true },
|
|
enabled: { type: Boolean, required: true },
|
|
events: { type: [String], required: true },
|
|
webhook_by_events: { type: Boolean, required: true },
|
|
});
|
|
|
|
export const WebhookModel = dbserver?.model(WebhookRaw.name, webhookSchema, 'webhook');
|
|
export type IWebhookModel = typeof WebhookModel;
|