Spaces:
Runtime error
Runtime error
| import { ChatWootAppConfig } from '@waha/apps/chatwoot/dto/config.dto'; | |
| import { Type } from 'class-transformer'; | |
| import { IsEnum, IsString, ValidateNested } from 'class-validator'; | |
| export type AllowedAppConfig = ChatWootAppConfig; | |
| export enum AppName { | |
| chatwoot = 'chatwoot', | |
| } | |
| export class App<T extends AllowedAppConfig = any> { | |
| () | |
| id: string; | |
| () | |
| session: string; | |
| // App name (aka type) | |
| (AppName) | |
| app: AppName; | |
| () | |
| ((options) => { | |
| if (options && options.object && options.object.app) { | |
| switch (options.object.app) { | |
| case AppName.chatwoot: | |
| return ChatWootAppConfig; | |
| default: | |
| return Object; | |
| } | |
| } | |
| return Object; | |
| }) | |
| config: T; | |
| } | |
| export class ChatWootAppDto extends App<ChatWootAppConfig> { | |
| (() => ChatWootAppConfig) | |
| config: ChatWootAppConfig; | |
| } | |
| export type AppDto = ChatWootAppDto; | |