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>

222 lines 9.33 kB
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"; export type PathCondition = { value?: string | undefined; syntax?: string | undefined; }; export type GenerateRouteConditions = { field?: string | undefined; operator?: string | undefined; key?: string | undefined; value?: string | undefined; missing?: boolean | undefined; }; export type GenerateRouteHeaders = { key?: string | undefined; value?: string | undefined; op?: string | undefined; }; export type Actions = { type?: string | undefined; subType?: string | undefined; dest?: string | undefined; status?: number | undefined; headers?: Array<GenerateRouteHeaders> | undefined; }; export type CurrentRoute = { name?: string | undefined; description?: string | undefined; pathCondition: PathCondition; conditions?: Array<GenerateRouteConditions> | undefined; actions: Array<Actions>; }; export type GenerateRouteRequestBody = { prompt: string; currentRoute?: CurrentRoute | undefined; }; export type GenerateRouteRequest = { projectId: string; /** * The Team identifier to perform the request on behalf of. */ teamId?: string | undefined; /** * The Team slug to perform the request on behalf of. */ slug?: string | undefined; requestBody?: GenerateRouteRequestBody | undefined; }; export declare const Syntax: { readonly Equals: "equals"; readonly PathToRegexp: "path-to-regexp"; readonly Regex: "regex"; }; export type Syntax = ClosedEnum<typeof Syntax>; export type GenerateRoutePathCondition = { value: string; syntax: Syntax; }; export declare const GenerateRouteField: { readonly Cookie: "cookie"; readonly Header: "header"; readonly Host: "host"; readonly Query: "query"; }; export type GenerateRouteField = ClosedEnum<typeof GenerateRouteField>; export declare const Operator: { readonly Contains: "contains"; readonly Eq: "eq"; readonly Exists: "exists"; readonly Re: "re"; }; export type Operator = ClosedEnum<typeof Operator>; export type GenerateRouteProjectRoutesConditions = { field: GenerateRouteField; operator: Operator; key?: string | undefined; value?: string | undefined; missing: boolean; }; export declare const GenerateRouteType: { readonly Modify: "modify"; readonly Redirect: "redirect"; readonly Rewrite: "rewrite"; readonly SetStatus: "set-status"; }; export type GenerateRouteType = ClosedEnum<typeof GenerateRouteType>; export declare const SubType: { readonly ResponseHeaders: "response-headers"; readonly TransformRequestHeader: "transform-request-header"; readonly TransformRequestQuery: "transform-request-query"; }; export type SubType = ClosedEnum<typeof SubType>; export declare const GenerateRouteOp: { readonly Append: "append"; readonly Delete: "delete"; readonly Set: "set"; }; export type GenerateRouteOp = ClosedEnum<typeof GenerateRouteOp>; export type GenerateRouteProjectRoutesHeaders = { key: string; value?: string | undefined; op: GenerateRouteOp; }; export type GenerateRouteActions = { type: GenerateRouteType; subType?: SubType | undefined; dest?: string | undefined; status?: number | undefined; headers?: Array<GenerateRouteProjectRoutesHeaders> | undefined; }; export type GenerateRouteRoute = { name: string; description: string; pathCondition: GenerateRoutePathCondition; conditions?: Array<GenerateRouteProjectRoutesConditions> | undefined; actions: Array<GenerateRouteActions>; }; export type GenerateRouteResponseBody = { route?: GenerateRouteRoute | undefined; error?: string | undefined; }; /** @internal */ export type PathCondition$Outbound = { value?: string | undefined; syntax?: string | undefined; }; /** @internal */ export declare const PathCondition$outboundSchema: z.ZodType<PathCondition$Outbound, z.ZodTypeDef, PathCondition>; export declare function pathConditionToJSON(pathCondition: PathCondition): string; /** @internal */ export type GenerateRouteConditions$Outbound = { field?: string | undefined; operator?: string | undefined; key?: string | undefined; value?: string | undefined; missing?: boolean | undefined; }; /** @internal */ export declare const GenerateRouteConditions$outboundSchema: z.ZodType<GenerateRouteConditions$Outbound, z.ZodTypeDef, GenerateRouteConditions>; export declare function generateRouteConditionsToJSON(generateRouteConditions: GenerateRouteConditions): string; /** @internal */ export type GenerateRouteHeaders$Outbound = { key?: string | undefined; value?: string | undefined; op?: string | undefined; }; /** @internal */ export declare const GenerateRouteHeaders$outboundSchema: z.ZodType<GenerateRouteHeaders$Outbound, z.ZodTypeDef, GenerateRouteHeaders>; export declare function generateRouteHeadersToJSON(generateRouteHeaders: GenerateRouteHeaders): string; /** @internal */ export type Actions$Outbound = { type?: string | undefined; subType?: string | undefined; dest?: string | undefined; status?: number | undefined; headers?: Array<GenerateRouteHeaders$Outbound> | undefined; }; /** @internal */ export declare const Actions$outboundSchema: z.ZodType<Actions$Outbound, z.ZodTypeDef, Actions>; export declare function actionsToJSON(actions: Actions): string; /** @internal */ export type CurrentRoute$Outbound = { name?: string | undefined; description?: string | undefined; pathCondition: PathCondition$Outbound; conditions?: Array<GenerateRouteConditions$Outbound> | undefined; actions: Array<Actions$Outbound>; }; /** @internal */ export declare const CurrentRoute$outboundSchema: z.ZodType<CurrentRoute$Outbound, z.ZodTypeDef, CurrentRoute>; export declare function currentRouteToJSON(currentRoute: CurrentRoute): string; /** @internal */ export type GenerateRouteRequestBody$Outbound = { prompt: string; currentRoute?: CurrentRoute$Outbound | undefined; }; /** @internal */ export declare const GenerateRouteRequestBody$outboundSchema: z.ZodType<GenerateRouteRequestBody$Outbound, z.ZodTypeDef, GenerateRouteRequestBody>; export declare function generateRouteRequestBodyToJSON(generateRouteRequestBody: GenerateRouteRequestBody): string; /** @internal */ export type GenerateRouteRequest$Outbound = { projectId: string; teamId?: string | undefined; slug?: string | undefined; RequestBody?: GenerateRouteRequestBody$Outbound | undefined; }; /** @internal */ export declare const GenerateRouteRequest$outboundSchema: z.ZodType<GenerateRouteRequest$Outbound, z.ZodTypeDef, GenerateRouteRequest>; export declare function generateRouteRequestToJSON(generateRouteRequest: GenerateRouteRequest): string; /** @internal */ export declare const Syntax$inboundSchema: z.ZodNativeEnum<typeof Syntax>; /** @internal */ export declare const GenerateRoutePathCondition$inboundSchema: z.ZodType<GenerateRoutePathCondition, z.ZodTypeDef, unknown>; export declare function generateRoutePathConditionFromJSON(jsonString: string): SafeParseResult<GenerateRoutePathCondition, SDKValidationError>; /** @internal */ export declare const GenerateRouteField$inboundSchema: z.ZodNativeEnum<typeof GenerateRouteField>; /** @internal */ export declare const Operator$inboundSchema: z.ZodNativeEnum<typeof Operator>; /** @internal */ export declare const GenerateRouteProjectRoutesConditions$inboundSchema: z.ZodType<GenerateRouteProjectRoutesConditions, z.ZodTypeDef, unknown>; export declare function generateRouteProjectRoutesConditionsFromJSON(jsonString: string): SafeParseResult<GenerateRouteProjectRoutesConditions, SDKValidationError>; /** @internal */ export declare const GenerateRouteType$inboundSchema: z.ZodNativeEnum<typeof GenerateRouteType>; /** @internal */ export declare const SubType$inboundSchema: z.ZodNativeEnum<typeof SubType>; /** @internal */ export declare const GenerateRouteOp$inboundSchema: z.ZodNativeEnum<typeof GenerateRouteOp>; /** @internal */ export declare const GenerateRouteProjectRoutesHeaders$inboundSchema: z.ZodType<GenerateRouteProjectRoutesHeaders, z.ZodTypeDef, unknown>; export declare function generateRouteProjectRoutesHeadersFromJSON(jsonString: string): SafeParseResult<GenerateRouteProjectRoutesHeaders, SDKValidationError>; /** @internal */ export declare const GenerateRouteActions$inboundSchema: z.ZodType<GenerateRouteActions, z.ZodTypeDef, unknown>; export declare function generateRouteActionsFromJSON(jsonString: string): SafeParseResult<GenerateRouteActions, SDKValidationError>; /** @internal */ export declare const GenerateRouteRoute$inboundSchema: z.ZodType<GenerateRouteRoute, z.ZodTypeDef, unknown>; export declare function generateRouteRouteFromJSON(jsonString: string): SafeParseResult<GenerateRouteRoute, SDKValidationError>; /** @internal */ export declare const GenerateRouteResponseBody$inboundSchema: z.ZodType<GenerateRouteResponseBody, z.ZodTypeDef, unknown>; export declare function generateRouteResponseBodyFromJSON(jsonString: string): SafeParseResult<GenerateRouteResponseBody, SDKValidationError>; //# sourceMappingURL=generaterouteop.d.ts.map