Spaces:
Runtime error
Runtime error
| import { ApiProperty } from '@nestjs/swagger'; | |
| import { BooleanString } from '@waha/nestjs/validation/BooleanString'; | |
| import { PaginationParams } from '@waha/structures/pagination.dto'; | |
| import { ChatIdProperty } from '@waha/structures/properties.dto'; | |
| import { Transform } from 'class-transformer'; | |
| import { IsBoolean, IsEnum, IsOptional, IsString } from 'class-validator'; | |
| import { SessionBaseRequest, SessionQuery } from './base.dto'; | |
| /** | |
| * Queries | |
| */ | |
| export class ContactQuery extends SessionQuery { | |
| () | |
| () | |
| contactId: string; | |
| } | |
| export class ContactProfilePictureQuery extends ContactQuery { | |
| (BooleanString) | |
| () | |
| () | |
| ({ | |
| example: false, | |
| required: false, | |
| description: | |
| 'Refresh the picture from the server (24h cache by default). Do not refresh if not needed, you can get rate limit error', | |
| }) | |
| refresh?: boolean = false; | |
| } | |
| enum ContactSortField { | |
| ID = 'id', | |
| NAME = 'name', | |
| } | |
| export class ContactsPaginationParams extends PaginationParams { | |
| ({ | |
| description: 'Sort by field', | |
| enum: ContactSortField, | |
| }) | |
| () | |
| (ContactSortField) | |
| sortBy?: string; | |
| } | |
| /** | |
| * Requests | |
| */ | |
| export class ContactRequest extends SessionBaseRequest { | |
| () | |
| () | |
| contactId: string; | |
| } | |
| export class ContactUpdateBody { | |
| ({ | |
| description: 'Contact First Name', | |
| example: 'John', | |
| required: true, | |
| }) | |
| () | |
| firstName: string = 'John'; | |
| ({ | |
| description: 'Contact Last Name', | |
| example: 'Doe', | |
| required: true, | |
| }) | |
| () | |
| lastName: string = 'Doe'; | |
| } | |