IFClite TypeScript API
    Preparing search index...

    Class OciClient

    OCI distribution client: list tags, fetch a manifest, fetch a digest-verified blob, and push blobs and manifests. Every request starts anonymous and authenticates only when the registry answers 401 (see RegistryAuth for where credentials may and may not go). Pulls ask for repository:<repo>:pull, pushes for repository:<repo>:pull,push; tokens are cached per scope, so the two never share one.

    Index
    • Fetches a blob and verifies it against descriptor: exactly descriptor.size bytes (never more than maxBytes) hashing to descriptor.digest. Redirects (registries hand blobs to a CDN) are followed without Authorization.

      Parameters

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • Fetches a manifest or index by digest (preferred when both are present) or tag. The digest is always computed from the received bytes; it must equal ref.digest when the reference pins one, and a Docker-Content-Digest header, when the registry sends one, is checked as well (its absence is fine: some registries omit it).

      Parameters

      • ref: OciReference
      • Optionaloptions: { signal?: AbortSignal }

      Returns Promise<OciManifestResult>

    • Uploads bytes as a blob and returns its digest and size. When the registry already holds a blob with that digest and size, nothing is uploaded. Otherwise a monolithic upload: POST /blobs/uploads/, then one PUT of the whole buffer to the returned Location (same origin only) with ?digest=. A Docker-Content-Digest reply must match.

      Parameters

      • ref: OciRepositoryRef
      • bytes: Uint8Array
      • Optionaloptions: { signal?: AbortSignal }

      Returns Promise<OciPushedBlob>

    • Uploads the OCI empty config blob ({}, 2 bytes) that buildImageManifest references by default, and returns its descriptor.

      Parameters

      Returns Promise<OciDescriptor>

    • Pushes a manifest or index whose own mediaType field equals mediaType, by ref.tag when present, else by its digest (a pinned ref.digest must match). Without allowOverwrite, an existing tag is TAG_EXISTS; that check runs before the PUT and is not atomic. Every blob the manifest names must already be in the repository.

      Parameters

      Returns Promise<OciPushedManifest>

    • Lists every tag, following Link: <...>; rel="next" pagination. A relative link resolves against the page URL; an absolute one must stay on the registry origin. More than maxPages (default 100) pages is PROTOCOL, as is a link that revisits a page.

      Parameters

      • ref: OciRepositoryRef
      • Optionaloptions: { maxPages?: number; signal?: AbortSignal }

      Returns Promise<string[]>