From eb04c3f1133dc04aadcc696b5267935746e1e58b Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Fri, 12 Apr 2024 17:15:13 -0300 Subject: [PATCH] fix: reorganization of files and folders --- src/api/controllers/instance.controller.ts | 4 +- src/api/services/monitor.service.ts | 4 +- .../whatsapp.baileys.service.ts | 46 +++++++++---------- .../whatsapp.business.service.ts | 20 ++++---- 4 files changed, 37 insertions(+), 37 deletions(-) rename src/api/services/{ => whatsapp}/whatsapp.baileys.service.ts (98%) rename src/api/services/{ => whatsapp}/whatsapp.business.service.ts (98%) diff --git a/src/api/controllers/instance.controller.ts b/src/api/controllers/instance.controller.ts index 4767db73..563bc5fd 100644 --- a/src/api/controllers/instance.controller.ts +++ b/src/api/controllers/instance.controller.ts @@ -20,8 +20,8 @@ import { IntegrationService } from '../services/integration.service'; import { WAMonitoringService } from '../services/monitor.service'; import { SettingsService } from '../services/settings.service'; import { WebhookService } from '../services/webhook.service'; -import { BaileysStartupService } from '../services/whatsapp.baileys.service'; -import { BusinessStartupService } from '../services/whatsapp.business.service'; +import { BaileysStartupService } from '../services/whatsapp/whatsapp.baileys.service'; +import { BusinessStartupService } from '../services/whatsapp/whatsapp.business.service'; import { Events, Integration, wa } from '../types/wa.types'; import { ProxyController } from './proxy.controller'; diff --git a/src/api/services/monitor.service.ts b/src/api/services/monitor.service.ts index f8148926..e8644e99 100644 --- a/src/api/services/monitor.service.ts +++ b/src/api/services/monitor.service.ts @@ -26,8 +26,8 @@ import { import { RepositoryBroker } from '../repository/repository.manager'; import { Integration } from '../types/wa.types'; import { CacheService } from './cache.service'; -import { BaileysStartupService } from './whatsapp.baileys.service'; -import { BusinessStartupService } from './whatsapp.business.service'; +import { BaileysStartupService } from './whatsapp/whatsapp.baileys.service'; +import { BusinessStartupService } from './whatsapp/whatsapp.business.service'; export class WAMonitoringService { constructor( diff --git a/src/api/services/whatsapp.baileys.service.ts b/src/api/services/whatsapp/whatsapp.baileys.service.ts similarity index 98% rename from src/api/services/whatsapp.baileys.service.ts rename to src/api/services/whatsapp/whatsapp.baileys.service.ts index ef39b0fc..6285250b 100644 --- a/src/api/services/whatsapp.baileys.service.ts +++ b/src/api/services/whatsapp/whatsapp.baileys.service.ts @@ -54,14 +54,14 @@ import qrcode, { QRCodeToDataURLOptions } from 'qrcode'; import qrcodeTerminal from 'qrcode-terminal'; import sharp from 'sharp'; -import { ConfigService, ConfigSessionPhone, Database, Log, QrCode, Redis } from '../../config/env.config'; -import { INSTANCE_DIR } from '../../config/path.config'; -import { BadRequestException, InternalServerErrorException, NotFoundException } from '../../exceptions'; -import { dbserver } from '../../libs/db.connect'; -import { RedisCache } from '../../libs/redis.client'; -import { makeProxyAgent } from '../../utils/makeProxyAgent'; -import { useMultiFileAuthStateDb } from '../../utils/use-multi-file-auth-state-db'; -import { useMultiFileAuthStateRedisDb } from '../../utils/use-multi-file-auth-state-redis-db'; +import { ConfigService, ConfigSessionPhone, Database, Log, QrCode, Redis } from '../../../config/env.config'; +import { INSTANCE_DIR } from '../../../config/path.config'; +import { BadRequestException, InternalServerErrorException, NotFoundException } from '../../../exceptions'; +import { dbserver } from '../../../libs/db.connect'; +import { RedisCache } from '../../../libs/redis.client'; +import { makeProxyAgent } from '../../../utils/makeProxyAgent'; +import { useMultiFileAuthStateDb } from '../../../utils/use-multi-file-auth-state-db'; +import { useMultiFileAuthStateRedisDb } from '../../../utils/use-multi-file-auth-state-redis-db'; import { ArchiveChatDto, BlockUserDto, @@ -75,7 +75,7 @@ import { SendPresenceDto, UpdateMessageDto, WhatsAppNumberDto, -} from '../dto/chat.dto'; +} from '../../dto/chat.dto'; import { AcceptGroupInvite, CreateGroupDto, @@ -89,9 +89,9 @@ import { GroupToggleEphemeralDto, GroupUpdateParticipantDto, GroupUpdateSettingDto, -} from '../dto/group.dto'; -import { InstanceDto, SetPresenceDto } from '../dto/instance.dto'; -import { HandleLabelDto, LabelDto } from '../dto/label.dto'; +} from '../../dto/group.dto'; +import { InstanceDto, SetPresenceDto } from '../../dto/instance.dto'; +import { HandleLabelDto, LabelDto } from '../../dto/label.dto'; import { ContactMessage, MediaMessage, @@ -108,17 +108,17 @@ import { SendStickerDto, SendTextDto, StatusMessage, -} from '../dto/sendMessage.dto'; -import { chatwootImport } from '../integrations/chatwoot/utils/chatwoot-import-helper'; -import { SettingsRaw } from '../models'; -import { ChatRaw } from '../models/chat.model'; -import { ContactRaw } from '../models/contact.model'; -import { MessageRaw, MessageUpdateRaw } from '../models/message.model'; -import { RepositoryBroker } from '../repository/repository.manager'; -import { waMonitor } from '../server.module'; -import { Events, MessageSubtype, TypeMediaMessage, wa } from '../types/wa.types'; -import { CacheService } from './cache.service'; -import { WAStartupService } from './whatsapp.service'; +} from '../../dto/sendMessage.dto'; +import { chatwootImport } from '../../integrations/chatwoot/utils/chatwoot-import-helper'; +import { SettingsRaw } from '../../models'; +import { ChatRaw } from '../../models/chat.model'; +import { ContactRaw } from '../../models/contact.model'; +import { MessageRaw, MessageUpdateRaw } from '../../models/message.model'; +import { RepositoryBroker } from '../../repository/repository.manager'; +import { waMonitor } from '../../server.module'; +import { Events, MessageSubtype, TypeMediaMessage, wa } from '../../types/wa.types'; +import { CacheService } from './../cache.service'; +import { WAStartupService } from './../whatsapp.service'; // const retryCache = {}; diff --git a/src/api/services/whatsapp.business.service.ts b/src/api/services/whatsapp/whatsapp.business.service.ts similarity index 98% rename from src/api/services/whatsapp.business.service.ts rename to src/api/services/whatsapp/whatsapp.business.service.ts index 35b1e028..89cc2089 100644 --- a/src/api/services/whatsapp.business.service.ts +++ b/src/api/services/whatsapp/whatsapp.business.service.ts @@ -5,10 +5,10 @@ import FormData from 'form-data'; import fs from 'fs/promises'; import { getMIMEType } from 'node-mime-types'; -import { ConfigService, Database, WaBusiness } from '../../config/env.config'; -import { BadRequestException, InternalServerErrorException } from '../../exceptions'; -import { RedisCache } from '../../libs/redis.client'; -import { NumberBusiness } from '../dto/chat.dto'; +import { ConfigService, Database, WaBusiness } from '../../../config/env.config'; +import { BadRequestException, InternalServerErrorException } from '../../../exceptions'; +import { RedisCache } from '../../../libs/redis.client'; +import { NumberBusiness } from '../../dto/chat.dto'; import { ContactMessage, MediaMessage, @@ -22,12 +22,12 @@ import { SendReactionDto, SendTemplateDto, SendTextDto, -} from '../dto/sendMessage.dto'; -import { ContactRaw, MessageRaw, MessageUpdateRaw, SettingsRaw } from '../models'; -import { RepositoryBroker } from '../repository/repository.manager'; -import { Events, wa } from '../types/wa.types'; -import { CacheService } from './cache.service'; -import { WAStartupService } from './whatsapp.service'; +} from '../../dto/sendMessage.dto'; +import { ContactRaw, MessageRaw, MessageUpdateRaw, SettingsRaw } from '../../models'; +import { RepositoryBroker } from '../../repository/repository.manager'; +import { Events, wa } from '../../types/wa.types'; +import { CacheService } from './../cache.service'; +import { WAStartupService } from './../whatsapp.service'; export class BusinessStartupService extends WAStartupService { constructor(