42 lines
1.3 KiB
JavaScript
42 lines
1.3 KiB
JavaScript
const axios = require('axios');
|
|
|
|
async function checkStaxStatus() {
|
|
try {
|
|
console.log('🔍 Checking STAX document processing status...');
|
|
|
|
// First login to get a token
|
|
const loginResponse = await axios.post('http://localhost:5000/api/auth/login', {
|
|
email: 'test@stax-processing.com',
|
|
password: 'TestPass123!'
|
|
});
|
|
|
|
const accessToken = loginResponse.data.data.tokens.accessToken;
|
|
console.log('✅ Authenticated successfully');
|
|
|
|
// Check document status
|
|
const documentId = '73fe2304-be3e-4195-871e-98d860e768a4';
|
|
const docResponse = await axios.get(`http://localhost:5000/api/documents/${documentId}`, {
|
|
headers: {
|
|
'Authorization': `Bearer ${accessToken}`
|
|
}
|
|
});
|
|
|
|
console.log('📄 Document Status:');
|
|
console.log(JSON.stringify(docResponse.data, null, 2));
|
|
|
|
// Check if there are any processing jobs
|
|
const jobsResponse = await axios.get(`http://localhost:5000/api/documents/${documentId}/jobs`, {
|
|
headers: {
|
|
'Authorization': `Bearer ${accessToken}`
|
|
}
|
|
});
|
|
|
|
console.log('\n🔄 Processing Jobs:');
|
|
console.log(JSON.stringify(jobsResponse.data, null, 2));
|
|
|
|
} catch (error) {
|
|
console.error('❌ Error:', error.response?.data || error.message);
|
|
}
|
|
}
|
|
|
|
checkStaxStatus();
|