@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>
318 lines • 13.5 kB
JavaScript
/*
* 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 EditProjectEnvTarget = {
Production: "production",
Preview: "preview",
Development: "development",
};
/**
* The type of environment variable
*/
export const EditProjectEnvType = {
System: "system",
Encrypted: "encrypted",
Plain: "plain",
Sensitive: "sensitive",
};
export const EditProjectEnvProjectsType = {
Encrypted: "encrypted",
Plain: "plain",
Secret: "secret",
Sensitive: "sensitive",
System: "system",
};
export const EditProjectEnvTarget2 = {
Development: "development",
Preview: "preview",
Production: "production",
};
export const EditProjectEnvTarget1 = {
Development: "development",
Preview: "preview",
Production: "production",
};
/**
* User-facing config/secret model. When set, authoritative for new code paths. Legacy rows omit this field and callers fall back to existing `type` behavior.
*/
export const EditProjectEnvVisibility = {
Config: "config",
Secret: "secret",
};
export const EditProjectEnvProjectsResponseType = {
FlagsSecret: "flags-secret",
};
/** @internal */
export const EditProjectEnvTarget$outboundSchema = z.nativeEnum(EditProjectEnvTarget);
/** @internal */
export const EditProjectEnvType$outboundSchema = z.nativeEnum(EditProjectEnvType);
/** @internal */
export const EditProjectEnvRequestBody$outboundSchema = z.object({
key: z.string().optional(),
target: z.array(EditProjectEnvTarget$outboundSchema).optional(),
gitBranch: z.nullable(z.string()).optional(),
type: EditProjectEnvType$outboundSchema.optional(),
value: z.string().optional(),
customEnvironmentIds: z.array(z.string()).optional(),
comment: z.string().optional(),
});
export function editProjectEnvRequestBodyToJSON(editProjectEnvRequestBody) {
return JSON.stringify(EditProjectEnvRequestBody$outboundSchema.parse(editProjectEnvRequestBody));
}
/** @internal */
export const EditProjectEnvRequest$outboundSchema = z.object({
idOrName: z.string(),
id: z.string(),
teamId: z.string().optional(),
slug: z.string().optional(),
requestBody: z.lazy(() => EditProjectEnvRequestBody$outboundSchema),
}).transform((v) => {
return remap$(v, {
requestBody: "RequestBody",
});
});
export function editProjectEnvRequestToJSON(editProjectEnvRequest) {
return JSON.stringify(EditProjectEnvRequest$outboundSchema.parse(editProjectEnvRequest));
}
/** @internal */
export const EditProjectEnvProjectsType$inboundSchema = z.nativeEnum(EditProjectEnvProjectsType);
/** @internal */
export const EditProjectEnvTarget2$inboundSchema = z.nativeEnum(EditProjectEnvTarget2);
/** @internal */
export const EditProjectEnvTarget1$inboundSchema = z.nativeEnum(EditProjectEnvTarget1);
/** @internal */
export const EditProjectEnvProjectsTarget$inboundSchema = smartUnion([
z.array(EditProjectEnvTarget1$inboundSchema),
EditProjectEnvTarget2$inboundSchema,
]);
export function editProjectEnvProjectsTargetFromJSON(jsonString) {
return safeParse(jsonString, (x) => EditProjectEnvProjectsTarget$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EditProjectEnvProjectsTarget' from JSON`);
}
/** @internal */
export const EditProjectEnvVisibility$inboundSchema = z.nativeEnum(EditProjectEnvVisibility);
/** @internal */
export const ContentHint17$inboundSchema = z.object({
type: types.literal("flags-connection-string"),
projectId: types.string(),
});
export function contentHint17FromJSON(jsonString) {
return safeParse(jsonString, (x) => ContentHint17$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentHint17' from JSON`);
}
/** @internal */
export const ContentHint16$inboundSchema = z.object({
type: types.literal("integration-store-secret"),
storeId: types.string(),
integrationId: types.string(),
integrationProductId: types.string(),
integrationConfigurationId: types.string(),
});
export function contentHint16FromJSON(jsonString) {
return safeParse(jsonString, (x) => ContentHint16$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentHint16' from JSON`);
}
/** @internal */
export const ContentHint15$inboundSchema = z.object({
type: types.literal("postgres-url-no-ssl"),
storeId: types.string(),
});
export function contentHint15FromJSON(jsonString) {
return safeParse(jsonString, (x) => ContentHint15$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentHint15' from JSON`);
}
/** @internal */
export const ContentHint14$inboundSchema = z.object({
type: types.literal("postgres-database"),
storeId: types.string(),
});
export function contentHint14FromJSON(jsonString) {
return safeParse(jsonString, (x) => ContentHint14$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentHint14' from JSON`);
}
/** @internal */
export const ContentHint13$inboundSchema = z.object({
type: types.literal("postgres-password"),
storeId: types.string(),
});
export function contentHint13FromJSON(jsonString) {
return safeParse(jsonString, (x) => ContentHint13$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentHint13' from JSON`);
}
/** @internal */
export const ContentHint12$inboundSchema = z.object({
type: types.literal("postgres-host"),
storeId: types.string(),
});
export function contentHint12FromJSON(jsonString) {
return safeParse(jsonString, (x) => ContentHint12$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentHint12' from JSON`);
}
/** @internal */
export const ContentHint11$inboundSchema = z.object({
type: types.literal("postgres-user"),
storeId: types.string(),
});
export function contentHint11FromJSON(jsonString) {
return safeParse(jsonString, (x) => ContentHint11$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentHint11' from JSON`);
}
/** @internal */
export const ContentHint10$inboundSchema = z.object({
type: types.literal("postgres-prisma-url"),
storeId: types.string(),
});
export function contentHint10FromJSON(jsonString) {
return safeParse(jsonString, (x) => ContentHint10$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentHint10' from JSON`);
}
/** @internal */
export const ContentHint9$inboundSchema = z.object({
type: types.literal("postgres-url-non-pooling"),
storeId: types.string(),
});
export function contentHint9FromJSON(jsonString) {
return safeParse(jsonString, (x) => ContentHint9$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentHint9' from JSON`);
}
/** @internal */
export const ContentHint8$inboundSchema = z.object({
type: types.literal("postgres-url"),
storeId: types.string(),
});
export function contentHint8FromJSON(jsonString) {
return safeParse(jsonString, (x) => ContentHint8$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentHint8' from JSON`);
}
/** @internal */
export const ContentHint7$inboundSchema = z.object({
type: types.literal("blob-webhook-public-key"),
storeId: types.string(),
});
export function contentHint7FromJSON(jsonString) {
return safeParse(jsonString, (x) => ContentHint7$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentHint7' from JSON`);
}
/** @internal */
export const ContentHint6$inboundSchema = z.object({
type: types.literal("blob-store-id"),
storeId: types.string(),
});
export function contentHint6FromJSON(jsonString) {
return safeParse(jsonString, (x) => ContentHint6$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentHint6' from JSON`);
}
/** @internal */
export const ContentHint5$inboundSchema = z.object({
type: types.literal("blob-read-write-token"),
storeId: types.string(),
});
export function contentHint5FromJSON(jsonString) {
return safeParse(jsonString, (x) => ContentHint5$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentHint5' from JSON`);
}
/** @internal */
export const ContentHint4$inboundSchema = z.object({
type: types.literal("redis-rest-api-read-only-token"),
storeId: types.string(),
});
export function contentHint4FromJSON(jsonString) {
return safeParse(jsonString, (x) => ContentHint4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentHint4' from JSON`);
}
/** @internal */
export const ContentHint3$inboundSchema = z.object({
type: types.literal("redis-rest-api-token"),
storeId: types.string(),
});
export function contentHint3FromJSON(jsonString) {
return safeParse(jsonString, (x) => ContentHint3$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentHint3' from JSON`);
}
/** @internal */
export const ContentHint2$inboundSchema = z.object({
type: types.literal("redis-rest-api-url"),
storeId: types.string(),
});
export function contentHint2FromJSON(jsonString) {
return safeParse(jsonString, (x) => ContentHint2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentHint2' from JSON`);
}
/** @internal */
export const ContentHint1$inboundSchema = z.object({
type: types.literal("redis-url"),
storeId: types.string(),
});
export function contentHint1FromJSON(jsonString) {
return safeParse(jsonString, (x) => ContentHint1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentHint1' from JSON`);
}
/** @internal */
export const ContentHint$inboundSchema = z.union([
z.lazy(() => ContentHint1$inboundSchema),
z.lazy(() => ContentHint2$inboundSchema),
z.lazy(() => ContentHint3$inboundSchema),
z.lazy(() => ContentHint4$inboundSchema),
z.lazy(() => ContentHint5$inboundSchema),
z.lazy(() => ContentHint6$inboundSchema),
z.lazy(() => ContentHint7$inboundSchema),
z.lazy(() => ContentHint8$inboundSchema),
z.lazy(() => ContentHint9$inboundSchema),
z.lazy(() => ContentHint10$inboundSchema),
z.lazy(() => ContentHint11$inboundSchema),
z.lazy(() => ContentHint12$inboundSchema),
z.lazy(() => ContentHint13$inboundSchema),
z.lazy(() => ContentHint14$inboundSchema),
z.lazy(() => ContentHint15$inboundSchema),
z.lazy(() => ContentHint16$inboundSchema),
z.lazy(() => ContentHint17$inboundSchema),
]);
export function contentHintFromJSON(jsonString) {
return safeParse(jsonString, (x) => ContentHint$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentHint' from JSON`);
}
/** @internal */
export const EditProjectEnvProjectsResponseType$inboundSchema = z.nativeEnum(EditProjectEnvProjectsResponseType);
/** @internal */
export const InternalContentHint$inboundSchema = z.object({
type: EditProjectEnvProjectsResponseType$inboundSchema,
encryptedValue: types.string(),
});
export function internalContentHintFromJSON(jsonString) {
return safeParse(jsonString, (x) => InternalContentHint$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InternalContentHint' from JSON`);
}
/** @internal */
export const EditProjectEnvResponseBody$inboundSchema = z.object({
type: EditProjectEnvProjectsType$inboundSchema,
value: types.string(),
edgeConfigId: z.nullable(types.string()).optional(),
edgeConfigTokenId: z.nullable(types.string()).optional(),
createdAt: types.optional(types.number()),
updatedAt: types.optional(types.number()),
id: types.optional(types.string()),
key: types.string(),
target: types.optional(smartUnion([
z.array(EditProjectEnvTarget1$inboundSchema),
EditProjectEnvTarget2$inboundSchema,
])),
gitBranch: types.optional(types.string()),
createdBy: z.nullable(types.string()).optional(),
updatedBy: z.nullable(types.string()).optional(),
sunsetSecretId: types.optional(types.string()),
legacyValue: types.optional(types.string()),
decrypted: types.optional(types.boolean()),
configurationId: z.nullable(types.string()).optional(),
visibility: types.optional(EditProjectEnvVisibility$inboundSchema),
contentHint: z.nullable(z.union([
z.lazy(() => ContentHint1$inboundSchema),
z.lazy(() => ContentHint2$inboundSchema),
z.lazy(() => ContentHint3$inboundSchema),
z.lazy(() => ContentHint4$inboundSchema),
z.lazy(() => ContentHint5$inboundSchema),
z.lazy(() => ContentHint6$inboundSchema),
z.lazy(() => ContentHint7$inboundSchema),
z.lazy(() => ContentHint8$inboundSchema),
z.lazy(() => ContentHint9$inboundSchema),
z.lazy(() => ContentHint10$inboundSchema),
z.lazy(() => ContentHint11$inboundSchema),
z.lazy(() => ContentHint12$inboundSchema),
z.lazy(() => ContentHint13$inboundSchema),
z.lazy(() => ContentHint14$inboundSchema),
z.lazy(() => ContentHint15$inboundSchema),
z.lazy(() => ContentHint16$inboundSchema),
z.lazy(() => ContentHint17$inboundSchema),
])).optional(),
internalContentHint: z.nullable(z.lazy(() => InternalContentHint$inboundSchema)).optional(),
comment: types.optional(types.string()),
customEnvironmentIds: types.optional(z.array(types.string())),
});
export function editProjectEnvResponseBodyFromJSON(jsonString) {
return safeParse(jsonString, (x) => EditProjectEnvResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EditProjectEnvResponseBody' from JSON`);
}
//# sourceMappingURL=editprojectenvop.js.map