ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Registry.Npm.Wire

Description

The npm wire JSON types and their decoders: the decode-only protocol boundary.

Every decoder is lenient in the ways the public registry requires. Unknown keys are ignored, license and a person arrive as a string or an object, deprecated as a string or a boolean, and an undecodable advisory unpackedSize reads as absent rather than failing the version. The shapes come from live captures of registry.npmjs.org, kept as fixtures under core/test/unit/fixtures/npm/.

Synopsis

Shared scalars

data Person Source #

A person on a package: an author, maintainer, contributor, or a version's publisher. A packed "Name <email> (url)" string, npm's other form, stays verbatim in personName.

Constructors

Person 

Fields

Instances

Instances details
FromJSON Person Source # 
Instance details

Defined in Ecluse.Core.Registry.Npm.Wire

Show Person Source # 
Instance details

Defined in Ecluse.Core.Registry.Npm.Wire

Eq Person Source # 
Instance details

Defined in Ecluse.Core.Registry.Npm.Wire

Methods

(==) :: Person -> Person -> Bool #

(/=) :: Person -> Person -> Bool #

Ord Person Source # 
Instance details

Defined in Ecluse.Core.Registry.Npm.Wire

data License Source #

A declared license, in npm's modern string form or its legacy object form.

Constructors

LicenseSpdx Text

An SPDX expression or identifier (MIT, "(MIT OR Apache-2.0)").

LicenseObject Text (Maybe Text)

The legacy {type, url?} object: a license name and a URL to its text.

The dist object

data Dist Source #

The artifact descriptor every version manifest carries. A client fails the install when the bytes mismatch, so a mirror or a URL rewrite preserves the digests byte for byte.

Constructors

Dist 

Fields

Instances

Instances details
FromJSON Dist Source # 
Instance details

Defined in Ecluse.Core.Registry.Npm.Wire

Show Dist Source # 
Instance details

Defined in Ecluse.Core.Registry.Npm.Wire

Methods

showsPrec :: Int -> Dist -> ShowS #

show :: Dist -> String #

showList :: [Dist] -> ShowS #

Eq Dist Source # 
Instance details

Defined in Ecluse.Core.Registry.Npm.Wire

Methods

(==) :: Dist -> Dist -> Bool #

(/=) :: Dist -> Dist -> Bool #

Ord Dist Source # 
Instance details

Defined in Ecluse.Core.Registry.Npm.Wire

Methods

compare :: Dist -> Dist -> Ordering #

(<) :: Dist -> Dist -> Bool #

(<=) :: Dist -> Dist -> Bool #

(>) :: Dist -> Dist -> Bool #

(>=) :: Dist -> Dist -> Bool #

max :: Dist -> Dist -> Dist #

min :: Dist -> Dist -> Dist #

distFields :: [Text] Source #

The dist members the Dist parser reads.

Per-version manifest

data VersionManifest Source #

One version's manifest, decoding all three wire forms alike. The dependency maps and the maintainer list stay unparsed: nothing reads them, and the cost falls on every version.

Constructors

VersionManifest 

Fields