All checks were successful
Deploy Dev / deploy (push) Successful in 47s
- Aumento do limite de payload no NestJS para 50MB (json/urlencoded) permitindo upload de mídias em base64 sem erros de 'PayloadTooLarge'. - Criação de mecanismo de 'Smart Name Resolution' e 'Auto-Reparação' reativa para evitar que nomes de contatos sejam sobrescritos por JIDs numéricos, consultando o Puppeteer em segundo plano. - Correção de erro na atribuição de chats (/whatsapp/assign) onde 'area_id' nulo violava restrição 'NOT NULL' do PostgreSQL, agora exigindo o ID inteiro correspondente.
21 lines
666 B
JavaScript
21 lines
666 B
JavaScript
const fs = require('fs');
|
|
const fetch = require('node-fetch') || global.fetch;
|
|
|
|
async function run() {
|
|
try {
|
|
const chatsRes = await fetch('http://localhost:3001/whatsapp/chats');
|
|
const chats = await chatsRes.json();
|
|
if (chats.length > 0) {
|
|
const firstChatId = chats[0].id._serialized;
|
|
const msgsRes = await fetch(`http://localhost:3001/whatsapp/messages/${firstChatId}`);
|
|
if (!msgsRes.ok) return;
|
|
const msgs = await msgsRes.json();
|
|
fs.writeFileSync('test-api-out.json', JSON.stringify(msgs, null, 2));
|
|
console.log('Saved to test-api-out.json');
|
|
}
|
|
} catch (err) {
|
|
console.error('Error:', err);
|
|
}
|
|
}
|
|
run();
|