diff --git a/.eslintrc.js b/.eslintrc.js index 7e130b40..8735bc0e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,27 +1,32 @@ module.exports = { - parser: '@typescript-eslint/parser', - parserOptions: { - project: 'tsconfig.json', - sourceType: 'module', - }, - plugins: ['@typescript-eslint/eslint-plugin'], - extends: [ - 'plugin:@typescript-eslint/eslint-recommended', - 'plugin:@typescript-eslint/recommended', - 'prettier', - 'prettier/@typescript-eslint', - ], - root: true, - env: { - node: true, - jest: true, - }, - rules: { - '@typescript-eslint/interface-name-prefix': 'off', - '@typescript-eslint/explicit-function-return-type': 'off', - '@typescript-eslint/explicit-module-boundary-types': 'off', - '@typescript-eslint/no-explicit-any': 'off', - "@typescript-eslint/ban-ts-ignore": "off", - "@typescript-eslint/ban-ts-comment": "off" - }, + parser: "@typescript-eslint/parser", + parserOptions: { + project: "tsconfig.json", + sourceType: "module" + }, + plugins: [ + "@typescript-eslint/eslint-plugin", + "simple-import-sort" + ], + extends: [ + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "prettier", + "prettier/@typescript-eslint" + ], + root: true, + env: { + node: true, + jest: true + }, + rules: { + "simple-import-sort/imports": "error", + "simple-import-sort/exports": "error", + "@typescript-eslint/interface-name-prefix": "off", + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/ban-ts-ignore": "off", + "@typescript-eslint/ban-ts-comment": "off", + } }; diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a012ea37..3244015f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ repos: rev: 'v2.7.1' hooks: - id: prettier - types_or: [javascript, ts] + types_or: [ javascript, ts ] files: | (?x)^( src/.*| diff --git a/package.json b/package.json index f5fdc1b9..ddf6767a 100644 --- a/package.json +++ b/package.json @@ -62,11 +62,6 @@ "@types/jest": "26.0.10", "@types/node": "^18.14.2", "@types/supertest": "^2.0.8", - "@typescript-eslint/eslint-plugin": "3.9.1", - "@typescript-eslint/parser": "3.9.1", - "eslint": "7.7.0", - "eslint-config-prettier": "^6.10.0", - "eslint-plugin-import": "^2.20.1", "jest": "26.4.2", "prettier": "^1.19.1", "supertest": "^4.0.2", @@ -74,7 +69,13 @@ "ts-loader": "^6.2.1", "ts-node": "^10.9.1", "tsconfig-paths": "^4.1.0", - "typescript": "4.7.4" + "typescript": "4.7.4", + "@typescript-eslint/eslint-plugin": "3.9.1", + "@typescript-eslint/parser": "3.9.1", + "eslint": "7.7.0", + "eslint-config-prettier": "^6.10.0", + "eslint-plugin-import": "^2.20.1", + "eslint-plugin-simple-import-sort": "^10.0.0" }, "jest": { "moduleFileExtensions": [ diff --git a/src/api/chatting.controller.ts b/src/api/chatting.controller.ts index a7f8ee64..27a7483d 100644 --- a/src/api/chatting.controller.ts +++ b/src/api/chatting.controller.ts @@ -1,10 +1,11 @@ import { Body, Controller, Get, Post, Put, Query } from '@nestjs/common'; import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger'; + +import { SessionManager } from '../core/abc/manager.abc'; import { ChatRequest, CheckNumberStatusQuery, GetMessageQuery, - GetPresenceQuery, MessageContactVcardRequest, MessageFileRequest, MessageImageRequest, @@ -19,7 +20,6 @@ import { SendSeenRequest, } from '../structures/chatting.dto'; import { WAMessage, WANumberExistResult } from '../structures/responses.dto'; -import { SessionManager } from '../core/abc/manager.abc'; @ApiSecurity('api_key') @Controller('api') diff --git a/src/api/contacts.controller.ts b/src/api/contacts.controller.ts index ce9c96af..cf72626a 100644 --- a/src/api/contacts.controller.ts +++ b/src/api/contacts.controller.ts @@ -1,9 +1,10 @@ import { Body, Controller, Get, Post, Query } from '@nestjs/common'; import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger'; + import { SessionManager } from '../core/abc/manager.abc'; -import { ContactQuery, ContactRequest } from '../structures/contacts.dto'; import { SessionQuery } from '../structures/base.dto'; import { CheckNumberStatusQuery } from '../structures/chatting.dto'; +import { ContactQuery, ContactRequest } from '../structures/contacts.dto'; import { WANumberExistResult } from '../structures/responses.dto'; @ApiSecurity('api_key') diff --git a/src/api/exception.filter.ts b/src/api/exception.filter.ts index 209185f5..673fa8b8 100644 --- a/src/api/exception.filter.ts +++ b/src/api/exception.filter.ts @@ -6,6 +6,7 @@ import { HttpStatus, } from '@nestjs/common'; import { Request, Response } from 'express'; + import { VERSION } from '../version'; /** diff --git a/src/api/groups.controller.ts b/src/api/groups.controller.ts index 1a28d56d..70b160ff 100644 --- a/src/api/groups.controller.ts +++ b/src/api/groups.controller.ts @@ -8,14 +8,15 @@ import { Put, } from '@nestjs/common'; import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger'; + import { SessionManager } from '../core/abc/manager.abc'; +import { WhatsappSession } from '../core/abc/session.abc'; import { CreateGroupRequest, DescriptionRequest, ParticipantsRequest, SubjectRequest, } from '../structures/groups.dto'; -import { WhatsappSession } from '../core/abc/session.abc'; import { SessionApiParam, SessionParam } from './helpers'; @ApiSecurity('api_key') diff --git a/src/api/helpers.ts b/src/api/helpers.ts index f3180929..f9cb138b 100644 --- a/src/api/helpers.ts +++ b/src/api/helpers.ts @@ -1,5 +1,6 @@ -import { ApiParam } from '@nestjs/swagger'; import { Injectable, Param, PipeTransform } from '@nestjs/common'; +import { ApiParam } from '@nestjs/swagger'; + import { SessionManager } from '../core/abc/manager.abc'; import { WhatsappSession } from '../core/abc/session.abc'; diff --git a/src/api/presence.controller.ts b/src/api/presence.controller.ts index 042c7a80..f70a5436 100644 --- a/src/api/presence.controller.ts +++ b/src/api/presence.controller.ts @@ -1,9 +1,10 @@ import { Controller, Get, Param, Post } from '@nestjs/common'; 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 { WAHAChatPresences } from '../structures/presence.dto'; +import { SessionApiParam, SessionParam } from './helpers'; @ApiSecurity('api_key') @Controller('api/:session/presence') diff --git a/src/api/screenshot.controller.ts b/src/api/screenshot.controller.ts index 01c32480..c4240639 100644 --- a/src/api/screenshot.controller.ts +++ b/src/api/screenshot.controller.ts @@ -1,7 +1,8 @@ import { Controller, Get, Query, Res } from '@nestjs/common'; import { ApiSecurity, ApiTags } from '@nestjs/swagger'; -import { Readable } from 'stream'; import { Response } from 'express'; +import { Readable } from 'stream'; + import { SessionManager } from '../core/abc/manager.abc'; import { SessionQuery } from '../structures/base.dto'; diff --git a/src/api/sessions.controller.ts b/src/api/sessions.controller.ts index a0f091d9..ae741886 100644 --- a/src/api/sessions.controller.ts +++ b/src/api/sessions.controller.ts @@ -1,15 +1,16 @@ import { Body, Controller, Get, Post, Query } from '@nestjs/common'; +import { UnprocessableEntityException } from '@nestjs/common/exceptions/unprocessable-entity.exception'; import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger'; + +import { SessionManager } from '../core/abc/manager.abc'; +import { parseBool } from '../helpers'; import { - SessionLogoutRequest, + ListSessionsQuery, SessionDTO, + SessionLogoutRequest, SessionStartRequest, SessionStopRequest, - ListSessionsQuery, } from '../structures/sessions.dto'; -import { SessionManager } from '../core/abc/manager.abc'; -import { UnprocessableEntityException } from '@nestjs/common/exceptions/unprocessable-entity.exception'; -import { parseBool } from '../helpers'; @ApiSecurity('api_key') @Controller('api/sessions') diff --git a/src/api/version.controller.ts b/src/api/version.controller.ts index 8b02ec8e..bb39eae5 100644 --- a/src/api/version.controller.ts +++ b/src/api/version.controller.ts @@ -1,5 +1,6 @@ import { Controller, Get } from '@nestjs/common'; import { ApiSecurity, ApiTags } from '@nestjs/swagger'; + import { VERSION } from '../version'; @ApiSecurity('api_key') diff --git a/src/config.service.ts b/src/config.service.ts index efc31102..38982ef1 100644 --- a/src/config.service.ts +++ b/src/config.service.ts @@ -1,7 +1,8 @@ import { Injectable } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; -import { WhatsappEngine } from './structures/enums.dto'; + import { parseBool } from './helpers'; +import { WhatsappEngine } from './structures/enums.dto'; @Injectable() export class WhatsappConfigService { diff --git a/src/core/abc/manager.abc.ts b/src/core/abc/manager.abc.ts index 4f2293db..cf98076a 100644 --- a/src/core/abc/manager.abc.ts +++ b/src/core/abc/manager.abc.ts @@ -1,12 +1,13 @@ import { OnApplicationShutdown } from '@nestjs/common'; + +import { WhatsappEngine } from '../../structures/enums.dto'; import { - SessionLogoutRequest, SessionDTO, + SessionLogoutRequest, SessionStartRequest, SessionStopRequest, } from '../../structures/sessions.dto'; import { WhatsappSession } from './session.abc'; -import { WhatsappEngine } from '../../structures/enums.dto'; import { MediaStorage } from './storage.abc'; import { WebhookConductor } from './webhooks.abc'; diff --git a/src/core/abc/session.abc.ts b/src/core/abc/session.abc.ts index 547fa562..c1f5bc52 100644 --- a/src/core/abc/session.abc.ts +++ b/src/core/abc/session.abc.ts @@ -1,9 +1,8 @@ -import { - WAEvents, - WhatsappEngine, - WhatsappStatus, -} from '../../structures/enums.dto'; import { ConsoleLogger } from '@nestjs/common'; +import { EventEmitter } from 'events'; +import * as fs from 'fs'; +import { MessageId } from 'whatsapp-web.js'; + import { ChatRequest, CheckNumberStatusQuery, @@ -19,20 +18,22 @@ import { MessageTextRequest, MessageVoiceRequest, } from '../../structures/chatting.dto'; -import { LocalSessionStorage, MediaStorage } from './storage.abc'; -import { MessageId } from 'whatsapp-web.js'; import { ContactQuery, ContactRequest } from '../../structures/contacts.dto'; -import { NotImplementedByEngineError } from '../exceptions'; +import { + WAEvents, + WhatsappEngine, + WhatsappStatus, +} from '../../structures/enums.dto'; import { CreateGroupRequest, ParticipantsRequest, } from '../../structures/groups.dto'; -import * as fs from 'fs'; +import { WAHAChatPresences } from '../../structures/presence.dto'; +import { NotImplementedByEngineError } from '../exceptions'; +import { LocalSessionStorage, MediaStorage } from './storage.abc'; const CHROME_PATH = '/usr/bin/google-chrome-stable'; const CHROMIUM_PATH = '/usr/bin/chromium'; -import { EventEmitter } from 'events'; -import { WAHAChatPresences } from '../../structures/presence.dto'; export function getBrowserExecutablePath() { if (fs.existsSync(CHROME_PATH)) { diff --git a/src/core/app.module.core.ts b/src/core/app.module.core.ts index d4b2d82a..94c6c00e 100644 --- a/src/core/app.module.core.ts +++ b/src/core/app.module.core.ts @@ -1,17 +1,18 @@ import { ConsoleLogger, Module } from '@nestjs/common'; -import { ScreenshotController } from '../api/screenshot.controller'; import { ConfigModule } from '@nestjs/config'; -import { WhatsappConfigService } from '../config.service'; +import { PassportModule } from '@nestjs/passport'; import { ServeStaticModule } from '@nestjs/serve-static'; -import { SessionsController } from '../api/sessions.controller'; + import { ChattingController } from '../api/chatting.controller'; import { ContactsController } from '../api/contacts.controller'; -import { VersionController } from '../api/version.controller'; -import { PassportModule } from '@nestjs/passport'; -import { SessionManager } from './abc/manager.abc'; -import { SessionManagerCore } from './manager.core'; import { GroupsController } from '../api/groups.controller'; import { PresenceController } from '../api/presence.controller'; +import { ScreenshotController } from '../api/screenshot.controller'; +import { SessionsController } from '../api/sessions.controller'; +import { VersionController } from '../api/version.controller'; +import { WhatsappConfigService } from '../config.service'; +import { SessionManager } from './abc/manager.abc'; +import { SessionManagerCore } from './manager.core'; export const IMPORTS = [ ConfigModule.forRoot({ diff --git a/src/core/helpers.proxy.ts b/src/core/helpers.proxy.ts index 2b583105..74ffd4f5 100644 --- a/src/core/helpers.proxy.ts +++ b/src/core/helpers.proxy.ts @@ -1,9 +1,10 @@ -import { WhatsappConfigService } from '../config.service'; -import { WhatsappSession, ProxyConfig } from './abc/session.abc'; -import { HttpsProxyAgent } from 'https-proxy-agent'; import { Agent } from 'https'; +import { HttpsProxyAgent } from 'https-proxy-agent'; import { URL } from 'url'; +import { WhatsappConfigService } from '../config.service'; +import { ProxyConfig, WhatsappSession } from './abc/session.abc'; + export function getProxyConfig( config: WhatsappConfigService, sessions: Record, diff --git a/src/core/manager.core.ts b/src/core/manager.core.ts index ce0d4916..0fb4c51a 100644 --- a/src/core/manager.core.ts +++ b/src/core/manager.core.ts @@ -4,6 +4,15 @@ import { NotFoundException, UnprocessableEntityException, } from '@nestjs/common'; + +import { WhatsappConfigService } from '../config.service'; +import { WhatsappEngine, WhatsappStatus } from '../structures/enums.dto'; +import { + SessionDTO, + SessionLogoutRequest, + SessionStartRequest, + SessionStopRequest, +} from '../structures/sessions.dto'; import { SessionManager } from './abc/manager.abc'; import { ProxyConfig, @@ -11,22 +20,14 @@ import { WhatsappSession, WhatsAppSessionConfig, } from './abc/session.abc'; -import { WhatsappEngine, WhatsappStatus } from '../structures/enums.dto'; -import { - SessionLogoutRequest, - SessionDTO, - SessionStartRequest, - SessionStopRequest, -} from '../structures/sessions.dto'; -import { WhatsappConfigService } from '../config.service'; +import { LocalSessionStorage } from './abc/storage.abc'; +import { DOCS_URL } from './exceptions'; +import { getProxyConfig } from './helpers.proxy'; +import { WhatsappSessionNoWebCore } from './session.noweb.core'; import { WhatsappSessionVenomCore } from './session.venom.core'; import { WhatsappSessionWebJSCore } from './session.webjs.core'; -import { DOCS_URL } from './exceptions'; -import { WebhookConductorCore } from './webhooks.core'; import { MediaStorageCore, SessionStorageCore } from './storage.core'; -import { WhatsappSessionNoWebCore } from './session.noweb.core'; -import { LocalSessionStorage } from './abc/storage.abc'; -import { getProxyConfig } from './helpers.proxy'; +import { WebhookConductorCore } from './webhooks.core'; export class OnlyDefaultSessionIsAllowed extends UnprocessableEntityException { constructor() { diff --git a/src/core/session.noweb.core.ts b/src/core/session.noweb.core.ts index 90ef5edd..0d1c0609 100644 --- a/src/core/session.noweb.core.ts +++ b/src/core/session.noweb.core.ts @@ -1,10 +1,3 @@ -import { - SECOND, - WAEvents, - WAHAPresenceStatus, - WhatsappEngine, - WhatsappStatus, -} from '../structures/enums.dto'; import makeWASocket, { DisconnectReason, isJidGroup, @@ -12,13 +5,12 @@ import makeWASocket, { PresenceData, useMultiFileAuthState, } from '@adiwajshing/baileys'; +import { UnprocessableEntityException } from '@nestjs/common'; +import * as fs from 'fs'; +import { Agent } from 'https'; +import * as lodash from 'lodash'; +import { Message } from 'whatsapp-web.js'; -import { - ensureSuffix, - WAHAInternalEvent, - WhatsappSession, -} from './abc/session.abc'; -import { WAMessage, WANumberExistResult } from '../structures/responses.dto'; import { Button, ChatRequest, @@ -36,26 +28,34 @@ import { MessageVoiceRequest, SendSeenRequest, } from '../structures/chatting.dto'; -import { - AvailableInPlusVersion, - NotImplementedByEngineError, -} from './exceptions'; import { ContactQuery, ContactRequest } from '../structures/contacts.dto'; +import { + SECOND, + WAEvents, + WAHAPresenceStatus, + WhatsappEngine, + WhatsappStatus, +} from '../structures/enums.dto'; import { CreateGroupRequest, ParticipantsRequest, } from '../structures/groups.dto'; -import { QR } from './QR'; -import { UnprocessableEntityException } from '@nestjs/common'; -import { Message } from 'whatsapp-web.js'; -import * as fs from 'fs'; -import { Agent } from 'https'; -import { createAgentProxy } from './helpers.proxy'; import { - WAHAPresenceData, WAHAChatPresences, + WAHAPresenceData, } from '../structures/presence.dto'; -import * as lodash from 'lodash'; +import { WAMessage, WANumberExistResult } from '../structures/responses.dto'; +import { + ensureSuffix, + WAHAInternalEvent, + WhatsappSession, +} from './abc/session.abc'; +import { + AvailableInPlusVersion, + NotImplementedByEngineError, +} from './exceptions'; +import { createAgentProxy } from './helpers.proxy'; +import { QR } from './QR'; // 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 7a40a482..045da8b9 100644 --- a/src/core/session.venom.core.ts +++ b/src/core/session.venom.core.ts @@ -1,4 +1,6 @@ -import { WAHAInternalEvent, WhatsappSession } from './abc/session.abc'; +import { UnprocessableEntityException } from '@nestjs/common/exceptions/unprocessable-entity.exception'; +import { create, CreateConfig, Message, Whatsapp } from 'venom-bot'; + import { Button, ChatRequest, @@ -14,15 +16,14 @@ import { MessageTextButtonsRequest, MessageTextRequest, } from '../structures/chatting.dto'; -import { WAMessage, WANumberExistResult } from '../structures/responses.dto'; -import { create, CreateConfig, Message, Whatsapp } from 'venom-bot'; import { WAEvents, WhatsappEngine, WhatsappStatus, } from '../structures/enums.dto'; +import { WAMessage, WANumberExistResult } from '../structures/responses.dto'; +import { WAHAInternalEvent, WhatsappSession } from './abc/session.abc'; import { NotImplementedByEngineError } from './exceptions'; -import { UnprocessableEntityException } from '@nestjs/common/exceptions/unprocessable-entity.exception'; import { QR } from './QR'; export class WhatsappSessionVenomCore extends WhatsappSession { diff --git a/src/core/session.webjs.core.ts b/src/core/session.webjs.core.ts index 25893e1f..5eded69a 100644 --- a/src/core/session.webjs.core.ts +++ b/src/core/session.webjs.core.ts @@ -11,13 +11,7 @@ import { Message, } from 'whatsapp-web.js'; import { Message as MessageInstance } from 'whatsapp-web.js/src/structures'; -import { - WAEvents, - WhatsappEngine, - WhatsappStatus, -} from '../structures/enums.dto'; -import { WAHAInternalEvent, WhatsappSession } from './abc/session.abc'; -import { WAMessage, WANumberExistResult } from '../structures/responses.dto'; + import { Button, ChatRequest, @@ -35,15 +29,22 @@ import { MessageVoiceRequest, SendSeenRequest, } from '../structures/chatting.dto'; -import { - AvailableInPlusVersion, - NotImplementedByEngineError, -} from './exceptions'; import { ContactQuery, ContactRequest } from '../structures/contacts.dto'; +import { + WAEvents, + WhatsappEngine, + WhatsappStatus, +} from '../structures/enums.dto'; import { CreateGroupRequest, ParticipantsRequest, } from '../structures/groups.dto'; +import { WAMessage, WANumberExistResult } from '../structures/responses.dto'; +import { WAHAInternalEvent, WhatsappSession } from './abc/session.abc'; +import { + AvailableInPlusVersion, + NotImplementedByEngineError, +} from './exceptions'; // eslint-disable-next-line @typescript-eslint/no-var-requires const qrcode = require('qrcode-terminal'); diff --git a/src/core/storage.core.ts b/src/core/storage.core.ts index cd70f6bd..b6c964d5 100644 --- a/src/core/storage.core.ts +++ b/src/core/storage.core.ts @@ -1,8 +1,9 @@ -import { DOCS_URL } from './exceptions'; -import { LocalSessionStorage, MediaStorage } from './abc/storage.abc'; -import * as path from 'path'; import * as fs from 'fs'; import * as os from 'os'; +import * as path from 'path'; + +import { LocalSessionStorage, MediaStorage } from './abc/storage.abc'; +import { DOCS_URL } from './exceptions'; export class MediaStorageCore implements MediaStorage { async save( diff --git a/src/core/swagger.module.core.ts b/src/core/swagger.module.core.ts index 7edfe41c..eb78b49e 100644 --- a/src/core/swagger.module.core.ts +++ b/src/core/swagger.module.core.ts @@ -1,7 +1,8 @@ -import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; import { INestApplication } from '@nestjs/common'; -import { VERSION } from '../version'; +import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; + import { WhatsappConfigService } from '../config.service'; +import { VERSION } from '../version'; export class SwaggerModuleCore { configure(app: INestApplication) { diff --git a/src/core/webhooks.core.ts b/src/core/webhooks.core.ts index ed754e88..a62b0da3 100644 --- a/src/core/webhooks.core.ts +++ b/src/core/webhooks.core.ts @@ -1,9 +1,10 @@ -import { WAHAInternalEvent, WhatsappSession } from './abc/session.abc'; import { ConsoleLogger } from '@nestjs/common'; + import { WAEvents } from '../structures/enums.dto'; import { WAWebhook } from '../structures/responses.dto'; -import { NotImplementedByEngineError } from './exceptions'; +import { WhatsappSession } from './abc/session.abc'; import { WebhookConductor } from './abc/webhooks.abc'; +import { NotImplementedByEngineError } from './exceptions'; import request = require('request'); export class WebhookConductorCore implements WebhookConductor { diff --git a/src/main.ts b/src/main.ts index f70b2b40..5a79a66b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,10 +1,11 @@ import { NestFactory } from '@nestjs/core'; -import { WhatsappConfigService } from './config.service'; +import { json, urlencoded } from 'express'; + import { AllExceptionsFilter } from './api/exception.filter'; -import { getWAHAVersion, VERSION, WAHAVersion } from './version'; +import { WhatsappConfigService } from './config.service'; import { AppModuleCore } from './core/app.module.core'; import { SwaggerModuleCore } from './core/swagger.module.core'; -import { json, urlencoded } from 'express'; +import { getWAHAVersion, WAHAVersion } from './version'; async function loadModules(): Promise< [typeof AppModuleCore, typeof SwaggerModuleCore] diff --git a/src/structures/chatting.dto.ts b/src/structures/chatting.dto.ts index 7645d609..e2a351c1 100644 --- a/src/structures/chatting.dto.ts +++ b/src/structures/chatting.dto.ts @@ -1,5 +1,6 @@ -import { IsNotEmpty, IsString, IsOptional, IsNumber } from 'class-validator'; import { ApiExtraModels, ApiProperty, getSchemaPath } from '@nestjs/swagger'; +import { IsNumber, IsString } from 'class-validator'; + import { SessionBaseRequest, SessionQuery } from './base.dto'; /** diff --git a/src/structures/contacts.dto.ts b/src/structures/contacts.dto.ts index a1722ce3..ba1114f1 100644 --- a/src/structures/contacts.dto.ts +++ b/src/structures/contacts.dto.ts @@ -1,4 +1,5 @@ import { IsString } from 'class-validator'; + import { SessionBaseRequest, SessionQuery } from './base.dto'; /** diff --git a/src/structures/presence.dto.ts b/src/structures/presence.dto.ts index a29ecac7..02a80d94 100644 --- a/src/structures/presence.dto.ts +++ b/src/structures/presence.dto.ts @@ -1,4 +1,5 @@ import { ApiProperty } from '@nestjs/swagger'; + import { WAHAPresenceStatus } from './enums.dto'; export class WAHAPresenceData { diff --git a/src/structures/responses.dto.ts b/src/structures/responses.dto.ts index 36ea1afa..3593c680 100644 --- a/src/structures/responses.dto.ts +++ b/src/structures/responses.dto.ts @@ -1,4 +1,5 @@ import { ApiProperty } from '@nestjs/swagger'; + import { WAEvents, WhatsappEngine } from './enums.dto'; export class WANumberExistResult { diff --git a/src/structures/sessions.dto.ts b/src/structures/sessions.dto.ts index 0f615eb2..f997055d 100644 --- a/src/structures/sessions.dto.ts +++ b/src/structures/sessions.dto.ts @@ -1,6 +1,7 @@ -import { WhatsappStatus } from './enums.dto'; import { ApiProperty } from '@nestjs/swagger'; +import { WhatsappStatus } from './enums.dto'; + /** * Queries */ diff --git a/src/version.ts b/src/version.ts index fead2b23..83921432 100644 --- a/src/version.ts +++ b/src/version.ts @@ -3,8 +3,6 @@ import { getBrowserExecutablePath } from './core/abc/session.abc'; // eslint-disable-next-line @typescript-eslint/no-var-requires const fs = require('fs'); -// eslint-disable-next-line @typescript-eslint/no-var-requires -const path = require('path'); export enum WAHAVersion { PLUS = 'PLUS', diff --git a/yarn.lock b/yarn.lock index 3096d0b0..99936bfa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3543,6 +3543,11 @@ eslint-plugin-import@^2.20.1: semver "^6.3.0" tsconfig-paths "^3.14.1" +eslint-plugin-simple-import-sort@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-10.0.0.tgz#cc4ceaa81ba73252427062705b64321946f61351" + integrity sha512-AeTvO9UCMSNzIHRkg8S6c3RPy5YEwKWSQPx3DYghLedo2ZQxowPFLGDN1AZ2evfg6r6mjBSZSLxLFsWSu3acsw== + eslint-scope@5.1.1, eslint-scope@^5.0.0, eslint-scope@^5.1.0, eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"