| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
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
- data Person = Person {
- personName :: Text
- personEmail :: Maybe Text
- personUrl :: Maybe Text
- data License
- data Dist = Dist {}
- distFields :: [Text]
- data VersionManifest = VersionManifest {}
Shared scalars
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
| |
A declared license, in npm's modern string form or its legacy object form.
Constructors
| LicenseSpdx Text | An SPDX expression or identifier ( |
| LicenseObject Text (Maybe Text) | The legacy |
The dist object
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
| |
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
| |
Instances
| FromJSON VersionManifest Source # | |
Defined in Ecluse.Core.Registry.Npm.Wire Methods parseJSON :: Value -> Parser VersionManifest # parseJSONList :: Value -> Parser [VersionManifest] # | |
| Show VersionManifest Source # | |
Defined in Ecluse.Core.Registry.Npm.Wire Methods showsPrec :: Int -> VersionManifest -> ShowS # show :: VersionManifest -> String # showList :: [VersionManifest] -> ShowS # | |
| Eq VersionManifest Source # | |
Defined in Ecluse.Core.Registry.Npm.Wire Methods (==) :: VersionManifest -> VersionManifest -> Bool # (/=) :: VersionManifest -> VersionManifest -> Bool # | |