Lightning.Adaptors.NPM (Lightning v2.19.0)

View Source

Production implementation of Lightning.Adaptors.Strategy that talks to the public NPM registry and the OpenFn adaptors monorepo on GitHub.

HTTP

The HTTP work lives in three sub-modules, each with its own Tesla client and base URL: Lightning.Adaptors.NPM.Registry, Lightning.Adaptors.NPM.Schema and Lightning.Adaptors.NPM.GitHub.

Every request is single-shot and bounded by http_timeout. There is no retry, backoff or circuit breaker. A transient failure (5xx, timeout, nxdomain) of the primary request (the packument for fetch_adaptor/1, the org listing for list_adaptors/0 and fetch_icons/1) surfaces as {:error, term()} unchanged, and a failed schema fetch inside fetch_adaptor/1 as {:error, {:schema_fetch_failed, reason}}. Icon fetches inside fetch_icons/1 are best-effort instead: a miss degrades to an absent icon shape rather than failing the batch.

Configuration

The sub-modules read :registry_url, :jsdelivr_url, :github_url, :github_ref and :http_timeout from Lightning.Adaptors.Config.strategy_opts(Lightning.Adaptors.NPM). All three share this module's config key rather than having their own, and each key has a default so the module works with no Application env set.