ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Registry.Npm.Publish

Description

npm mirror upload data, publication, and the first-party upload guard. The checked mirror upload data keeps publication fields paired with the admitted tarball.

Synopsis

Documentation

data NpmUploadMetadata Source #

Original source fields bind the publication metadata to its admitted snapshot.

prepareNpmSource :: PackageName -> Version -> VersionDoc -> Either PublishFault (MirrorInventory, NpmUploadMetadata) Source #

Preserve the paired source fields and refuse an npm inventory with more than one physical tarball.

prepareNpmUpload :: MirrorInventory -> NpmUploadMetadata -> ExpectedMirrorFile -> VerifiedArtifactBytes -> Either PublishFault (MirrorUploadData NpmUploadMetadata) Source #

Bind npm source fields to this verified member of the complete version inventory.

npmPublishCodec :: ServicePresentation -> PublishCodec Source #

npm uses its ordinary bounded metadata reader and one immutable tarball upload per version.

publishRequest :: Text -> Maybe ClientCredential -> PackageName -> ByteString -> Either UrlFormationError Request Source #

Build the publish request with its credential, failing when the URL cannot be formed.

npmPublishDocument :: PublishPlan -> MirrorUploadData NpmUploadMetadata -> ByteString Source #

Preserve source metadata fields while replacing identity, attachment controls, and verified distribution facts.

uploadClaims :: ByteString -> Either PublishBodyFault [Text] Source #

The declared names of a new-release document, which never reads the attachment data beyond the JSON parse. A dependency a consumer's install would fetch from outside this proxy refuses the release.

npmNewReleaseOnly :: Text Source #

The 501 reason for a write that is not a new release, such as npm deprecate or npm star.

npmPublishAllowed :: [Scope] -> PackageName -> Bool Source #

Require an exact configured scope, refusing unscoped names and scope prefixes.