diff --git a/package.json b/package.json index 76b1bcb5..edf291c8 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,6 @@ "@types/jsonwebtoken": "^9.0.5", "@types/mime-types": "^2.1.4", "@types/multer": "^1.4.12", - "@types/node": "^22.7.9", "@types/qrcode": "^1.5.5", "@types/qrcode-terminal": "^0.12.2", "@types/swagger-ui-express": "^4.1.6", diff --git a/src/whatsapp/routers/chat.router.ts b/src/whatsapp/routers/chat.router.ts index 8054cba2..aec14c1f 100644 --- a/src/whatsapp/routers/chat.router.ts +++ b/src/whatsapp/routers/chat.router.ts @@ -75,7 +75,7 @@ export function ChatRouter(chatController: ChatController, ...guards: RequestHan execute: (instance, data) => chatController.whatsappNumber(instance, data), }); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }) .put(routerPath('markMessageAsRead'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -84,7 +84,7 @@ export function ChatRouter(chatController: ChatController, ...guards: RequestHan execute: (instance, data) => chatController.readMessage(instance, data), }); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }) .patch(routerPath('readMessages'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -93,7 +93,7 @@ export function ChatRouter(chatController: ChatController, ...guards: RequestHan execute: (instance, data) => chatController.readMessagesForId(instance, data), }); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }) .patch(routerPath('updatePresence'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -102,7 +102,7 @@ export function ChatRouter(chatController: ChatController, ...guards: RequestHan execute: (instance, data) => chatController.updatePresence(instance, data), }); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }) .put(routerPath('archiveChat'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -111,7 +111,7 @@ export function ChatRouter(chatController: ChatController, ...guards: RequestHan execute: (instance, data) => chatController.archiveChat(instance, data), }); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }) .delete(routerPath('deleteMessageForEveryone'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -120,7 +120,7 @@ export function ChatRouter(chatController: ChatController, ...guards: RequestHan execute: (instance, data) => chatController.deleteMessage(instance, data), }); - return res.status(HttpStatus.CREATED).json(response); + res.status(HttpStatus.CREATED).json(response); }) .delete(routerPath('deleteMessage'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -129,17 +129,17 @@ export function ChatRouter(chatController: ChatController, ...guards: RequestHan execute: (instance, data) => chatController.deleteMessage(instance, data), }); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }) .delete(routerPath('deleteChat'), ...guards, async (req, res) => { const instance = req.params as unknown as InstanceDto; const query = req.query as Record; if (!query?.chatId) { - return res.status(HttpStatus.BAD_REQUEST).json({ message: 'chatId is required' }); + res.status(HttpStatus.BAD_REQUEST).json({ message: 'chatId is required' }); } const response = await chatController.deleteChat(instance, query?.chatId); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }) .post(routerPath('fetchProfilePictureUrl'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -148,7 +148,7 @@ export function ChatRouter(chatController: ChatController, ...guards: RequestHan execute: (instance, data) => chatController.fetchProfilePicture(instance, data), }); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }) .get(routerPath('fetchProfilePictureUrl'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -157,7 +157,7 @@ export function ChatRouter(chatController: ChatController, ...guards: RequestHan execute: (instance, data) => chatController.fetchProfilePicture(instance, data), }); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }) .post(routerPath('findContacts'), ...guards, async (req, res) => { const response = await dataValidate>({ @@ -166,7 +166,7 @@ export function ChatRouter(chatController: ChatController, ...guards: RequestHan execute: (instance, data) => chatController.fetchContacts(instance, data), }); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }) // @deprecated .post(routerPath('retrieverMediaMessage'), ...guards, async (req, res) => { @@ -251,7 +251,7 @@ export function ChatRouter(chatController: ChatController, ...guards: RequestHan execute: (instance, data) => chatController.fetchMessages(instance, data), }); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }) .get(routerPath('findChats'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -261,7 +261,7 @@ export function ChatRouter(chatController: ChatController, ...guards: RequestHan chatController.fetchChats(instance, req.query?.type as string), }); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }) .post(routerPath('rejectCall'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -270,7 +270,7 @@ export function ChatRouter(chatController: ChatController, ...guards: RequestHan execute: (instance, data) => chatController.rejectCall(instance, data), }); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }) .post(routerPath('assertSessions'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -279,7 +279,7 @@ export function ChatRouter(chatController: ChatController, ...guards: RequestHan execute: (instance, data) => chatController.assertSessions(instance, data), }); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }); return router; diff --git a/src/whatsapp/routers/instance.router.ts b/src/whatsapp/routers/instance.router.ts index 84e040f4..fa91b86c 100644 --- a/src/whatsapp/routers/instance.router.ts +++ b/src/whatsapp/routers/instance.router.ts @@ -54,7 +54,7 @@ export function InstanceRouter( execute: (instance) => instanceController.createInstance(instance, req), }); - return res.status(HttpStatus.CREATED).json(response); + res.status(HttpStatus.CREATED).json(response); }) .get(routerPath('connect'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -63,7 +63,7 @@ export function InstanceRouter( execute: (instance) => instanceController.connectToWhatsapp(instance), }); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }) .get(routerPath('connectionState'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -72,7 +72,7 @@ export function InstanceRouter( execute: (instance) => instanceController.connectionState(instance), }); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }) .get(routerPath('fetchInstance'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -81,7 +81,7 @@ export function InstanceRouter( execute: (instance) => instanceController.fetchInstance(instance), }); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }) .get(routerPath('fetchInstances', false), ...guards, async (req, res) => { const response = await dataValidate({ @@ -90,7 +90,7 @@ export function InstanceRouter( execute: (instance) => instanceController.fetchInstances(instance), }); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }) .patch(routerPath('reload'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -99,7 +99,7 @@ export function InstanceRouter( execute: (instance) => instanceController.reloadConnection(instance), }); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }) .patch(routerPath('update'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -108,7 +108,7 @@ export function InstanceRouter( execute: (instance) => instanceController.updateInstance(instance), }); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }) .delete(routerPath('logout'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -117,7 +117,7 @@ export function InstanceRouter( execute: (instance) => instanceController.logout(instance), }); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }) .delete(routerPath('delete'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -127,7 +127,7 @@ export function InstanceRouter( instanceController.deleteInstance(instance, req?.query?.force === 'true'), }); - return res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); }) .put(routerPath('refreshToken'), async (req, res) => { const response = await dataValidate({ @@ -136,7 +136,7 @@ export function InstanceRouter( execute: (instance, data) => instanceController.refreshToken(instance, data, req), }); - return res.status(HttpStatus.CREATED).json(response); + res.status(HttpStatus.CREATED).json(response); }); return router; diff --git a/src/whatsapp/routers/sendMessage.router.ts b/src/whatsapp/routers/sendMessage.router.ts index 3a1a2205..752788ed 100644 --- a/src/whatsapp/routers/sendMessage.router.ts +++ b/src/whatsapp/routers/sendMessage.router.ts @@ -96,7 +96,7 @@ export function MessageRouter( execute: (instance, data) => sendMessageController.sendText(instance, data), }); - return res.status(HttpStatus.CREATED).json(response); + res.status(HttpStatus.CREATED).json(response); }) .post(routerPath('sendMedia'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -105,7 +105,7 @@ export function MessageRouter( execute: (instance, data) => sendMessageController.sendMedia(instance, data), }); - return res.status(HttpStatus.CREATED).json(response); + res.status(HttpStatus.CREATED).json(response); }) .post( routerPath('sendMediaFile'), @@ -119,7 +119,7 @@ export function MessageRouter( execute: (instance, data, file) => sendMessageController.sendMediaFile(instance, data, file), }); - return res.status(HttpStatus.CREATED).json(response); + res.status(HttpStatus.CREATED).json(response); }, ) .post(routerPath('sendWhatsAppAudio'), ...guards, async (req, res) => { @@ -130,7 +130,7 @@ export function MessageRouter( sendMessageController.sendWhatsAppAudio(instance, data), }); - return res.status(HttpStatus.CREATED).json(response); + res.status(HttpStatus.CREATED).json(response); }) .post( routerPath('sendWhatsAppAudioFile'), @@ -144,7 +144,7 @@ export function MessageRouter( execute: (instance, data, file) => sendMessageController.sendWhatsAppAudioFile(instance, data, file), }); - return res.status(HttpStatus.CREATED).json(response); + res.status(HttpStatus.CREATED).json(response); }, ) .post(routerPath('sendLocation'), ...guards, async (req, res) => { @@ -154,7 +154,7 @@ export function MessageRouter( execute: (instance, data) => sendMessageController.sendLocation(instance, data), }); - return res.status(HttpStatus.CREATED).json(response); + res.status(HttpStatus.CREATED).json(response); }) .post(routerPath('sendContact'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -163,7 +163,7 @@ export function MessageRouter( execute: (instance, data) => sendMessageController.sendContact(instance, data), }); - return res.status(HttpStatus.CREATED).json(response); + res.status(HttpStatus.CREATED).json(response); }) .post(routerPath('sendReaction'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -172,7 +172,7 @@ export function MessageRouter( execute: (instance, data) => sendMessageController.sendReaction(instance, data), }); - return res.status(HttpStatus.CREATED).json(response); + res.status(HttpStatus.CREATED).json(response); }) .post(routerPath('sendButtons'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -194,7 +194,7 @@ export function MessageRouter( }, }); - return res.status(HttpStatus.CREATED).json(response); + res.status(HttpStatus.CREATED).json(response); }) .post(routerPath('sendList'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -209,7 +209,7 @@ export function MessageRouter( }, }); - return res.status(HttpStatus.CREATED).json(response); + res.status(HttpStatus.CREATED).json(response); }) .post(routerPath('sendList/legacy'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -227,7 +227,7 @@ export function MessageRouter( }, }); - return res.status(HttpStatus.CREATED).json(response); + res.status(HttpStatus.CREATED).json(response); }) .post(routerPath('sendLink'), ...guards, async (req, res) => { const response = await dataValidate({ @@ -237,7 +237,7 @@ export function MessageRouter( sendMessageController.sendLinkPreview(instance, data), }); - return res.status(HttpStatus.CREATED).json(response); + res.status(HttpStatus.CREATED).json(response); }); return router;