diff --git a/src/api/auth.controller.ts b/src/api/auth.controller.ts index bbe82dbf..ac8a68b0 100644 --- a/src/api/auth.controller.ts +++ b/src/api/auth.controller.ts @@ -1,14 +1,14 @@ import { Body, Controller, Get, Post, Res } from '@nestjs/common'; +import { UnprocessableEntityException } from '@nestjs/common/exceptions/unprocessable-entity.exception'; import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger'; +import { Response } from 'express'; +import { Readable } from 'stream'; import { SessionManager } from '../core/abc/manager.abc'; import { WhatsappSession } from '../core/abc/session.abc'; import { OTPRequest, RequestCodeRequest } from '../structures/auth.dto'; -import { SessionApiParam, SessionParam } from './helpers'; import { WAHASessionStatus } from '../structures/enums.dto'; -import { UnprocessableEntityException } from '@nestjs/common/exceptions/unprocessable-entity.exception'; -import { Readable } from 'stream'; -import { Response } from 'express'; +import { SessionApiParam, SessionParam } from './helpers'; @ApiSecurity('api_key') @Controller('api/:session/auth') diff --git a/src/api/chats.controller.ts b/src/api/chats.controller.ts index 3ba3fb40..0670cfa2 100644 --- a/src/api/chats.controller.ts +++ b/src/api/chats.controller.ts @@ -3,9 +3,9 @@ import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger'; import { SessionManager } from '../core/abc/manager.abc'; import { WhatsappSession } from '../core/abc/session.abc'; -import { SessionApiParam, SessionParam } from './helpers'; -import { GetChatMessagesQuery } from '../structures/chats.dto'; import { parseBool } from '../helpers'; +import { GetChatMessagesQuery } from '../structures/chats.dto'; +import { SessionApiParam, SessionParam } from './helpers'; @ApiSecurity('api_key') @Controller('api/:session/chats') diff --git a/src/api/presence.controller.ts b/src/api/presence.controller.ts index 24de1294..e5722e77 100644 --- a/src/api/presence.controller.ts +++ b/src/api/presence.controller.ts @@ -10,12 +10,12 @@ import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger'; import { SessionManager } from '../core/abc/manager.abc'; import { WhatsappSession } from '../core/abc/session.abc'; +import { WAHAPresenceStatus } from '../structures/enums.dto'; import { WAHAChatPresences, WAHASessionPresence, } from '../structures/presence.dto'; import { SessionApiParam, SessionParam } from './helpers'; -import { WAHAPresenceStatus } from '../structures/enums.dto'; @ApiSecurity('api_key') @Controller('api/:session/presence') diff --git a/src/api/status.controller.ts b/src/api/status.controller.ts index fc95c861..596ec4bb 100644 --- a/src/api/status.controller.ts +++ b/src/api/status.controller.ts @@ -11,13 +11,13 @@ import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger'; import { SessionManager } from '../core/abc/manager.abc'; import { WhatsappSession } from '../core/abc/session.abc'; -import { SessionApiParam, SessionParam } from './helpers'; import { ImageStatus, TextStatus, VideoStatus, VoiceStatus, } from '../structures/status.dto'; +import { SessionApiParam, SessionParam } from './helpers'; @ApiSecurity('api_key') @Controller('api/:session/status') diff --git a/src/core/app.module.core.ts b/src/core/app.module.core.ts index ba6b0597..e4b6eb50 100644 --- a/src/core/app.module.core.ts +++ b/src/core/app.module.core.ts @@ -3,6 +3,8 @@ import { ConfigModule } from '@nestjs/config'; import { PassportModule } from '@nestjs/passport'; import { ServeStaticModule } from '@nestjs/serve-static'; +import { AuthController } from '../api/auth.controller'; +import { ChatsController } from '../api/chats.controller'; import { ChattingController } from '../api/chatting.controller'; import { ContactsController } from '../api/contacts.controller'; import { GroupsController } from '../api/groups.controller'; @@ -12,13 +14,11 @@ import { SessionController, SessionsController, } from '../api/sessions.controller'; +import { StatusController } from '../api/status.controller'; import { VersionController } from '../api/version.controller'; import { WhatsappConfigService } from '../config.service'; import { SessionManager } from './abc/manager.abc'; import { SessionManagerCore } from './manager.core'; -import { AuthController } from '../api/auth.controller'; -import { ChatsController } from '../api/chats.controller'; -import { StatusController } from '../api/status.controller'; export const IMPORTS = [ ConfigModule.forRoot({ diff --git a/src/core/media.core.ts b/src/core/media.core.ts index 6c8c91bb..c6f5dbbc 100644 --- a/src/core/media.core.ts +++ b/src/core/media.core.ts @@ -1,11 +1,12 @@ +import * as process from 'process'; + +import { WAMedia } from '../structures/responses.dto'; import { IEngineMediaProcessor, MediaManager, MediaStorage, } from './abc/media.abc'; import { DOCS_URL } from './exceptions'; -import { WAMedia } from '../structures/responses.dto'; -import * as process from 'process'; export class MediaStorageCore implements MediaStorage { async save( diff --git a/src/core/session.noweb.core.ts b/src/core/session.noweb.core.ts index 9f3b50d1..2a58dd1b 100644 --- a/src/core/session.noweb.core.ts +++ b/src/core/session.noweb.core.ts @@ -13,6 +13,7 @@ import makeWASocket, { WAMessageKey, } from '@adiwajshing/baileys'; import { UnprocessableEntityException } from '@nestjs/common'; +import * as Buffer from 'buffer'; import * as fs from 'fs/promises'; import { Agent } from 'https'; import * as lodash from 'lodash'; @@ -73,7 +74,6 @@ import { } from './exceptions'; import { createAgentProxy } from './helpers.proxy'; import { QR } from './QR'; -import * as Buffer from 'buffer'; // eslint-disable-next-line @typescript-eslint/no-var-requires const QRCode = require('qrcode'); diff --git a/src/core/session.venom.core.ts b/src/core/session.venom.core.ts index 9f6c2615..7bbbdc79 100644 --- a/src/core/session.venom.core.ts +++ b/src/core/session.venom.core.ts @@ -1,4 +1,5 @@ import { UnprocessableEntityException } from '@nestjs/common/exceptions/unprocessable-entity.exception'; +import * as Buffer from 'buffer'; import { create, CreateConfig, Message, Whatsapp } from 'venom-bot'; import { @@ -25,7 +26,6 @@ import { IEngineMediaProcessor } from './abc/media.abc'; import { WAHAInternalEvent, WhatsappSession } from './abc/session.abc'; import { NotImplementedByEngineError } from './exceptions'; import { QR } from './QR'; -import * as Buffer from 'buffer'; export class WhatsappSessionVenomCore extends WhatsappSession { engine = WAHAEngine.VENOM; diff --git a/src/core/swagger.module.core.ts b/src/core/swagger.module.core.ts index 6a4ad797..dd97b085 100644 --- a/src/core/swagger.module.core.ts +++ b/src/core/swagger.module.core.ts @@ -1,9 +1,9 @@ import { INestApplication } from '@nestjs/common'; import { DocumentBuilder, OpenAPIObject, SwaggerModule } from '@nestjs/swagger'; +import { DECORATORS } from '@nestjs/swagger/dist/constants'; import { WhatsappConfigService } from '../config.service'; import { VERSION } from '../version'; -import { DECORATORS } from '@nestjs/swagger/dist/constants'; export class SwaggerModuleCore { configure(app: INestApplication, webhooks: any[]) { diff --git a/src/main.ts b/src/main.ts index afc6a1c6..173e94e3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -5,9 +5,9 @@ import { AllExceptionsFilter } from './api/exception.filter'; import { WhatsappConfigService } from './config.service'; import { AppModuleCore } from './core/app.module.core'; import { SwaggerModuleCore } from './core/swagger.module.core'; -import { getWAHAVersion, VERSION, WAHAVersion } from './version'; -import { WAHA_WEBHOOKS } from './structures/webhooks.dto'; import { getLogLevels } from './helpers'; +import { WAHA_WEBHOOKS } from './structures/webhooks.dto'; +import { getWAHAVersion, VERSION, WAHAVersion } from './version'; async function loadModules(): Promise< [typeof AppModuleCore, typeof SwaggerModuleCore] diff --git a/src/structures/sessions.dto.ts b/src/structures/sessions.dto.ts index 505b6898..1ed1a2e8 100644 --- a/src/structures/sessions.dto.ts +++ b/src/structures/sessions.dto.ts @@ -1,8 +1,8 @@ import { ApiProperty } from '@nestjs/swagger'; import { WAHASessionStatus } from './enums.dto'; -import { WebhookConfig } from './webhooks.config.dto'; import { ChatIdProperty } from './properties.dto'; +import { WebhookConfig } from './webhooks.config.dto'; /** * Queries diff --git a/src/structures/status.dto.ts b/src/structures/status.dto.ts index fb66e9b6..8fd2a705 100644 --- a/src/structures/status.dto.ts +++ b/src/structures/status.dto.ts @@ -1,4 +1,5 @@ import { ApiExtraModels, ApiProperty, getSchemaPath } from '@nestjs/swagger'; + import { BinaryFile, RemoteFile, diff --git a/src/structures/webhooks.dto.ts b/src/structures/webhooks.dto.ts index 361b2f3c..a44e3c90 100644 --- a/src/structures/webhooks.dto.ts +++ b/src/structures/webhooks.dto.ts @@ -1,17 +1,17 @@ import { ApiProperty } from '@nestjs/swagger'; +import { MessageDestination } from './chatting.dto'; import { WAHAEngine, WAHAEvents, WAHASessionStatus, WAMessageAck, } from './enums.dto'; -import { WAMessage } from './responses.dto'; -import { MessageDestination } from './chatting.dto'; -import { ChatIdProperty, MessageIdProperty } from './properties.dto'; -import { WAHAChatPresences } from './presence.dto'; -import { MeInfo } from './sessions.dto'; import { WAHAEnvironment } from './environment.dto'; +import { WAHAChatPresences } from './presence.dto'; +import { ChatIdProperty, MessageIdProperty } from './properties.dto'; +import { WAMessage } from './responses.dto'; +import { MeInfo } from './sessions.dto'; export class WAMessageAckBody { @MessageIdProperty()