Scripts Reference
All utility scripts in /scripts/
46 scripts for operations, testing, maintenance, and debugging.
Archive & Backup
| Script | Purpose | When to Use |
|---|---|---|
archive-inactive.ts | Archive inactive companies to archive tables | Monthly cleanup |
archive-non-ab.ts | Archive non-AB companies to archive tables | Post-import cleanup |
restore-from-archive.ts | Restore companies from archive tables | On request |
backup-database.ts | Create pg_dump backup with timestamp | Before major operations |
verify-archive.ts | Validate no active companies were lost in archive | After archive operation |
Testing & Debugging
| Script | Purpose | When to Use |
|---|---|---|
test-enrichment-v7.ts | Run enrichment v7 on single company | Development testing |
test-firecrawl-direct.ts | Test Firecrawl API directly | Firecrawl debugging |
test-fixed-scraper.ts | Test scraper with fixed config | Scraper debugging |
test-google-maps-enhanced.ts | Test Google Places integration | Maps debugging |
test-hunter-eniro.ts | Test Hunter.io + Eniro | Legacy source debugging |
test-platform-scraper.ts | Test Wix/WordPress scrapers | Platform scraper debugging |
test-scb-connection.ts | Test SCB API connectivity | SCB debugging |
test-api-structure.ts | Verify API endpoint structure | API validation |
test-contact-mapping.ts | Test contact mapping logic | Contact mapping debugging |
benchmark-domain-discovery.ts | Benchmark domain discovery performance | Performance testing |
Cache Management
| Script | Purpose | When to Use |
|---|---|---|
clear-cache.ts | Clear all Redis caches | Cache corruption |
clear-v7-cache.ts | Clear enrichment v7 cache only | v7 config changes |
clear-website-cache.ts | Clear website scrape cache only | Scraper changes |
Enrichment Operations
| Script | Purpose | When to Use |
|---|---|---|
enrich-company.ts | Enrich single company by orgNr | Manual enrichment |
enrich-lead.ts | Enrich single lead by orgNr | Manual lead enrichment |
run-enrich.ts | Run enrichment batch | Batch processing |
Data Import
| Script | Purpose | When to Use |
|---|---|---|
import-prv-trademarks.ts | Import PRV trademark data | Trademark data update |
Maintenance
| Script | Purpose | When to Use |
|---|---|---|
check-api-key.ts | Verify API keys are valid | Key rotation |
check-export.ts | Test export functionality | Export validation |
generate-reports.ts | Generate system reports | Reporting |
inspect-wins.ts | Inspect Windows-specific issues | Windows debugging |
migrate.ts | Run database migrations | Schema updates |
update-vendfox-domain.ts | Update VendFox domain manually | Domain correction |
fix-vendfox-domain.ts | Fix VendFox domain issues | Domain bugfix |
verify-api.ts | Verify API is responding | Health check |
Configuration
| Script | Purpose |
|---|---|
add_cache_table.sql | SQL to add cache table |
database_migration_unified_search.sql | Unified search migration |
migrate_scb_schema_20260307.sql | SCB schema migration |
populate_enhanced_leads.sql | Populate enhanced leads table |
Indexer
| Script | Purpose |
|---|---|
indexer/debug-zone.py | Debug zone file parsing |
indexer/download-zone.sh | Download IIS .se zone file |