ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Registry.Npm.Route.Internal

Description

The npm route table itself: the router, the fallback action, the route-scoped pipeline contracts, the capture values, and the leaf parsers. Ecluse.Core.Registry.Npm.Route curates what a caller outside needs of it.

Importing this module opts out of the public surface's stability promises. It exists so a spec can match one route, one contract, or one parser on its own.

Synopsis

The mount's router and fallback action

npmRouter :: MountRouter Source #

Match the first applicable route, otherwise answer npmNotFound.

npmNotFound :: RouteAction Source #

The deny-by-default 404 action for a path no route claims.

Route-scoped pipeline contracts

npmTarballContract :: ResponseContract PassthroughResponse Source #

The tarball is deliberately an open relay: the route can forward any upstream status, headers, media type, and bytes.

The table, as data

npmRoutes :: [Route NpmCap] Source #

Try reserved meta-routes before package captures.

npmRouteSpecs :: NonEmpty RouteSpec Source #

Describe the live router and its deny-by-default catch-all for OpenAPI.

The served artifact URL (rendered from the route that claims it)

tarballPath :: PackageName -> Text -> Maybe Text Source #

Render through the artifact route so generated URLs obey its capture rules.

The capture values and leaf parsers

data NpmCap Source #

Positional captures distinguish parsed package identities from checked path segments.

tarballCoordinate :: PackageName -> Text -> Maybe (Version, Filename) Source #

Parse an npm tarball-slot file into the Version and verbatim Filename it names for name.