evolution-api/src/whatsapp/models/websocket.model.ts
2023-08-02 16:11:19 -03:00

19 lines
509 B
TypeScript

import { Schema } from 'mongoose';
import { dbserver } from '../../libs/db.connect';
export class WebsocketRaw {
_id?: string;
enabled?: boolean;
events?: string[];
}
const websocketSchema = new Schema<WebsocketRaw>({
_id: { type: String, _id: true },
enabled: { type: Boolean, required: true },
events: { type: [String], required: true },
});
export const WebsocketModel = dbserver?.model(WebsocketRaw.name, websocketSchema, 'websocket');
export type IWebsocketModel = typeof WebsocketModel;