mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-11 02:49:36 -06:00
style: improve code formatting for better readability in WhatsApp service files
This commit is contained in:
parent
00780157db
commit
55822f9443
@ -463,7 +463,8 @@ export class BusinessStartupService extends ChannelStartupService {
|
|||||||
this.logger?.info?.('Video upload attempted but is disabled by configuration.');
|
this.logger?.info?.('Video upload attempted but is disabled by configuration.');
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
message: 'Video upload is currently disabled. Please contact support if you need this feature enabled.',
|
message:
|
||||||
|
'Video upload is currently disabled. Please contact support if you need this feature enabled.',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1213,7 +1214,8 @@ export class BusinessStartupService extends ChannelStartupService {
|
|||||||
const token = this.token;
|
const token = this.token;
|
||||||
|
|
||||||
const headers = { Authorization: `Bearer ${token}` };
|
const headers = { Authorization: `Bearer ${token}` };
|
||||||
const url = `${this.configService.get<WaBusiness>('WA_BUSINESS').URL}/${this.configService.get<WaBusiness>('WA_BUSINESS').VERSION
|
const url = `${this.configService.get<WaBusiness>('WA_BUSINESS').URL}/${
|
||||||
|
this.configService.get<WaBusiness>('WA_BUSINESS').VERSION
|
||||||
}/${this.number}/media`;
|
}/${this.number}/media`;
|
||||||
|
|
||||||
const res = await axios.post(url, formData, { headers });
|
const res = await axios.post(url, formData, { headers });
|
||||||
|
|||||||
@ -4726,12 +4726,7 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async fetchMessages(query: Query<Message>) {
|
public async fetchMessages(query: Query<Message>) {
|
||||||
const keyFilters = query?.where?.key as {
|
const keyFilters = query?.where?.key as ExtendedIMessageKey;
|
||||||
id?: string;
|
|
||||||
fromMe?: boolean;
|
|
||||||
remoteJid?: string;
|
|
||||||
participants?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
const timestampFilter = {};
|
const timestampFilter = {};
|
||||||
if (query?.where?.messageTimestamp) {
|
if (query?.where?.messageTimestamp) {
|
||||||
@ -4754,7 +4749,13 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {},
|
keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {},
|
||||||
keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {},
|
keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {},
|
||||||
keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {},
|
keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {},
|
||||||
keyFilters?.participants ? { key: { path: ['participants'], equals: keyFilters?.participants } } : {},
|
keyFilters?.participant ? { key: { path: ['participant'], equals: keyFilters?.participant } } : {},
|
||||||
|
{
|
||||||
|
OR: [
|
||||||
|
keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {},
|
||||||
|
keyFilters?.senderPn ? { key: { path: ['senderPn'], equals: keyFilters?.senderPn } } : {},
|
||||||
|
],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -4778,7 +4779,13 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {},
|
keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {},
|
||||||
keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {},
|
keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {},
|
||||||
keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {},
|
keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {},
|
||||||
keyFilters?.participants ? { key: { path: ['participants'], equals: keyFilters?.participants } } : {},
|
keyFilters?.participant ? { key: { path: ['participant'], equals: keyFilters?.participant } } : {},
|
||||||
|
{
|
||||||
|
OR: [
|
||||||
|
keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {},
|
||||||
|
keyFilters?.senderPn ? { key: { path: ['senderPn'], equals: keyFilters?.senderPn } } : {},
|
||||||
|
],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
orderBy: { messageTimestamp: 'desc' },
|
orderBy: { messageTimestamp: 'desc' },
|
||||||
|
|||||||
@ -38,11 +38,13 @@ const getTypeMessage = (msg: any) => {
|
|||||||
? `videoMessage|${mediaId}${msg?.message?.videoMessage?.caption ? `|${msg?.message?.videoMessage?.caption}` : ''}`
|
? `videoMessage|${mediaId}${msg?.message?.videoMessage?.caption ? `|${msg?.message?.videoMessage?.caption}` : ''}`
|
||||||
: undefined,
|
: undefined,
|
||||||
documentMessage: msg?.message?.documentMessage
|
documentMessage: msg?.message?.documentMessage
|
||||||
? `documentMessage|${mediaId}${msg?.message?.documentMessage?.caption ? `|${msg?.message?.documentMessage?.caption}` : ''
|
? `documentMessage|${mediaId}${
|
||||||
|
msg?.message?.documentMessage?.caption ? `|${msg?.message?.documentMessage?.caption}` : ''
|
||||||
}`
|
}`
|
||||||
: undefined,
|
: undefined,
|
||||||
documentWithCaptionMessage: msg?.message?.documentWithCaptionMessage?.message?.documentMessage
|
documentWithCaptionMessage: msg?.message?.documentWithCaptionMessage?.message?.documentMessage
|
||||||
? `documentWithCaptionMessage|${mediaId}${msg?.message?.documentWithCaptionMessage?.message?.documentMessage?.caption
|
? `documentWithCaptionMessage|${mediaId}${
|
||||||
|
msg?.message?.documentWithCaptionMessage?.message?.documentMessage?.caption
|
||||||
? `|${msg?.message?.documentWithCaptionMessage?.message?.documentMessage?.caption}`
|
? `|${msg?.message?.documentWithCaptionMessage?.message?.documentMessage?.caption}`
|
||||||
: ''
|
: ''
|
||||||
}`
|
}`
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user