@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>
230 lines • 7.58 kB
TypeScript
import * as z from "zod/v3";
import { ClosedEnum } from "../types/enums.js";
import { Result as SafeParseResult } from "../types/fp.js";
import { SDKValidationError } from "./sdkvalidationerror.js";
/**
* The status of the current sandbox.
*/
export declare const NamedSandboxStatus: {
readonly Running: "running";
readonly Stopped: "stopped";
readonly Stopping: "stopping";
};
/**
* The status of the current sandbox.
*/
export type NamedSandboxStatus = ClosedEnum<typeof NamedSandboxStatus>;
/**
* The regions the sandbox fails over to. Empty when it does not fail over.
*/
export declare const FailoverRegions: {
readonly Arn1: "arn1";
readonly Bom1: "bom1";
readonly Cdg1: "cdg1";
readonly Cle1: "cle1";
readonly Cpt1: "cpt1";
readonly Dub1: "dub1";
readonly Fra1: "fra1";
readonly Gru1: "gru1";
readonly Hkg1: "hkg1";
readonly Hnd1: "hnd1";
readonly Iad1: "iad1";
readonly Icn1: "icn1";
readonly Kix1: "kix1";
readonly Lhr1: "lhr1";
readonly Pdx1: "pdx1";
readonly Sfo1: "sfo1";
readonly Sin1: "sin1";
readonly Syd1: "syd1";
readonly Yul1: "yul1";
};
/**
* The regions the sandbox fails over to. Empty when it does not fail over.
*/
export type FailoverRegions = ClosedEnum<typeof FailoverRegions>;
/**
* Keep-last snapshot configuration.
*/
export type KeepLastSnapshots = {
/**
* Number of most recent snapshots to keep.
*/
count: number;
/**
* Expiration time in milliseconds for kept snapshots.
*/
expiration?: number | undefined;
/**
* Whether to immediately delete evicted snapshots.
*/
deleteEvicted: boolean;
};
export declare const NamedSandboxNetworkPolicyMode: {
readonly AllowAll: "allow-all";
readonly Custom: "custom";
readonly DefaultAllow: "default-allow";
readonly DefaultDeny: "default-deny";
readonly DenyAll: "deny-all";
};
export type NamedSandboxNetworkPolicyMode = ClosedEnum<typeof NamedSandboxNetworkPolicyMode>;
/**
* Network policy configuration.
*/
export type NetworkPolicy = {
mode: NamedSandboxNetworkPolicyMode;
allowedDomains?: Array<string> | undefined;
allowedCIDRs?: Array<string> | undefined;
deniedCIDRs?: Array<string> | undefined;
s3Key?: string | undefined;
};
export declare const NamedSandboxMode: {
readonly ReadOnly: "read-only";
readonly ReadWrite: "read-write";
readonly Snapshot: "snapshot";
};
export type NamedSandboxMode = ClosedEnum<typeof NamedSandboxMode>;
/**
* Key-value pairs of mount path and drive.
*/
export type Mounts = {
drive: string;
mode?: NamedSandboxMode | undefined;
};
/**
* This object contains information related to a Vercel NamedSandbox.
*/
export type NamedSandbox = {
/**
* The unique identifier of the sandbox.
*/
name: string;
/**
* Current snapshot ID that the named sandbox is pointing to.
*/
currentSnapshotId?: string | undefined;
/**
* Current session ID the sandbox is pointing to.
*/
currentSessionId: string;
/**
* The status of the current sandbox.
*/
status: NamedSandboxStatus;
/**
* The time when the sandbox status was last updated, in milliseconds since the epoch.
*/
statusUpdatedAt: number;
/**
* Whether the sandbox persists its state across restarts via automatic snapshots.
*/
persistent: boolean;
/**
* The region the sandbox is pinned to: the region stored on the sandbox, otherwise the platform default. Where a running session actually landed is reported by `session.region`.
*/
region?: string | undefined;
/**
* The regions the sandbox fails over to. Empty when it does not fail over.
*/
failoverRegions?: Array<FailoverRegions> | undefined;
/**
* Number of virtual CPUs allocated.
*/
vcpus?: number | undefined;
/**
* Memory allocated in MB.
*/
memory?: number | undefined;
/**
* Runtime identifier.
*/
runtime?: string | undefined;
/**
* Digest-pinned reference of the container image the sandbox was created from, when it was created from an image ("{repository}@{manifestDigest}").
*/
image?: string | undefined;
/**
* Timeout in milliseconds.
*/
timeout?: number | undefined;
/**
* Default snapshot expiration time in milliseconds. 0 means no expiration.
*/
snapshotExpiration?: number | undefined;
/**
* Keep-last snapshot configuration.
*/
keepLastSnapshots?: KeepLastSnapshots | undefined;
/**
* Network policy configuration.
*/
networkPolicy?: NetworkPolicy | undefined;
/**
* The Connect network id for the target Secure Compute private network.
*/
networkId?: string | undefined;
/**
* Cumulative egress bytes across all sandbox runs.
*/
totalEgressBytes?: number | undefined;
/**
* Cumulative ingress bytes across all sandbox runs.
*/
totalIngressBytes?: number | undefined;
/**
* Cumulative active CPU duration in milliseconds across all sandbox runs.
*/
totalActiveCpuDurationMs?: number | undefined;
/**
* Cumulative wall-clock duration in milliseconds across all sandbox runs.
*/
totalDurationMs?: number | undefined;
/**
* The working directory of the sandbox.
*/
cwd?: string | undefined;
/**
* Key-value tags attached to the named sandbox.
*/
tags?: {
[k: string]: string;
} | undefined;
/**
* Key-value pairs of mount path and drive.
*/
mounts?: {
[k: string]: Mounts;
} | undefined;
/**
* The time when the named sandbox was created, in milliseconds since the epoch.
*/
createdAt: number;
/**
* The time when the named sandbox was last updated, in milliseconds since the epoch.
*/
updatedAt: number;
/**
* The time at which the currently running sandbox will time out, in milliseconds since the epoch. Only present while a session is running.
*/
expiresAt?: number | undefined;
};
/** @internal */
export declare const NamedSandboxStatus$inboundSchema: z.ZodNativeEnum<typeof NamedSandboxStatus>;
/** @internal */
export declare const FailoverRegions$inboundSchema: z.ZodNativeEnum<typeof FailoverRegions>;
/** @internal */
export declare const KeepLastSnapshots$inboundSchema: z.ZodType<KeepLastSnapshots, z.ZodTypeDef, unknown>;
export declare function keepLastSnapshotsFromJSON(jsonString: string): SafeParseResult<KeepLastSnapshots, SDKValidationError>;
/** @internal */
export declare const NamedSandboxNetworkPolicyMode$inboundSchema: z.ZodNativeEnum<typeof NamedSandboxNetworkPolicyMode>;
/** @internal */
export declare const NetworkPolicy$inboundSchema: z.ZodType<NetworkPolicy, z.ZodTypeDef, unknown>;
export declare function networkPolicyFromJSON(jsonString: string): SafeParseResult<NetworkPolicy, SDKValidationError>;
/** @internal */
export declare const NamedSandboxMode$inboundSchema: z.ZodNativeEnum<typeof NamedSandboxMode>;
/** @internal */
export declare const Mounts$inboundSchema: z.ZodType<Mounts, z.ZodTypeDef, unknown>;
export declare function mountsFromJSON(jsonString: string): SafeParseResult<Mounts, SDKValidationError>;
/** @internal */
export declare const NamedSandbox$inboundSchema: z.ZodType<NamedSandbox, z.ZodTypeDef, unknown>;
export declare function namedSandboxFromJSON(jsonString: string): SafeParseResult<NamedSandbox, SDKValidationError>;
//# sourceMappingURL=namedsandbox.d.ts.map