SPB Git forge

spb/rareindex

Public
54commits 1branches 0releases
7.1 MBsize
maindefault branch
10 days agolast push
TypeScript 61.9% HTML 37.2% SQL 0.7%
1.4 KB

# Source connectors

Every source lives in connectors/<engine>/<source-id>/index.ts and is declared in registry.json (§106). Adding a marketplace requires only (§197):

  1. metadata — an entry in registry.json (module points to the folder, e.g. "api/scryfall");
  2. extraction schema — the payload shape the connector captures in crawl() (typed with Zod);
  3. normalization adapter — a pure normalize(raw) returning canonical NormalizedRecord[];
  4. fixtures — at least one real captured payload in data/fixtures/<source-id>/*.json and a *.test.ts next to the connector calling runFixtureSuite.

The generic pipeline (raw store → normalizer → entity resolution → dedupe → validation → canonical tables → valuation → indices) then works without changes.

Rules: never invent data, keep source quirks inside the connector, store the source's own dates, keep the native currency, respect robots/terms/rate limits, and never bypass access controls (§179).

Module contract: export default (meta: ConnectorMeta) => RareIndexConnector.

Full guide: docs/connectors/ADDING_A_CONNECTOR.md (scaffold with pnpm connector:new, adapters for Shopify/ WooCommerce/sitemaps/RSS/PDF/JSON-LD, per-host policies in domains.json + domains.d/, source catalogue in data/sources/entries/, resumable backfills, health and drift monitoring).