src/api.js - Client API verso il Sito¶
Axios client per comunicare con il Sito CRM (.154)
A cosa serve¶
syncMessage(data)- Invia messaggi al DB del sitoresolveContact(phone)- Identity Mapping: phone -> display_nameupsertContact(phone, pushname)- Aggiorna pushname nel DBcheckContact(phone)- Cerca contatto nel CRMgetProducts(query)- Cerca prodotticreateLead/createQuote/createTicket- Crea entita CRM- Cache in-memory 5 minuti per
resolveContact
Chi lo chiama¶
index.jsper identity mapping e sync messaggiagents/*.jsper operazioni CRMwatchdog.jsper classificazione chat
Cosa NON toccare¶
- Il
BOT_SERVICE_TOKENin.env(non hardcodare) - La cache
identityCachecon TTL 5 minuti - Gli interceptor axios per logging