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>

126 lines (117 loc) 3.64 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../lib/schemas.js"; import { ClosedEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { SDKValidationError } from "./sdkvalidationerror.js"; /** * Whether the manifest is a multi-platform image index, a single-platform image manifest or an attestation. */ export const VcrImageListItemKind = { Attestation: "attestation", Index: "index", Manifest: "manifest", } as const; /** * Whether the manifest is a multi-platform image index, a single-platform image manifest or an attestation. */ export type VcrImageListItemKind = ClosedEnum<typeof VcrImageListItemKind>; /** * VHS-readiness status, or `null` for a multi-platform index. */ export const VcrImageListItemStatus = { Preparing: "preparing", Ready: "ready", Unoptimized: "unoptimized", } as const; /** * VHS-readiness status, or `null` for a multi-platform index. */ export type VcrImageListItemStatus = ClosedEnum<typeof VcrImageListItemStatus>; /** * An image enriched with its tags and VHS-readiness status, as returned when listing a repository's images. */ export type VcrImageListItem = { /** * Tags pointing at this image's manifest. */ tags: Array<string>; /** * Internal identifier of the image. */ id: string; /** * Identifier of the repository the image belongs to. */ repositoryId: string; /** * SHA-256 digest of the image manifest. */ manifestDigest: string; /** * Whether the manifest is a multi-platform image index, a single-platform image manifest or an attestation. */ kind: VcrImageListItemKind; /** * Operating system the manifest targets. Only present for single-platform manifests. */ platform?: string | undefined; /** * CPU architecture the manifest targets. Only present for single-platform manifests. */ arch?: string | undefined; /** * Identifier of the actor that pushed the image. */ pushedBy?: string | undefined; /** * Total size in bytes of the image's resources (manifest, config and layer blobs) stored by the registry. */ sizeInBytes: number; /** * VHS-readiness status, or `null` for a multi-platform index. */ status: VcrImageListItemStatus | null; /** * ISO 8601 timestamp of when the image was created. */ createdAt: string; }; /** @internal */ export const VcrImageListItemKind$inboundSchema: z.ZodNativeEnum< typeof VcrImageListItemKind > = z.nativeEnum(VcrImageListItemKind); /** @internal */ export const VcrImageListItemStatus$inboundSchema: z.ZodNativeEnum< typeof VcrImageListItemStatus > = z.nativeEnum(VcrImageListItemStatus); /** @internal */ export const VcrImageListItem$inboundSchema: z.ZodType< VcrImageListItem, z.ZodTypeDef, unknown > = z.object({ tags: z.array(types.string()), id: types.string(), repositoryId: types.string(), manifestDigest: types.string(), kind: VcrImageListItemKind$inboundSchema, platform: types.optional(types.string()), arch: types.optional(types.string()), pushedBy: types.optional(types.string()), sizeInBytes: types.number(), status: types.nullable(VcrImageListItemStatus$inboundSchema), createdAt: types.string(), }); export function vcrImageListItemFromJSON( jsonString: string, ): SafeParseResult<VcrImageListItem, SDKValidationError> { return safeParse( jsonString, (x) => VcrImageListItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VcrImageListItem' from JSON`, ); }