| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
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
- npmRouter :: MountRouter
- npmNotFound :: RouteAction
- npmPackumentContract :: ResponseContract NpmPackumentResponse
- npmPackumentReplies :: PackumentReplies NpmPackumentResponse
- npmTarballContract :: ResponseContract PassthroughResponse
- npmTarballReplies :: TarballReplies PassthroughResponse
- npmRoutes :: [Route NpmCap]
- npmRouteSpecs :: NonEmpty RouteSpec
- tarballPath :: PackageName -> Text -> Maybe Text
- data NpmCap
- takePackage :: [Text] -> Maybe (PackageName, [Text])
- tarballCoordinate :: PackageName -> Text -> Maybe (Version, Filename)
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
npmPackumentContract :: ResponseContract NpmPackumentResponse Source #
npmPackumentReplies :: PackumentReplies NpmPackumentResponse Source #
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
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
Positional captures distinguish parsed package identities from checked path segments.
Constructors
| NpmPackage PackageName | |
| NpmFilename Text | |
| NpmTag Text |
takePackage :: [Text] -> Maybe (PackageName, [Text]) Source #
tarballCoordinate :: PackageName -> Text -> Maybe (Version, Filename) Source #