UNPKG

@vercel/sdk

Version:

<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>

278 lines 13.8 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { vcrAddRepositoryPermission } from "../funcs/vcrAddRepositoryPermission.js"; import { vcrClearRepositoryPermissions } from "../funcs/vcrClearRepositoryPermissions.js"; import { vcrCreateByTeamSlugByProjectSlugByRepositoryNameBlobsUploads } from "../funcs/vcrCreateByTeamSlugByProjectSlugByRepositoryNameBlobsUploads.js"; import { vcrCreateRepository } from "../funcs/vcrCreateRepository.js"; import { vcrDeleteByTeamSlugByProjectSlugByRepositoryNameBlobsByDigest } from "../funcs/vcrDeleteByTeamSlugByProjectSlugByRepositoryNameBlobsByDigest.js"; import { vcrDeleteByTeamSlugByProjectSlugByRepositoryNameBlobsUploadsByUuid } from "../funcs/vcrDeleteByTeamSlugByProjectSlugByRepositoryNameBlobsUploadsByUuid.js"; import { vcrDeleteByTeamSlugByProjectSlugByRepositoryNameManifestsByReference } from "../funcs/vcrDeleteByTeamSlugByProjectSlugByRepositoryNameManifestsByReference.js"; import { vcrDeleteRepository } from "../funcs/vcrDeleteRepository.js"; import { vcrDeleteRepositoryImage } from "../funcs/vcrDeleteRepositoryImage.js"; import { vcrGetByTeamSlugByProjectSlugByRepositoryNameBlobsByDigest } from "../funcs/vcrGetByTeamSlugByProjectSlugByRepositoryNameBlobsByDigest.js"; import { vcrGetByTeamSlugByProjectSlugByRepositoryNameBlobsUploadsByUuid } from "../funcs/vcrGetByTeamSlugByProjectSlugByRepositoryNameBlobsUploadsByUuid.js"; import { vcrGetByTeamSlugByProjectSlugByRepositoryNameManifestsByReference } from "../funcs/vcrGetByTeamSlugByProjectSlugByRepositoryNameManifestsByReference.js"; import { vcrGetByTeamSlugByProjectSlugByRepositoryNameTagsList } from "../funcs/vcrGetByTeamSlugByProjectSlugByRepositoryNameTagsList.js"; import { vcrGetRepository } from "../funcs/vcrGetRepository.js"; import { vcrGetRepositoryImage } from "../funcs/vcrGetRepositoryImage.js"; import { vcrGetRepositoryTag } from "../funcs/vcrGetRepositoryTag.js"; import { vcrGetRoot } from "../funcs/vcrGetRoot.js"; import { vcrHeadByTeamSlugByProjectSlugByRepositoryNameBlobsByDigest } from "../funcs/vcrHeadByTeamSlugByProjectSlugByRepositoryNameBlobsByDigest.js"; import { vcrHeadByTeamSlugByProjectSlugByRepositoryNameManifestsByReference } from "../funcs/vcrHeadByTeamSlugByProjectSlugByRepositoryNameManifestsByReference.js"; import { vcrListRepositories } from "../funcs/vcrListRepositories.js"; import { vcrListRepositoryImages } from "../funcs/vcrListRepositoryImages.js"; import { vcrListRepositoryPermissions } from "../funcs/vcrListRepositoryPermissions.js"; import { vcrListRepositoryTags } from "../funcs/vcrListRepositoryTags.js"; import { vcrRemoveRepositoryPermission } from "../funcs/vcrRemoveRepositoryPermission.js"; import { vcrReplaceByTeamSlugByProjectSlugByRepositoryNameBlobsUploadsByUuid } from "../funcs/vcrReplaceByTeamSlugByProjectSlugByRepositoryNameBlobsUploadsByUuid.js"; import { vcrReplaceByTeamSlugByProjectSlugByRepositoryNameManifestsByReference } from "../funcs/vcrReplaceByTeamSlugByProjectSlugByRepositoryNameManifestsByReference.js"; import { vcrUpdateByTeamSlugByProjectSlugByRepositoryNameBlobsUploadsByUuid } from "../funcs/vcrUpdateByTeamSlugByProjectSlugByRepositoryNameBlobsUploadsByUuid.js"; import { ClientSDK } from "../lib/sdks.js"; import { unwrapAsync } from "../types/fp.js"; export class Vcr extends ClientSDK { /** * Create a repository * * @remarks * Create a container registry repository for a project. */ async createRepository(request, options) { return unwrapAsync(vcrCreateRepository(this, request, options)); } /** * List repositories * * @remarks * List container registry repositories for a project. */ async listRepositories(request, options) { return unwrapAsync(vcrListRepositories(this, request, options)); } /** * Get a repository * * @remarks * Fetch a container registry repository for a project by ID or name. */ async getRepository(request, options) { return unwrapAsync(vcrGetRepository(this, request, options)); } /** * Delete a repository * * @remarks * Schedule a repository for deletion. The repository is marked so it disappears from list/get immediately; subscriber-vcr reclaims every image (manifests, blobs, tags and rows) and finally deletes the repository row asynchronously via the VcrRepositoryRemoved event. */ async deleteRepository(request, options) { return unwrapAsync(vcrDeleteRepository(this, request, options)); } /** * List repository images * * @remarks * List images for a container registry repository, including their tags. */ async listRepositoryImages(request, options) { return unwrapAsync(vcrListRepositoryImages(this, request, options)); } /** * Add a repository permission * * @remarks * Grant a team access to a VCR repository. Sharing applies to the whole repository. */ async addRepositoryPermission(request, options) { return unwrapAsync(vcrAddRepositoryPermission(this, request, options)); } /** * Remove a repository permission * * @remarks * Revoke a team's access to a VCR repository. */ async removeRepositoryPermission(request, options) { return unwrapAsync(vcrRemoveRepositoryPermission(this, request, options)); } /** * List repository permissions * * @remarks * List the teams a VCR repository is shared with. */ async listRepositoryPermissions(request, options) { return unwrapAsync(vcrListRepositoryPermissions(this, request, options)); } /** * Clear all repository permissions * * @remarks * Revoke every team's access to a VCR repository. Clearing an unshared repository is a no-op. */ async clearRepositoryPermissions(request, options) { return unwrapAsync(vcrClearRepositoryPermissions(this, request, options)); } /** * List repository tags * * @remarks * List a repository's tags. */ async listRepositoryTags(request, options) { return unwrapAsync(vcrListRepositoryTags(this, request, options)); } /** * Get a repository tag * * @remarks * Fetch a single tag from a repository, including the backing image's metadata and VHS-readiness status. */ async getRepositoryTag(request, options) { return unwrapAsync(vcrGetRepositoryTag(this, request, options)); } /** * Get a repository image * * @remarks * Fetch an individual image from a repository, including its tags and Dockerfile history entries with discriminated layer details for UI rendering. The image may be addressed by its internal id (`image_...`) or by its manifest digest (`sha256:...`). */ async getRepositoryImage(request, options) { return unwrapAsync(vcrGetRepositoryImage(this, request, options)); } /** * Delete a repository image * * @remarks * Schedule an image for deletion. The image is marked so it disappears from list/get immediately; subscriber-vcr reclaims the manifest, blobs, tags and row asynchronously via the VcrManifestRemoved event. */ async deleteRepositoryImage(request, options) { return unwrapAsync(vcrDeleteRepositoryImage(this, request, options)); } /** * Check registry API version support * * @remarks * GET /v2/ Docker Registry v2 version check. Returns a 401 challenge when no credentials are provided, prompting the Docker client to send auth. With valid credentials, returns 200 so the client can proceed. */ async getRoot(options) { return unwrapAsync(vcrGetRoot(this, options)); } /** * Check if a blob exists * * @remarks * HEAD /v2/:teamSlug/:projectSlug/:repositoryName/blobs/:digest Check whether a blob exists. Used by the Docker client before pushing a layer to avoid re-uploading content that already exists. */ async headByTeamSlugByProjectSlugByRepositoryNameBlobsByDigest(request, options) { return unwrapAsync(vcrHeadByTeamSlugByProjectSlugByRepositoryNameBlobsByDigest(this, request, options)); } /** * Download a blob * * @remarks * GET /v2/:teamSlug/:projectSlug/:repositoryName/blobs/:digest Fetch a blob by digest. */ async getByTeamSlugByProjectSlugByRepositoryNameBlobsByDigest(request, options) { return unwrapAsync(vcrGetByTeamSlugByProjectSlugByRepositoryNameBlobsByDigest(this, request, options)); } /** * Delete a blob * * @remarks * DELETE /v2/:teamSlug/:projectSlug/:repositoryName/blobs/:digest Blob deletion is intentionally not supported. Matches the behaviour of most public registries. */ async deleteByTeamSlugByProjectSlugByRepositoryNameBlobsByDigest(request, options) { return unwrapAsync(vcrDeleteByTeamSlugByProjectSlugByRepositoryNameBlobsByDigest(this, request, options)); } /** * Get blob upload status * * @remarks * GET /v2/:teamSlug/:projectSlug/:repositoryName/blobs/uploads/:uuid Query the status of an in-progress blob upload. Used by clients to resume a partial upload after an interruption. */ async getByTeamSlugByProjectSlugByRepositoryNameBlobsUploadsByUuid(request, options) { return unwrapAsync(vcrGetByTeamSlugByProjectSlugByRepositoryNameBlobsUploadsByUuid(this, request, options)); } /** * Cancel a blob upload * * @remarks * DELETE /v2/:teamSlug/:projectSlug/:repositoryName/blobs/uploads/:uuid Cancel an in-flight blob upload. Aborts the underlying S3 multipart upload (if one was started) and discards the session. */ async deleteByTeamSlugByProjectSlugByRepositoryNameBlobsUploadsByUuid(request, options) { return unwrapAsync(vcrDeleteByTeamSlugByProjectSlugByRepositoryNameBlobsUploadsByUuid(this, request, options)); } /** * Upload a blob chunk * * @remarks * PATCH /v2/:teamSlug/:projectSlug/:repositoryName/blobs/uploads/:uuid Upload a chunk of blob data. The request body is streamed directly to S3 as a multipart upload part while hashing incrementally. The client may call this multiple times for chunked uploads. */ async updateByTeamSlugByProjectSlugByRepositoryNameBlobsUploadsByUuid(request, options) { return unwrapAsync(vcrUpdateByTeamSlugByProjectSlugByRepositoryNameBlobsUploadsByUuid(this, request, options)); } /** * Complete a blob upload * * @remarks * PUT /v2/:teamSlug/:projectSlug/:repositoryName/blobs/uploads/:uuid?digest=<digest> Complete the blob upload. This may include a final chunk of data in the request body (monolithic upload) or just finalize a previous chunked upload. */ async replaceByTeamSlugByProjectSlugByRepositoryNameBlobsUploadsByUuid(request, options) { return unwrapAsync(vcrReplaceByTeamSlugByProjectSlugByRepositoryNameBlobsUploadsByUuid(this, request, options)); } /** * Start a blob upload * * @remarks * POST /v2/:teamSlug/:projectSlug/:repositoryName/blobs/uploads/[?mount=<digest>&from=<repo>] Initiate a blob upload. Returns a UUID in the Location header that the client uses for subsequent PATCH (chunk) and PUT (complete) requests. */ async createByTeamSlugByProjectSlugByRepositoryNameBlobsUploads(request, options) { return unwrapAsync(vcrCreateByTeamSlugByProjectSlugByRepositoryNameBlobsUploads(this, request, options)); } /** * Push an image manifest * * @remarks * PUT /v2/:teamSlug/:projectSlug/:repositoryName/manifests/:reference Upload an image manifest. The digest is computed from the body and returned in the Docker-Content-Digest header. */ async replaceByTeamSlugByProjectSlugByRepositoryNameManifestsByReference(request, options) { return unwrapAsync(vcrReplaceByTeamSlugByProjectSlugByRepositoryNameManifestsByReference(this, request, options)); } /** * Check if a manifest exists * * @remarks * HEAD /v2/:teamSlug/:projectSlug/:repositoryName/manifests/:reference Check whether a manifest exists. Used by Docker client during push to determine if a manifest (or config blob referenced by digest) is already present. */ async headByTeamSlugByProjectSlugByRepositoryNameManifestsByReference(request, options) { return unwrapAsync(vcrHeadByTeamSlugByProjectSlugByRepositoryNameManifestsByReference(this, request, options)); } /** * Pull an image manifest * * @remarks * GET /v2/:teamSlug/:projectSlug/:repositoryName/manifests/:reference Fetch a manifest by tag or digest. */ async getByTeamSlugByProjectSlugByRepositoryNameManifestsByReference(request, options) { return unwrapAsync(vcrGetByTeamSlugByProjectSlugByRepositoryNameManifestsByReference(this, request, options)); } /** * Delete an image manifest * * @remarks * DELETE /v2/:teamSlug/:projectSlug/:repositoryName/manifests/:reference Reference must be a digest. */ async deleteByTeamSlugByProjectSlugByRepositoryNameManifestsByReference(request, options) { return unwrapAsync(vcrDeleteByTeamSlugByProjectSlugByRepositoryNameManifestsByReference(this, request, options)); } /** * List image tags * * @remarks * GET /v2/:teamSlug/:projectSlug/:repositoryName/tags/list List the tags in a repository. */ async getByTeamSlugByProjectSlugByRepositoryNameTagsList(request, options) { return unwrapAsync(vcrGetByTeamSlugByProjectSlugByRepositoryNameTagsList(this, request, options)); } } //# sourceMappingURL=vcr.js.map