diff --git a/get-email.md b/get-email.md deleted file mode 100644 index 6fa19b5..0000000 --- a/get-email.md +++ /dev/null @@ -1,7 +0,0 @@ -# To use Confluence API, I need your Atlassian email address - -The API token needs to be used with Basic authentication in the format: -- Username: your-email@example.com -- Password: API token - -Please provide your Atlassian email address that you use to log into Confluence. \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index db542d5..792a2f9 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from 'react'; +import { useState, useEffect } from 'react'; import { FilamentTable } from './components/FilamentTable'; import { Filament } from './types/filament'; import axios from 'axios'; diff --git a/src/components/ColorCell.tsx b/src/components/ColorCell.tsx index e40adfe..6b0d4ba 100644 --- a/src/components/ColorCell.tsx +++ b/src/components/ColorCell.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { getFilamentColor, getColorStyle, getContrastColor } from '../data/bambuLabColors'; +import { getFilamentColor, getColorStyle } from '../data/bambuLabColors'; interface ColorCellProps { colorName: string; diff --git a/src/pages/api/filaments.ts b/src/pages/api/filaments.ts index 94edbe8..d990d17 100644 --- a/src/pages/api/filaments.ts +++ b/src/pages/api/filaments.ts @@ -72,11 +72,11 @@ function parseConfluenceTable(html: string): Filament[] { const filaments: Filament[] = []; // Find all tables and process each one - $('table').each((tableIndex, table) => { + $('table').each((_tableIndex, table) => { let headers: string[] = []; // Get headers - $(table).find('tr').first().find('th, td').each((i, cell) => { + $(table).find('tr').first().find('th, td').each((_i, cell) => { headers.push($(cell).text().trim()); }); @@ -86,7 +86,7 @@ function parseConfluenceTable(html: string): Filament[] { } // Process rows - $(table).find('tr').slice(1).each((rowIndex, row) => { + $(table).find('tr').slice(1).each((_rowIndex, row) => { const cells = $(row).find('td'); if (cells.length >= headers.length) { const filament: any = {}; diff --git a/src/server/confluence.ts b/src/server/confluence.ts index 4f7ad72..212d0cf 100644 --- a/src/server/confluence.ts +++ b/src/server/confluence.ts @@ -103,7 +103,7 @@ function parseConfluenceTable(html: string): Filament[] { let headers: string[] = []; // Get headers - $(table).find('tr').first().find('th, td').each((i, cell) => { + $(table).find('tr').first().find('th, td').each((_i, cell) => { headers.push($(cell).text().trim()); }); @@ -116,7 +116,7 @@ function parseConfluenceTable(html: string): Filament[] { } // Process rows - $(table).find('tr').slice(1).each((rowIndex, row) => { + $(table).find('tr').slice(1).each((_rowIndex, row) => { const cells = $(row).find('td'); if (cells.length >= headers.length) { const filament: any = {}; diff --git a/test-confluence.js b/test-confluence.js deleted file mode 100644 index f32d2f1..0000000 --- a/test-confluence.js +++ /dev/null @@ -1,39 +0,0 @@ -import axios from 'axios'; - -const CONFLUENCE_API_URL = 'https://demirix.atlassian.net'; -const CONFLUENCE_TOKEN = 'ATATT3xFfGF0Ujrimil6qoikSmF8n87EuHQXoc9xcum811bWy3mOjqajAee8D42qRvry9X_oIk8qIumAMa1KO8GPRLcFMuzmBnFf5Y-Ft54tXGMNipd2xRWFB7jHblAsRN42teClNgTKl1iO0liPAxcHIndc2EnZX9mG5N22dODuoOD0PYkEZZI=2788126C'; -const CONFLUENCE_PAGE_ID = '173768714'; - -async function testConfluence() { - try { - console.log('Testing Confluence API...'); - const auth = Buffer.from(`dax@demirix.com:${CONFLUENCE_TOKEN}`).toString('base64'); - - const response = await axios.get( - `${CONFLUENCE_API_URL}/wiki/rest/api/content/${CONFLUENCE_PAGE_ID}?expand=body.storage`, - { - headers: { - 'Authorization': `Basic ${auth}`, - 'Accept': 'application/json' - } - } - ); - - console.log('Response status:', response.status); - console.log('Page title:', response.data.title); - console.log('Content length:', response.data.body?.storage?.value?.length || 0); - - // Check if there are tables - const content = response.data.body?.storage?.value || ''; - const tableCount = (content.match(/