From 6e3b81145b83b3cf115a87022b12687bad205a2f Mon Sep 17 00:00:00 2001 From: Randall Stillwell Date: Tue, 2 Jun 2026 00:40:50 -0500 Subject: [PATCH] Remove orphaned import-lorcana-simple CLI script. It POSTed to the deleted /api/cards/import-lorcana endpoint; no remaining callers. Co-authored-by: Cursor --- scripts/import-lorcana-simple.js | 98 -------------------------------- 1 file changed, 98 deletions(-) delete mode 100644 scripts/import-lorcana-simple.js diff --git a/scripts/import-lorcana-simple.js b/scripts/import-lorcana-simple.js deleted file mode 100644 index c119b86..0000000 --- a/scripts/import-lorcana-simple.js +++ /dev/null @@ -1,98 +0,0 @@ -import fetch from 'node-fetch'; -import fs from 'fs'; - -// Lorcana sets to import -const LORCANA_SETS = [ - { code: 'tfc', name: 'The First Chapter' }, - { code: 'rotf', name: 'Rise of the Floodborn' }, - { code: 'ink', name: 'Into the Inklands' } -]; - -async function importLorcanaSet(setCode, setName) { - try { - console.log(`Importing Lorcana set: ${setName} (${setCode})`); - - const response = await fetch(`http://localhost:3000/api/cards/import-lorcana`, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify({ - setCode: setCode, - setName: setName - }) - }); - - const result = await response.json(); - - if (result.success) { - console.log(`āœ… Successfully imported ${result.imported || 0} cards from ${setName}`); - return { success: true, importedCount: result.imported || 0 }; - } else { - console.log(`āŒ Failed to import ${setName}: ${result.error}`); - return { success: false, error: result.error }; - } - } catch (error) { - console.log(`āŒ Error importing ${setName}: ${error.message}`); - return { success: false, error: error.message }; - } -} - -async function importAllLorcana() { - console.log('šŸŽØ Starting Lorcana card import...\n'); - - const results = { - total: 0, - successful: 0, - failed: 0, - sets: [] - }; - - for (const set of LORCANA_SETS) { - const result = await importLorcanaSet(set.code, set.name); - results.sets.push({ ...set, ...result }); - - if (result.success) { - results.successful++; - results.total += result.importedCount || 0; - } else { - results.failed++; - } - - // Add a delay between sets - await new Promise(resolve => setTimeout(resolve, 2000)); - } - - // Print summary - console.log('\nšŸ“Š Lorcana Import Summary:'); - console.log('========================'); - console.log(`Total sets: ${LORCANA_SETS.length}`); - console.log(`Successful: ${results.successful}`); - console.log(`Failed: ${results.failed}`); - console.log(`Total cards imported: ${results.total}`); - console.log(`Success rate: ${((results.successful / LORCANA_SETS.length) * 100).toFixed(1)}%`); - - // Save detailed results - const timestamp = new Date().toISOString().replace(/[:.]/g, '-'); - const filename = `lorcana-import-results-${timestamp}.json`; - - fs.writeFileSync(filename, JSON.stringify(results, null, 2)); - console.log(`\nšŸ“„ Detailed results saved to: ${filename}`); - - return results; -} - -// Run the import if this script is executed directly -if (import.meta.url === `file://${process.argv[1]}`) { - importAllLorcana() - .then(() => { - console.log('\nšŸŽ‰ Lorcana import completed!'); - process.exit(0); - }) - .catch((error) => { - console.error('āŒ Import failed:', error); - process.exit(1); - }); -} - -export { importAllLorcana, importLorcanaSet }; \ No newline at end of file