SPB Git

spb/rareindex

Public
1.1 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.

Files · d93392862678cbf30e175697fcb812bc4ff0b5a7
Menu

Theme