feat: implement gemini async nlp extraction, contact auto-creation, data enrichment & clean notes
All checks were successful
Build & Push Friends Image to Gitea Registry / build-and-push (push) Successful in 9s
All checks were successful
Build & Push Friends Image to Gitea Registry / build-and-push (push) Successful in 9s
This commit is contained in:
23
test_contacts.js
Normal file
23
test_contacts.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import dotenv from "dotenv";
|
||||
import { monicaFetch } from "./server.js";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
async function run() {
|
||||
console.log("Checking Monica API token...", process.env.MONICA_API_TOKEN ? "Present" : "Missing");
|
||||
console.log("Monica Base URL:", process.env.MONICA_BASE_URL);
|
||||
|
||||
try {
|
||||
const payload = await monicaFetch("/api/contacts?limit=100");
|
||||
const contacts = Array.isArray(payload.data) ? payload.data : [];
|
||||
console.log(`Fetched ${contacts.length} contacts from Monica CRM:`);
|
||||
for (const c of contacts) {
|
||||
const name = c.complete_name || [c.first_name, c.last_name].filter(Boolean).join(" ");
|
||||
console.log(`- ID: ${c.id}, Name: "${name}", First Name: "${c.first_name}", Last Name: "${c.last_name}"`);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("Error fetching contacts:", err);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
Reference in New Issue
Block a user