Spaces:
Runtime error
Runtime error
| import { ApiExtraModels, ApiProperty, getSchemaPath } from '@nestjs/swagger'; | |
| import { ConvertApiProperty } from '@waha/structures/properties.dto'; | |
| import { | |
| BinaryFile, | |
| RemoteFile, | |
| VideoBinaryFile, | |
| VideoRemoteFile, | |
| VoiceBinaryFile, | |
| VoiceRemoteFile, | |
| } from './files.dto'; | |
| export const BROADCAST_ID = 'status@broadcast'; | |
| const ContactsProperty = ApiProperty({ | |
| description: 'Contact list to send the status to.', | |
| example: null, | |
| required: false, | |
| }); | |
| export class StatusRequest { | |
| ({ | |
| description: 'Pre-generated status message id', | |
| example: 'BBBBBBBBBBBBBBBBB', | |
| default: null, | |
| required: false, | |
| }) | |
| id?: string; | |
| contacts?: string[]; | |
| } | |
| export class TextStatus extends StatusRequest { | |
| text: string = 'Have a look! https://github.com/'; | |
| backgroundColor: string = '#38b42f'; | |
| font: number = 0; | |
| linkPreview?: boolean = true; | |
| linkPreviewHighQuality?: boolean = false; | |
| } | |
| (RemoteFile, BinaryFile) | |
| export class ImageStatus extends StatusRequest { | |
| ({ | |
| oneOf: [ | |
| { $ref: getSchemaPath(RemoteFile) }, | |
| { $ref: getSchemaPath(BinaryFile) }, | |
| ], | |
| }) | |
| file: RemoteFile | BinaryFile; | |
| caption?: string; | |
| } | |
| (VoiceRemoteFile, VoiceBinaryFile) | |
| export class VoiceStatus extends StatusRequest { | |
| ({ | |
| oneOf: [ | |
| { $ref: getSchemaPath(VoiceRemoteFile) }, | |
| { $ref: getSchemaPath(VoiceBinaryFile) }, | |
| ], | |
| }) | |
| file: VoiceRemoteFile | VoiceBinaryFile; | |
| backgroundColor: string = '#38b42f'; | |
| () | |
| convert: boolean; | |
| } | |
| (VideoRemoteFile, VideoBinaryFile) | |
| export class VideoStatus extends StatusRequest { | |
| ({ | |
| oneOf: [ | |
| { $ref: getSchemaPath(VideoRemoteFile) }, | |
| { $ref: getSchemaPath(VideoBinaryFile) }, | |
| ], | |
| }) | |
| file: VideoRemoteFile | VideoBinaryFile; | |
| caption?: string; | |
| () | |
| convert: boolean; | |
| } | |
| export class DeleteStatusRequest extends StatusRequest { | |
| ({ | |
| description: 'Status message id to delete', | |
| example: 'AAAAAAAAAAAAAAAAA', | |
| }) | |
| id: string; | |
| contacts?: string[]; | |
| } | |