const db = require('../db/knex'); const { scanPhotoFacesById, } = require('../api_v1/scanner/faceScanner'); async function main() { const photoId = String( process.argv[2] || '', ).trim(); if (!photoId) { console.error( 'Uso: node tools/scanPhotoFaces.js PHOTO_ID', ); process.exitCode = 2; return; } const result = await scanPhotoFacesById(photoId); console.log( JSON.stringify(result, null, 2), ); } main() .catch((error) => { console.error( '[scanPhotoFaces] errore:', error.stack || error.message || error, ); process.exitCode = 1; }) .finally(async () => { await db.destroy(); });