21 lines
629 B
JavaScript
Executable File
21 lines
629 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
'use strict';
|
|
|
|
const database = require('../src/config/database');
|
|
const { verifyImageSearchCredentials } = require('../src/services/imageSearchCredentialGuard');
|
|
|
|
(async () => {
|
|
const status = await verifyImageSearchCredentials();
|
|
console.log(JSON.stringify({ success: true, status }));
|
|
await database.close();
|
|
})().catch(async (error) => {
|
|
console.error(JSON.stringify({
|
|
success: false,
|
|
code: error.code || 'IMAGE_SEARCH_CREDENTIAL_GUARD_FAILED',
|
|
message: error.message,
|
|
status: error.status || null,
|
|
}));
|
|
try { await database.close(); } catch (_error) {}
|
|
process.exit(1);
|
|
});
|