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>

59 lines 2.18 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../lib/schemas.js"; import * as types from "../types/primitives.js"; import { SandboxNetworkPolicy$inboundSchema, } from "./sandboxnetworkpolicy.js"; /** * The status of the sandbox. */ export const SessionStatus = { Aborted: "aborted", Failed: "failed", Pending: "pending", Running: "running", Snapshotting: "snapshotting", Stopped: "stopped", Stopping: "stopping", }; /** @internal */ export const SessionStatus$inboundSchema = z.nativeEnum(SessionStatus); /** @internal */ export const NetworkTransfer$inboundSchema = z.object({ ingress: types.number(), egress: types.number(), }); export function networkTransferFromJSON(jsonString) { return safeParse(jsonString, (x) => NetworkTransfer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NetworkTransfer' from JSON`); } /** @internal */ export const Session$inboundSchema = z.object({ sourceSandboxName: types.string(), projectId: types.string(), id: types.string(), memory: types.number(), vcpus: types.number(), region: types.string(), runtime: types.string(), timeout: types.number(), status: SessionStatus$inboundSchema, requestedAt: types.number(), startedAt: types.optional(types.number()), cwd: types.string(), requestedStopAt: types.optional(types.number()), stoppedAt: types.optional(types.number()), abortedAt: types.optional(types.number()), duration: types.optional(types.number()), sourceSnapshotId: types.optional(types.string()), snapshottedAt: types.optional(types.number()), createdAt: types.number(), updatedAt: types.number(), networkPolicy: types.optional(SandboxNetworkPolicy$inboundSchema), activeCpuDurationMs: types.optional(types.number()), networkTransfer: types.optional(z.lazy(() => NetworkTransfer$inboundSchema)), }); export function sessionFromJSON(jsonString) { return safeParse(jsonString, (x) => Session$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Session' from JSON`); } //# sourceMappingURL=session.js.map