Fix TypeScript build errors
- Fixed unused variable warnings by prefixing with underscore - Removed unused imports - Removed test files from repository
This commit is contained in:
@@ -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.
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { FilamentTable } from './components/FilamentTable';
|
import { FilamentTable } from './components/FilamentTable';
|
||||||
import { Filament } from './types/filament';
|
import { Filament } from './types/filament';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { getFilamentColor, getColorStyle, getContrastColor } from '../data/bambuLabColors';
|
import { getFilamentColor, getColorStyle } from '../data/bambuLabColors';
|
||||||
|
|
||||||
interface ColorCellProps {
|
interface ColorCellProps {
|
||||||
colorName: string;
|
colorName: string;
|
||||||
|
|||||||
@@ -72,11 +72,11 @@ function parseConfluenceTable(html: string): Filament[] {
|
|||||||
const filaments: Filament[] = [];
|
const filaments: Filament[] = [];
|
||||||
|
|
||||||
// Find all tables and process each one
|
// Find all tables and process each one
|
||||||
$('table').each((tableIndex, table) => {
|
$('table').each((_tableIndex, table) => {
|
||||||
let headers: string[] = [];
|
let headers: string[] = [];
|
||||||
|
|
||||||
// Get headers
|
// 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());
|
headers.push($(cell).text().trim());
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ function parseConfluenceTable(html: string): Filament[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Process rows
|
// Process rows
|
||||||
$(table).find('tr').slice(1).each((rowIndex, row) => {
|
$(table).find('tr').slice(1).each((_rowIndex, row) => {
|
||||||
const cells = $(row).find('td');
|
const cells = $(row).find('td');
|
||||||
if (cells.length >= headers.length) {
|
if (cells.length >= headers.length) {
|
||||||
const filament: any = {};
|
const filament: any = {};
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ function parseConfluenceTable(html: string): Filament[] {
|
|||||||
let headers: string[] = [];
|
let headers: string[] = [];
|
||||||
|
|
||||||
// Get headers
|
// 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());
|
headers.push($(cell).text().trim());
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ function parseConfluenceTable(html: string): Filament[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Process rows
|
// Process rows
|
||||||
$(table).find('tr').slice(1).each((rowIndex, row) => {
|
$(table).find('tr').slice(1).each((_rowIndex, row) => {
|
||||||
const cells = $(row).find('td');
|
const cells = $(row).find('td');
|
||||||
if (cells.length >= headers.length) {
|
if (cells.length >= headers.length) {
|
||||||
const filament: any = {};
|
const filament: any = {};
|
||||||
|
|||||||
@@ -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(/<table/g) || []).length;
|
|
||||||
console.log('Number of tables:', tableCount);
|
|
||||||
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error:', error.response?.status || error.message);
|
|
||||||
if (error.response) {
|
|
||||||
console.error('Response data:', error.response.data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
testConfluence();
|
|
||||||
Reference in New Issue
Block a user