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>

189 lines 8.27 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../lib/primitives.js"; import { safeParse } from "../lib/schemas.js"; import * as types from "../types/primitives.js"; import { smartUnion } from "../types/smartUnion.js"; export const UpdateSharedEnvVariableTarget = { Production: "production", Preview: "preview", Development: "development", }; /** * The new type of the Shared Environment Variable */ export const UpdateSharedEnvVariableType = { Encrypted: "encrypted", Sensitive: "sensitive", }; /** * The type of this cosmos doc instance, if blank, assume secret. */ export const UpdateSharedEnvVariableEnvironmentType = { Encrypted: "encrypted", Plain: "plain", Sensitive: "sensitive", System: "system", }; /** * environments this env variable targets */ export const UpdateSharedEnvVariableEnvironmentTarget = { Development: "development", Preview: "preview", Production: "production", }; export const UpdateSharedEnvVariableValue2 = { Development: "development", Preview: "preview", Production: "production", }; export const UpdateSharedEnvVariableTarget2 = { Development: "development", Preview: "preview", Production: "production", }; export const UpdateSharedEnvVariableTarget1 = { Development: "development", Preview: "preview", Production: "production", }; /** @internal */ export const UpdateSharedEnvVariableTarget$outboundSchema = z.nativeEnum(UpdateSharedEnvVariableTarget); /** @internal */ export const ProjectIdUpdates$outboundSchema = z.object({ link: z.array(z.string()).optional(), unlink: z.array(z.string()).optional(), }); export function projectIdUpdatesToJSON(projectIdUpdates) { return JSON.stringify(ProjectIdUpdates$outboundSchema.parse(projectIdUpdates)); } /** @internal */ export const UpdateSharedEnvVariableType$outboundSchema = z.nativeEnum(UpdateSharedEnvVariableType); /** @internal */ export const Updates$outboundSchema = z.object({ key: z.string().optional(), value: z.string().optional(), target: z.array(UpdateSharedEnvVariableTarget$outboundSchema).optional(), projectId: z.array(z.string()).optional(), projectIdUpdates: z.lazy(() => ProjectIdUpdates$outboundSchema).optional(), type: UpdateSharedEnvVariableType$outboundSchema.optional(), comment: z.string().optional(), }); export function updatesToJSON(updates) { return JSON.stringify(Updates$outboundSchema.parse(updates)); } /** @internal */ export const UpdateSharedEnvVariableRequestBody$outboundSchema = z.object({ updates: z.record(z.lazy(() => Updates$outboundSchema)), }); export function updateSharedEnvVariableRequestBodyToJSON(updateSharedEnvVariableRequestBody) { return JSON.stringify(UpdateSharedEnvVariableRequestBody$outboundSchema.parse(updateSharedEnvVariableRequestBody)); } /** @internal */ export const UpdateSharedEnvVariableRequest$outboundSchema = z.object({ teamId: z.string().optional(), slug: z.string().optional(), requestBody: z.lazy(() => UpdateSharedEnvVariableRequestBody$outboundSchema) .optional(), }).transform((v) => { return remap$(v, { requestBody: "RequestBody", }); }); export function updateSharedEnvVariableRequestToJSON(updateSharedEnvVariableRequest) { return JSON.stringify(UpdateSharedEnvVariableRequest$outboundSchema.parse(updateSharedEnvVariableRequest)); } /** @internal */ export const UpdateSharedEnvVariableEnvironmentType$inboundSchema = z.nativeEnum(UpdateSharedEnvVariableEnvironmentType); /** @internal */ export const UpdateSharedEnvVariableEnvironmentTarget$inboundSchema = z .nativeEnum(UpdateSharedEnvVariableEnvironmentTarget); /** @internal */ export const Updated$inboundSchema = z.object({ created: types.optional(types.date()), key: types.optional(types.string()), ownerId: z.nullable(types.string()).optional(), id: types.optional(types.string()), createdBy: z.nullable(types.string()).optional(), deletedBy: z.nullable(types.string()).optional(), updatedBy: z.nullable(types.string()).optional(), createdAt: types.optional(types.number()), deletedAt: types.optional(types.number()), updatedAt: types.optional(types.number()), value: types.optional(types.string()), projectId: types.optional(z.array(types.string())), type: types.optional(UpdateSharedEnvVariableEnvironmentType$inboundSchema), target: types.optional(z.array(UpdateSharedEnvVariableEnvironmentTarget$inboundSchema)), applyToAllCustomEnvironments: types.optional(types.boolean()), customEnvironmentIds: types.optional(z.array(types.string())), decrypted: types.optional(types.boolean()), comment: types.optional(types.string()), lastEditedByDisplayName: types.optional(types.string()), }); export function updatedFromJSON(jsonString) { return safeParse(jsonString, (x) => Updated$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Updated' from JSON`); } /** @internal */ export const UpdateSharedEnvVariableValue2$inboundSchema = z.nativeEnum(UpdateSharedEnvVariableValue2); /** @internal */ export const UpdateSharedEnvVariableValue$inboundSchema = smartUnion([ types.string(), z.array(UpdateSharedEnvVariableValue2$inboundSchema), ]); export function updateSharedEnvVariableValueFromJSON(jsonString) { return safeParse(jsonString, (x) => UpdateSharedEnvVariableValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateSharedEnvVariableValue' from JSON`); } /** @internal */ export const UpdateSharedEnvVariableTarget2$inboundSchema = z.nativeEnum(UpdateSharedEnvVariableTarget2); /** @internal */ export const UpdateSharedEnvVariableTarget1$inboundSchema = z.nativeEnum(UpdateSharedEnvVariableTarget1); /** @internal */ export const UpdateSharedEnvVariableEnvironmentResponseTarget$inboundSchema = smartUnion([ z.array(UpdateSharedEnvVariableTarget1$inboundSchema), UpdateSharedEnvVariableTarget2$inboundSchema, ]); export function updateSharedEnvVariableEnvironmentResponseTargetFromJSON(jsonString) { return safeParse(jsonString, (x) => UpdateSharedEnvVariableEnvironmentResponseTarget$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateSharedEnvVariableEnvironmentResponseTarget' from JSON`); } /** @internal */ export const UpdateSharedEnvVariableError$inboundSchema = z.object({ code: types.string(), message: types.string(), key: types.optional(types.string()), envVarId: types.optional(types.string()), envVarKey: types.optional(types.string()), action: types.optional(types.string()), link: types.optional(types.string()), value: types.optional(smartUnion([ types.string(), z.array(UpdateSharedEnvVariableValue2$inboundSchema), ])), gitBranch: types.optional(types.string()), target: types.optional(smartUnion([ z.array(UpdateSharedEnvVariableTarget1$inboundSchema), UpdateSharedEnvVariableTarget2$inboundSchema, ])), project: types.optional(types.string()), }); export function updateSharedEnvVariableErrorFromJSON(jsonString) { return safeParse(jsonString, (x) => UpdateSharedEnvVariableError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateSharedEnvVariableError' from JSON`); } /** @internal */ export const UpdateSharedEnvVariableFailed$inboundSchema = z.object({ error: z.lazy(() => UpdateSharedEnvVariableError$inboundSchema), }); export function updateSharedEnvVariableFailedFromJSON(jsonString) { return safeParse(jsonString, (x) => UpdateSharedEnvVariableFailed$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateSharedEnvVariableFailed' from JSON`); } /** @internal */ export const UpdateSharedEnvVariableResponseBody$inboundSchema = z.object({ updated: z.array(z.lazy(() => Updated$inboundSchema)), failed: z.array(z.lazy(() => UpdateSharedEnvVariableFailed$inboundSchema)), }); export function updateSharedEnvVariableResponseBodyFromJSON(jsonString) { return safeParse(jsonString, (x) => UpdateSharedEnvVariableResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateSharedEnvVariableResponseBody' from JSON`); } //# sourceMappingURL=updatesharedenvvariableop.js.map