Spaces:
Runtime error
Runtime error
| import { ApiExtraModels, ApiProperty } from '@nestjs/swagger'; | |
| import { ChatRequest } from '@waha/structures/chatting.dto'; | |
| import { ChatIdProperty } from '@waha/structures/properties.dto'; | |
| import { Type } from 'class-transformer'; | |
| import { | |
| ArrayMinSize, | |
| IsArray, | |
| IsNotEmpty, | |
| IsOptional, | |
| IsString, | |
| ValidateNested, | |
| } from 'class-validator'; | |
| class Row { | |
| ({ example: 'Option 1' }) | |
| () | |
| () | |
| title: string; | |
| ({ example: 'Description of option 1', required: false }) | |
| () | |
| () | |
| description?: string; | |
| ({ example: 'option1' }) | |
| () | |
| () | |
| rowId: string; | |
| } | |
| class Section { | |
| ({ example: 'Menu' }) | |
| () | |
| () | |
| title: string; | |
| ({ each: true }) | |
| (() => Row) | |
| () | |
| (1) | |
| ({ | |
| example: [ | |
| { title: 'Option 1', rowId: 'option1', description: 'First option' }, | |
| { title: 'Option 2', rowId: 'option2', description: 'Second option' }, | |
| ], | |
| }) | |
| rows: Row[]; | |
| } | |
| export class SendListMessage { | |
| ({ example: 'Example List' }) | |
| () | |
| () | |
| title: string; | |
| ({ example: 'Choose one of the options', required: false }) | |
| () | |
| () | |
| description?: string; | |
| ({ example: 'Footer note', required: false }) | |
| () | |
| () | |
| footer?: string; | |
| ({ example: 'Select' }) | |
| () | |
| () | |
| button: string; | |
| ({ each: true }) | |
| (() => Section) | |
| () | |
| (1) | |
| ({ | |
| example: [ | |
| { | |
| title: 'Section 1', | |
| rows: [ | |
| { title: 'Option 1', rowId: 'option1', description: 'Description 1' }, | |
| { title: 'Option 2', rowId: 'option2', description: 'Description 2' }, | |
| ], | |
| }, | |
| ], | |
| }) | |
| sections: Section[]; | |
| } | |
| (SendListMessage) | |
| export class SendListRequest extends ChatRequest { | |
| () | |
| () | |
| chatId: string; | |
| () | |
| (() => SendListMessage) | |
| ({ | |
| type: SendListMessage, | |
| example: { | |
| title: 'Simple Menu', | |
| description: 'Please choose an option', | |
| footer: 'Thank you!', | |
| button: 'Choose', | |
| sections: [ | |
| { | |
| title: 'Main', | |
| rows: [ | |
| { | |
| title: 'Option 1', | |
| rowId: 'option1', | |
| description: null, | |
| }, | |
| { | |
| title: 'Option 2', | |
| rowId: 'option2', | |
| description: null, | |
| }, | |
| { | |
| title: 'Option 3', | |
| rowId: 'option3', | |
| description: null, | |
| }, | |
| ], | |
| }, | |
| ], | |
| }, | |
| }) | |
| message: SendListMessage; | |
| ({ | |
| description: | |
| 'The ID of the message to reply to - false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA', | |
| example: null, | |
| required: false, | |
| }) | |
| () | |
| () | |
| reply_to?: string; | |
| } | |
| export { Row, Section }; | |