Replaces the GraphQL/search-based Flexoptix scraper with a proper
Magento 2 REST API integration that delivers authoritative SKUs,
prices, stock levels and compatibility data.
New files:
- packages/scraper/src/robots/flexoptix-api-sync.ts
Self-contained robot: auth → paginated fetch → normalize → DB write.
Reads FLEXOPTIX_API_BASE_URL / _USERNAME / _PASSWORD from env.
Returns { fetched, normalized, skipped, priceWrites, stockWrites }.
No file intermediary — in-memory pipeline.
- scripts/import-flexoptix-catalog.ts
One-shot CLI importer for the Pulso-generated JSONL (Codex handover).
- docs/FLEXOPTIX_CATALOG_IMPORT.md
Runbook for manual import + per-SKU specifications enrichment.
Scheduler changes:
- Added sync:flexoptix-catalog queue + work() handler
- Scheduled every 2h at 0 */2 * * * (same cadence as legacy job)
- scrape:pricing:flexoptix kept as legacy GraphQL fallback
Also includes Codex-generated additions from this sprint:
- audiocodes-oem scraper, seed-batch35/36/37, db.ts improvements,
sql/102 verification reconcile, README + package.json updates
17 lines
599 B
TypeScript
17 lines
599 B
TypeScript
import { pool } from "./utils/db";
|
|
import { scrapeExtremeLegacyOem } from "./scrapers/extreme-legacy-oem";
|
|
import { scrapeNortelLegacyOem } from "./scrapers/nortel-legacy-oem";
|
|
import { scrape3comLegacyOem } from "./scrapers/3com-legacy-oem";
|
|
import { scrapeAvayaLegacyOem } from "./scrapers/avaya-legacy-oem";
|
|
|
|
async function main() {
|
|
await scrapeExtremeLegacyOem();
|
|
await scrapeNortelLegacyOem();
|
|
await scrape3comLegacyOem();
|
|
await scrapeAvayaLegacyOem();
|
|
}
|
|
|
|
main()
|
|
.then(() => pool.end())
|
|
.catch((err) => { console.error("Fatal:", err); pool.end(); process.exit(1); });
|