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>

44 lines (39 loc) 1.27 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { SDKValidationError } from "./sdkvalidationerror.js"; /** * HTTP header injection rules for outgoing requests matching specific domains. */ export type SandboxInjectionRule = { /** * The domain (or pattern) that this injection rule applies to. Supports wildcards like *.vercel.com. */ domain: string; /** * The names of HTTP headers that have value that will be injected for requests to this domain. */ headerNames?: Array<string> | undefined; }; /** @internal */ export const SandboxInjectionRule$inboundSchema: z.ZodType< SandboxInjectionRule, z.ZodTypeDef, unknown > = z.object({ domain: types.string(), headerNames: types.optional(z.array(types.string())), }); export function sandboxInjectionRuleFromJSON( jsonString: string, ): SafeParseResult<SandboxInjectionRule, SDKValidationError> { return safeParse( jsonString, (x) => SandboxInjectionRule$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SandboxInjectionRule' from JSON`, ); }