fix: reorder imports to resolve linting issues

Reordered imports in multiple files to resolve linting issues and improve code readability. This change does not impact the functionality but ensures the code adheres to the project's coding standards.
This commit is contained in:
Davidson Gomes 2024-06-16 17:19:45 -03:00
parent 5b47bc9ef0
commit 975b3ee528
6 changed files with 10 additions and 31 deletions

View File

@ -8,8 +8,8 @@ import ChatwootClient, {
inbox, inbox,
} from '@figuro/chatwoot-sdk'; } from '@figuro/chatwoot-sdk';
import { request as chatwootRequest } from '@figuro/chatwoot-sdk/dist/core/request'; import { request as chatwootRequest } from '@figuro/chatwoot-sdk/dist/core/request';
import { proto } from 'baileys';
import axios from 'axios'; import axios from 'axios';
import { proto } from 'baileys';
import FormData from 'form-data'; import FormData from 'form-data';
import { createReadStream, unlinkSync, writeFileSync } from 'fs'; import { createReadStream, unlinkSync, writeFileSync } from 'fs';
import Jimp from 'jimp'; import Jimp from 'jimp';
@ -444,8 +444,7 @@ export class ChatwootService {
const searchableFields = this.getSearchableFields(); const searchableFields = this.getSearchableFields();
// eslint-disable-next-line prettier/prettier // eslint-disable-next-line prettier/prettier
if(contacts.length === 2 && this.getClientCwConfig().merge_brazil_contacts && query.startsWith('+55')){ if (contacts.length === 2 && this.getClientCwConfig().merge_brazil_contacts && query.startsWith('+55')) {
const contact = this.mergeBrazilianContacts(contacts); const contact = this.mergeBrazilianContacts(contacts);
if (contact) { if (contact) {
return contact; return contact;

View File

@ -1,5 +1,5 @@
import { WASocket } from 'baileys';
import axios from 'axios'; import axios from 'axios';
import { WASocket } from 'baileys';
import { execSync } from 'child_process'; import { execSync } from 'child_process';
import { isURL } from 'class-validator'; import { isURL } from 'class-validator';
import EventEmitter2 from 'eventemitter2'; import EventEmitter2 from 'eventemitter2';

View File

@ -1,5 +1,6 @@
import ffmpegPath from '@ffmpeg-installer/ffmpeg'; import ffmpegPath from '@ffmpeg-installer/ffmpeg';
import { Boom } from '@hapi/boom'; import { Boom } from '@hapi/boom';
import axios from 'axios';
import makeWASocket, { import makeWASocket, {
AnyMessageContent, AnyMessageContent,
BufferedEventData, BufferedEventData,
@ -38,7 +39,6 @@ import makeWASocket, {
} from 'baileys'; } from 'baileys';
import { Label } from 'baileys/lib/Types/Label'; import { Label } from 'baileys/lib/Types/Label';
import { LabelAssociation } from 'baileys/lib/Types/LabelAssociation'; import { LabelAssociation } from 'baileys/lib/Types/LabelAssociation';
import axios from 'axios';
import { exec } from 'child_process'; import { exec } from 'child_process';
import { isBase64, isURL } from 'class-validator'; import { isBase64, isURL } from 'class-validator';
import EventEmitter2 from 'eventemitter2'; import EventEmitter2 from 'eventemitter2';
@ -253,8 +253,8 @@ export class BaileysStartupService extends ChannelStartupService {
this.logger.verbose('Getting profile status'); this.logger.verbose('Getting profile status');
const status = await this.client.fetchStatus(this.instance.wuid); const status = await this.client.fetchStatus(this.instance.wuid);
this.logger.verbose(`Profile status: ${status.status}`); this.logger.verbose(`Profile status: ${status[0]?.status}`);
return status.status; return status[0]?.status;
} }
public get profilePictureUrl() { public get profilePictureUrl() {
@ -1737,7 +1737,7 @@ export class BaileysStartupService extends ChannelStartupService {
this.logger.verbose('Getting status'); this.logger.verbose('Getting status');
return { return {
wuid: jid, wuid: jid,
status: (await this.client.fetchStatus(jid))?.status, status: (await this.client.fetchStatus(jid))[0]?.status,
}; };
} catch (error) { } catch (error) {
this.logger.verbose('Status not found'); this.logger.verbose('Status not found');

View File

@ -1,11 +1,4 @@
import { import { AuthenticationCreds, AuthenticationState, BufferJSON, initAuthCreds, proto, SignalDataTypeMap } from 'baileys';
AuthenticationCreds,
AuthenticationState,
BufferJSON,
initAuthCreds,
proto,
SignalDataTypeMap,
} from 'baileys';
import { configService, Database } from '../config/env.config'; import { configService, Database } from '../config/env.config';
import { Logger } from '../config/logger.config'; import { Logger } from '../config/logger.config';

View File

@ -34,14 +34,7 @@
* *
*/ */
import { import { AuthenticationCreds, AuthenticationState, BufferJSON, initAuthCreds, proto, SignalDataTypeMap } from 'baileys';
AuthenticationCreds,
AuthenticationState,
BufferJSON,
initAuthCreds,
proto,
SignalDataTypeMap,
} from 'baileys';
import { isNotEmpty } from 'class-validator'; import { isNotEmpty } from 'class-validator';
import { ProviderFiles } from '../api/provider/sessions'; import { ProviderFiles } from '../api/provider/sessions';

View File

@ -1,10 +1,4 @@
import { import { AuthenticationCreds, AuthenticationState, initAuthCreds, proto, SignalDataTypeMap } from 'baileys';
AuthenticationCreds,
AuthenticationState,
initAuthCreds,
proto,
SignalDataTypeMap,
} from 'baileys';
import { CacheService } from '../api/services/cache.service'; import { CacheService } from '../api/services/cache.service';
import { Logger } from '../config/logger.config'; import { Logger } from '../config/logger.config';