import axios from 'axios';
import https from 'https';
const api = axios.create({
baseURL: 'https://fluentboards.local/wp-json/fluent-boards/v2',
auth: {
username: 'admin',
password: 'ztIf qBbq CVlf OTV6 9noL iicX'
},
headers: {
'Content-Type': 'application/json',
},
httpsAgent: new https.Agent({
rejectUnauthorized: false
})
});
async function testBoardCreation() {
try {
console.log('Testing board creation with admin credentials...\n');
// First, list boards
console.log('=== LISTING BOARDS ===');
const listResponse = await api.get('/projects');
console.log('Total boards before:', listResponse.data.boards.total);
console.log('Boards:', listResponse.data.boards.data.map((b: any) => `${b.id}: ${b.title}`));
// Create a board
console.log('\n=== CREATING BOARD ===');
const createResponse = await api.post('/projects', {
board: {
title: "MCP Server Development",
description: "Comprehensive task tracking for MCP Server development with proper agent workflow stages",
type: "task"
}
});
console.log('Create response:', createResponse.data);
// List boards again
console.log('\n=== LISTING BOARDS AGAIN ===');
const listResponse2 = await api.get('/projects');
console.log('Total boards after:', listResponse2.data.boards.total);
console.log('Boards:', listResponse2.data.boards.data.map((b: any) => `${b.id}: ${b.title}`));
} catch (error: any) {
console.error('Error:', error.message);
if (error.response) {
console.error('Response status:', error.response.status);
console.error('Response data:', error.response.data);
}
}
}
testBoardCreation();