ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Registry.Npm.Serve

Description

npm's client-facing error body, as a codec.

The agnostic serve layer decides a refusal's HTTP status. The body is npm's own {"error": ...} object, which its clients read the human-facing reason from. One autodocodec codec backs both the wire body and the OpenAPI schema, so the served denial and its documentation cannot diverge. The manifest runs in its own tier, so openapi3 never reaches the proxy.

Synopsis

Documentation

newtype NpmError Source #

npm's error body: the human-facing reason under a single error string (npmErrorKey).

Constructors

NpmError 

Fields

npmErrorCodec :: JSONCodec NpmError Source #

npm's error-body codec.

npmError :: Maybe HelpMessage -> Text -> NpmError Source #

Build an npm error body, appending the operator help message when one is configured.