- Updated Dockerfile to include hardcoded environment variables for Next.js build. - Enhanced Google Calendar API integration by extracting user email from id_token and adding scopes for OpenID and email access. - Modified credential management to delete existing credentials before creating new ones in n8n. - Updated dashboard to display connected Google Calendar email and credential details. Story: 4.2 - Melhorar integração com Google Calendar e atualizar Dockerfile 🤖 Generated with [Claude Code](https://claude.com/claude-code)
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
/**
|
|
* Script para deletar credenciais órfãs no n8n
|
|
* Execute com: npx tsx scripts/delete-orphan-credentials.ts
|
|
*/
|
|
|
|
import { deleteCredential } from "../lib/n8n-api";
|
|
|
|
// IDs das credenciais órfãs detectadas nos logs
|
|
const orphanCredentials = [
|
|
"3FXa3YeWaFobE7fJ", // Primeira tentativa
|
|
"6upnlkiEcqiKXcjv", // Segunda tentativa
|
|
];
|
|
|
|
async function deleteOrphans() {
|
|
console.log("🧹 Iniciando limpeza de credenciais órfãs...\n");
|
|
|
|
for (const credentialId of orphanCredentials) {
|
|
console.log(`Deletando credencial: ${credentialId}`);
|
|
try {
|
|
const result = await deleteCredential(credentialId);
|
|
if (result) {
|
|
console.log(`✅ Credencial ${credentialId} deletada com sucesso`);
|
|
} else {
|
|
console.log(
|
|
`⚠️ Falha ao deletar ${credentialId} (pode não existir mais)`,
|
|
);
|
|
}
|
|
} catch (error) {
|
|
console.error(`❌ Erro ao deletar ${credentialId}:`, error);
|
|
}
|
|
console.log("");
|
|
}
|
|
|
|
console.log("✅ Limpeza concluída!");
|
|
}
|
|
|
|
deleteOrphans().catch(console.error);
|