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>

706 lines 31.8 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 GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsSdAction = { Deny: "deny", Log: "log", }; export const GetFirewallConfigSecurityAction = { Deny: "deny", Log: "log", }; export const GetFirewallConfigSecurityResponseAction = { Deny: "deny", Log: "log", }; export const GetFirewallConfigSecurityResponse200Action = { Deny: "deny", Log: "log", }; export const GetFirewallConfigSecurityResponse200ApplicationJSONAction = { Deny: "deny", Log: "log", }; export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyAction = { Deny: "deny", Log: "log", }; export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsAction = { Deny: "deny", Log: "log", }; export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsXssAction = { Deny: "deny", Log: "log", }; export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsSqliAction = { Deny: "deny", Log: "log", }; export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsSfAction = { Deny: "deny", Log: "log", }; export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsJavaAction = { Deny: "deny", Log: "log", }; export const GetFirewallConfigRulesType = { BotCategory: "bot_category", BotName: "bot_name", BotProtection: "bot_protection", BotStatus: "bot_status", Cookie: "cookie", Environment: "environment", GeoAsNumber: "geo_as_number", GeoCity: "geo_city", GeoContinent: "geo_continent", GeoCountry: "geo_country", GeoCountryRegion: "geo_country_region", Header: "header", Host: "host", IpAddress: "ip_address", Ja3Digest: "ja3_digest", Ja4Digest: "ja4_digest", Method: "method", Path: "path", Protocol: "protocol", Query: "query", RateLimitApiId: "rate_limit_api_id", RawPath: "raw_path", Region: "region", Route: "route", Scheme: "scheme", ServerAction: "server_action", TargetPath: "target_path", TrustedSource: "trusted_source", UserAgent: "user_agent", }; export const GetFirewallConfigRulesOp = { Eq: "eq", Ex: "ex", Gt: "gt", Gte: "gte", Inc: "inc", Lt: "lt", Lte: "lte", Neq: "neq", Nex: "nex", Ninc: "ninc", Pre: "pre", Re: "re", Sub: "sub", Suf: "suf", }; export const GetFirewallConfigRulesSecurityAction = { Bypass: "bypass", Challenge: "challenge", Deny: "deny", Log: "log", RateLimit: "rate_limit", Redirect: "redirect", }; export const GetFirewallConfigRulesAlgo = { FixedWindow: "fixed_window", TokenBucket: "token_bucket", }; export const GetFirewallConfigRulesSecurityResponse200Action = { Challenge: "challenge", Deny: "deny", Log: "log", RateLimit: "rate_limit", }; export const GetFirewallConfigLogHeadersSecurity2 = { Wildcard: "*", }; export const RulesType = { BotCategory: "bot_category", BotName: "bot_name", BotProtection: "bot_protection", BotStatus: "bot_status", Cookie: "cookie", Environment: "environment", GeoAsNumber: "geo_as_number", GeoCity: "geo_city", GeoContinent: "geo_continent", GeoCountry: "geo_country", GeoCountryRegion: "geo_country_region", Header: "header", Host: "host", IpAddress: "ip_address", Ja3Digest: "ja3_digest", Ja4Digest: "ja4_digest", Method: "method", Path: "path", Protocol: "protocol", Query: "query", RateLimitApiId: "rate_limit_api_id", RawPath: "raw_path", Region: "region", Route: "route", Scheme: "scheme", ServerAction: "server_action", TargetPath: "target_path", TrustedSource: "trusted_source", UserAgent: "user_agent", }; export const RulesOp = { Eq: "eq", Ex: "ex", Gt: "gt", Gte: "gte", Inc: "inc", Lt: "lt", Lte: "lte", Neq: "neq", Nex: "nex", Ninc: "ninc", Pre: "pre", Re: "re", Sub: "sub", Suf: "suf", }; export const GetFirewallConfigRulesSecurityResponseAction = { Bypass: "bypass", Challenge: "challenge", Deny: "deny", Log: "log", RateLimit: "rate_limit", Redirect: "redirect", }; export const RulesAlgo = { FixedWindow: "fixed_window", TokenBucket: "token_bucket", }; export const GetFirewallConfigRulesSecurityResponse200ApplicationJSONAction = { Challenge: "challenge", Deny: "deny", Log: "log", RateLimit: "rate_limit", }; export const GetFirewallConfigLogHeaders2 = { Wildcard: "*", }; export const GetFirewallConfigAction = { Bypass: "bypass", Challenge: "challenge", Deny: "deny", Log: "log", }; export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyManagedRulesAction = { Challenge: "challenge", Deny: "deny", Log: "log", }; export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyManagedRulesAiBotsAction = { Challenge: "challenge", Deny: "deny", Log: "log", }; export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyManagedRulesOwaspAction = { Challenge: "challenge", Deny: "deny", Log: "log", }; export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyManagedRulesVercelRulesetAction = { Challenge: "challenge", Deny: "deny", Log: "log", }; export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyManagedRulesTrafficSourcesAction = { Challenge: "challenge", Deny: "deny", Log: "log", }; export const LogHeaders2 = { Wildcard: "*", }; /** @internal */ export const GetFirewallConfigRequest$outboundSchema = z.object({ projectId: z.string(), teamId: z.string().optional(), slug: z.string().optional(), configVersion: z.string(), }); export function getFirewallConfigRequestToJSON(getFirewallConfigRequest) { return JSON.stringify(GetFirewallConfigRequest$outboundSchema.parse(getFirewallConfigRequest)); } /** @internal */ export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsSdAction$inboundSchema = z.nativeEnum(GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsSdAction); /** @internal */ export const GetFirewallConfigSd$inboundSchema = z.object({ active: types.boolean(), action: GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsSdAction$inboundSchema, }); export function getFirewallConfigSdFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigSd$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigSd' from JSON`); } /** @internal */ export const GetFirewallConfigSecurityAction$inboundSchema = z.nativeEnum(GetFirewallConfigSecurityAction); /** @internal */ export const GetFirewallConfigMa$inboundSchema = z.object({ active: types.boolean(), action: GetFirewallConfigSecurityAction$inboundSchema, }); export function getFirewallConfigMaFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigMa$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigMa' from JSON`); } /** @internal */ export const GetFirewallConfigSecurityResponseAction$inboundSchema = z .nativeEnum(GetFirewallConfigSecurityResponseAction); /** @internal */ export const GetFirewallConfigLfi$inboundSchema = z.object({ active: types.boolean(), action: GetFirewallConfigSecurityResponseAction$inboundSchema, }); export function getFirewallConfigLfiFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigLfi$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigLfi' from JSON`); } /** @internal */ export const GetFirewallConfigSecurityResponse200Action$inboundSchema = z .nativeEnum(GetFirewallConfigSecurityResponse200Action); /** @internal */ export const GetFirewallConfigRfi$inboundSchema = z.object({ active: types.boolean(), action: GetFirewallConfigSecurityResponse200Action$inboundSchema, }); export function getFirewallConfigRfiFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigRfi$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigRfi' from JSON`); } /** @internal */ export const GetFirewallConfigSecurityResponse200ApplicationJSONAction$inboundSchema = z.nativeEnum(GetFirewallConfigSecurityResponse200ApplicationJSONAction); /** @internal */ export const GetFirewallConfigRce$inboundSchema = z.object({ active: types.boolean(), action: GetFirewallConfigSecurityResponse200ApplicationJSONAction$inboundSchema, }); export function getFirewallConfigRceFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigRce$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigRce' from JSON`); } /** @internal */ export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyAction$inboundSchema = z.nativeEnum(GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyAction); /** @internal */ export const GetFirewallConfigPhp$inboundSchema = z.object({ active: types.boolean(), action: GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyAction$inboundSchema, }); export function getFirewallConfigPhpFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigPhp$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigPhp' from JSON`); } /** @internal */ export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsAction$inboundSchema = z.nativeEnum(GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsAction); /** @internal */ export const GetFirewallConfigGen$inboundSchema = z.object({ active: types.boolean(), action: GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsAction$inboundSchema, }); export function getFirewallConfigGenFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigGen$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigGen' from JSON`); } /** @internal */ export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsXssAction$inboundSchema = z.nativeEnum(GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsXssAction); /** @internal */ export const GetFirewallConfigXss$inboundSchema = z.object({ active: types.boolean(), action: GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsXssAction$inboundSchema, }); export function getFirewallConfigXssFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigXss$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigXss' from JSON`); } /** @internal */ export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsSqliAction$inboundSchema = z.nativeEnum(GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsSqliAction); /** @internal */ export const GetFirewallConfigSqli$inboundSchema = z.object({ active: types.boolean(), action: GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsSqliAction$inboundSchema, }); export function getFirewallConfigSqliFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigSqli$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigSqli' from JSON`); } /** @internal */ export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsSfAction$inboundSchema = z.nativeEnum(GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsSfAction); /** @internal */ export const GetFirewallConfigSf$inboundSchema = z.object({ active: types.boolean(), action: GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsSfAction$inboundSchema, }); export function getFirewallConfigSfFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigSf$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigSf' from JSON`); } /** @internal */ export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsJavaAction$inboundSchema = z.nativeEnum(GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsJavaAction); /** @internal */ export const GetFirewallConfigJava$inboundSchema = z.object({ active: types.boolean(), action: GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyCrsJavaAction$inboundSchema, }); export function getFirewallConfigJavaFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigJava$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigJava' from JSON`); } /** @internal */ export const GetFirewallConfigCrs$inboundSchema = z.object({ sd: z.lazy(() => GetFirewallConfigSd$inboundSchema), ma: z.lazy(() => GetFirewallConfigMa$inboundSchema), lfi: z.lazy(() => GetFirewallConfigLfi$inboundSchema), rfi: z.lazy(() => GetFirewallConfigRfi$inboundSchema), rce: z.lazy(() => GetFirewallConfigRce$inboundSchema), php: z.lazy(() => GetFirewallConfigPhp$inboundSchema), gen: z.lazy(() => GetFirewallConfigGen$inboundSchema), xss: z.lazy(() => GetFirewallConfigXss$inboundSchema), sqli: z.lazy(() => GetFirewallConfigSqli$inboundSchema), sf: z.lazy(() => GetFirewallConfigSf$inboundSchema), java: z.lazy(() => GetFirewallConfigJava$inboundSchema), }); export function getFirewallConfigCrsFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigCrs$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigCrs' from JSON`); } /** @internal */ export const GetFirewallConfigRulesType$inboundSchema = z.nativeEnum(GetFirewallConfigRulesType); /** @internal */ export const GetFirewallConfigRulesOp$inboundSchema = z.nativeEnum(GetFirewallConfigRulesOp); /** @internal */ export const GetFirewallConfigRulesValue$inboundSchema = smartUnion([types.string(), types.number(), z.array(types.string())]); export function getFirewallConfigRulesValueFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigRulesValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigRulesValue' from JSON`); } /** @internal */ export const GetFirewallConfigRulesConditions$inboundSchema = z.object({ type: GetFirewallConfigRulesType$inboundSchema, op: GetFirewallConfigRulesOp$inboundSchema, neg: types.optional(types.boolean()), key: types.optional(types.string()), value: types.optional(smartUnion([types.string(), types.number(), z.array(types.string())])), }); export function getFirewallConfigRulesConditionsFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigRulesConditions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigRulesConditions' from JSON`); } /** @internal */ export const GetFirewallConfigRulesConditionGroup$inboundSchema = z.object({ conditions: z.array(z.lazy(() => GetFirewallConfigRulesConditions$inboundSchema)), }); export function getFirewallConfigRulesConditionGroupFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigRulesConditionGroup$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigRulesConditionGroup' from JSON`); } /** @internal */ export const GetFirewallConfigRulesSecurityAction$inboundSchema = z.nativeEnum(GetFirewallConfigRulesSecurityAction); /** @internal */ export const GetFirewallConfigRulesAlgo$inboundSchema = z.nativeEnum(GetFirewallConfigRulesAlgo); /** @internal */ export const GetFirewallConfigRulesSecurityResponse200Action$inboundSchema = z .nativeEnum(GetFirewallConfigRulesSecurityResponse200Action); /** @internal */ export const GetFirewallConfigRulesRateLimit$inboundSchema = z.object({ algo: GetFirewallConfigRulesAlgo$inboundSchema, window: types.number(), limit: types.number(), keys: z.array(types.string()), action: z.nullable(GetFirewallConfigRulesSecurityResponse200Action$inboundSchema).optional(), }); export function getFirewallConfigRulesRateLimitFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigRulesRateLimit$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigRulesRateLimit' from JSON`); } /** @internal */ export const GetFirewallConfigRulesRedirect$inboundSchema = z.object({ location: types.string(), permanent: types.boolean(), }); export function getFirewallConfigRulesRedirectFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigRulesRedirect$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigRulesRedirect' from JSON`); } /** @internal */ export const GetFirewallConfigLogHeadersSecurity2$inboundSchema = z.nativeEnum(GetFirewallConfigLogHeadersSecurity2); /** @internal */ export const GetFirewallConfigRulesLogHeaders$inboundSchema = smartUnion([ z.array(types.string()), GetFirewallConfigLogHeadersSecurity2$inboundSchema, ]); export function getFirewallConfigRulesLogHeadersFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigRulesLogHeaders$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigRulesLogHeaders' from JSON`); } /** @internal */ export const GetFirewallConfigRulesMitigate$inboundSchema = z.object({ action: GetFirewallConfigRulesSecurityAction$inboundSchema, rateLimit: z.nullable(z.lazy(() => GetFirewallConfigRulesRateLimit$inboundSchema)).optional(), redirect: z.nullable(z.lazy(() => GetFirewallConfigRulesRedirect$inboundSchema)).optional(), actionDuration: z.nullable(types.string()).optional(), bypassSystem: z.nullable(types.boolean()).optional(), logHeaders: types.optional(smartUnion([ z.array(types.string()), GetFirewallConfigLogHeadersSecurity2$inboundSchema, ])), }); export function getFirewallConfigRulesMitigateFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigRulesMitigate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigRulesMitigate' from JSON`); } /** @internal */ export const GetFirewallConfigRulesAction$inboundSchema = z.object({ mitigate: types.optional(z.lazy(() => GetFirewallConfigRulesMitigate$inboundSchema)), }); export function getFirewallConfigRulesActionFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigRulesAction$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigRulesAction' from JSON`); } /** @internal */ export const Rules2$inboundSchema = z .object({ id: types.string(), name: types.string(), description: types.optional(types.string()), active: types.boolean(), conditionGroup: z.array(z.lazy(() => GetFirewallConfigRulesConditionGroup$inboundSchema)), action: z.lazy(() => GetFirewallConfigRulesAction$inboundSchema), valid: types.literal(false), validationErrors: z.array(types.string()), }); export function rules2FromJSON(jsonString) { return safeParse(jsonString, (x) => Rules2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Rules2' from JSON`); } /** @internal */ export const RulesType$inboundSchema = z .nativeEnum(RulesType); /** @internal */ export const RulesOp$inboundSchema = z .nativeEnum(RulesOp); /** @internal */ export const RulesValue$inboundSchema = smartUnion([types.string(), types.number(), z.array(types.string())]); export function rulesValueFromJSON(jsonString) { return safeParse(jsonString, (x) => RulesValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RulesValue' from JSON`); } /** @internal */ export const RulesConditions$inboundSchema = z.object({ type: RulesType$inboundSchema, op: RulesOp$inboundSchema, neg: types.optional(types.boolean()), key: types.optional(types.string()), value: types.optional(smartUnion([types.string(), types.number(), z.array(types.string())])), }); export function rulesConditionsFromJSON(jsonString) { return safeParse(jsonString, (x) => RulesConditions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RulesConditions' from JSON`); } /** @internal */ export const RulesConditionGroup$inboundSchema = z.object({ conditions: z.array(z.lazy(() => RulesConditions$inboundSchema)), }); export function rulesConditionGroupFromJSON(jsonString) { return safeParse(jsonString, (x) => RulesConditionGroup$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RulesConditionGroup' from JSON`); } /** @internal */ export const GetFirewallConfigRulesSecurityResponseAction$inboundSchema = z .nativeEnum(GetFirewallConfigRulesSecurityResponseAction); /** @internal */ export const RulesAlgo$inboundSchema = z .nativeEnum(RulesAlgo); /** @internal */ export const GetFirewallConfigRulesSecurityResponse200ApplicationJSONAction$inboundSchema = z.nativeEnum(GetFirewallConfigRulesSecurityResponse200ApplicationJSONAction); /** @internal */ export const RulesRateLimit$inboundSchema = z.object({ algo: RulesAlgo$inboundSchema, window: types.number(), limit: types.number(), keys: z.array(types.string()), action: z.nullable(GetFirewallConfigRulesSecurityResponse200ApplicationJSONAction$inboundSchema).optional(), }); export function rulesRateLimitFromJSON(jsonString) { return safeParse(jsonString, (x) => RulesRateLimit$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RulesRateLimit' from JSON`); } /** @internal */ export const RulesRedirect$inboundSchema = z.object({ location: types.string(), permanent: types.boolean(), }); export function rulesRedirectFromJSON(jsonString) { return safeParse(jsonString, (x) => RulesRedirect$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RulesRedirect' from JSON`); } /** @internal */ export const GetFirewallConfigLogHeaders2$inboundSchema = z.nativeEnum(GetFirewallConfigLogHeaders2); /** @internal */ export const RulesLogHeaders$inboundSchema = smartUnion([ z.array(types.string()), GetFirewallConfigLogHeaders2$inboundSchema, ]); export function rulesLogHeadersFromJSON(jsonString) { return safeParse(jsonString, (x) => RulesLogHeaders$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RulesLogHeaders' from JSON`); } /** @internal */ export const RulesMitigate$inboundSchema = z.object({ action: GetFirewallConfigRulesSecurityResponseAction$inboundSchema, rateLimit: z.nullable(z.lazy(() => RulesRateLimit$inboundSchema)).optional(), redirect: z.nullable(z.lazy(() => RulesRedirect$inboundSchema)).optional(), actionDuration: z.nullable(types.string()).optional(), bypassSystem: z.nullable(types.boolean()).optional(), logHeaders: types.optional(smartUnion([ z.array(types.string()), GetFirewallConfigLogHeaders2$inboundSchema, ])), }); export function rulesMitigateFromJSON(jsonString) { return safeParse(jsonString, (x) => RulesMitigate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RulesMitigate' from JSON`); } /** @internal */ export const RulesAction$inboundSchema = z.object({ mitigate: types.optional(z.lazy(() => RulesMitigate$inboundSchema)), }); export function rulesActionFromJSON(jsonString) { return safeParse(jsonString, (x) => RulesAction$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RulesAction' from JSON`); } /** @internal */ export const Rules1$inboundSchema = z .object({ id: types.string(), name: types.string(), description: types.optional(types.string()), active: types.boolean(), conditionGroup: z.array(z.lazy(() => RulesConditionGroup$inboundSchema)), action: z.lazy(() => RulesAction$inboundSchema), valid: types.literal(true), validationErrors: z.nullable(z.any()).optional(), }); export function rules1FromJSON(jsonString) { return safeParse(jsonString, (x) => Rules1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Rules1' from JSON`); } /** @internal */ export const GetFirewallConfigRules$inboundSchema = smartUnion([ z.lazy(() => Rules1$inboundSchema), z.lazy(() => Rules2$inboundSchema), ]); export function getFirewallConfigRulesFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigRules$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigRules' from JSON`); } /** @internal */ export const GetFirewallConfigAction$inboundSchema = z.nativeEnum(GetFirewallConfigAction); /** @internal */ export const GetFirewallConfigIps$inboundSchema = z.object({ id: types.string(), hostname: types.string(), ip: types.string(), notes: types.optional(types.string()), action: GetFirewallConfigAction$inboundSchema, }); export function getFirewallConfigIpsFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigIps$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigIps' from JSON`); } /** @internal */ export const Changes$inboundSchema = z.object({}); export function changesFromJSON(jsonString) { return safeParse(jsonString, (x) => Changes$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Changes' from JSON`); } /** @internal */ export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyManagedRulesAction$inboundSchema = z.nativeEnum(GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyManagedRulesAction); /** @internal */ export const BotProtection$inboundSchema = z.object({ active: types.boolean(), action: types.optional(GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyManagedRulesAction$inboundSchema), updatedAt: types.optional(types.string()), userId: types.optional(types.string()), username: types.optional(types.string()), }); export function botProtectionFromJSON(jsonString) { return safeParse(jsonString, (x) => BotProtection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BotProtection' from JSON`); } /** @internal */ export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyManagedRulesAiBotsAction$inboundSchema = z.nativeEnum(GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyManagedRulesAiBotsAction); /** @internal */ export const AiBots$inboundSchema = z .object({ active: types.boolean(), action: types.optional(GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyManagedRulesAiBotsAction$inboundSchema), updatedAt: types.optional(types.string()), userId: types.optional(types.string()), username: types.optional(types.string()), }); export function aiBotsFromJSON(jsonString) { return safeParse(jsonString, (x) => AiBots$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AiBots' from JSON`); } /** @internal */ export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyManagedRulesOwaspAction$inboundSchema = z.nativeEnum(GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyManagedRulesOwaspAction); /** @internal */ export const Owasp$inboundSchema = z .object({ active: types.boolean(), action: types.optional(GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyManagedRulesOwaspAction$inboundSchema), updatedAt: types.optional(types.string()), userId: types.optional(types.string()), username: types.optional(types.string()), }); export function owaspFromJSON(jsonString) { return safeParse(jsonString, (x) => Owasp$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Owasp' from JSON`); } /** @internal */ export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyManagedRulesVercelRulesetAction$inboundSchema = z.nativeEnum(GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyManagedRulesVercelRulesetAction); /** @internal */ export const VercelRuleset$inboundSchema = z.object({ active: types.boolean(), action: types.optional(GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyManagedRulesVercelRulesetAction$inboundSchema), updatedAt: types.optional(types.string()), userId: types.optional(types.string()), username: types.optional(types.string()), }); export function vercelRulesetFromJSON(jsonString) { return safeParse(jsonString, (x) => VercelRuleset$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VercelRuleset' from JSON`); } /** @internal */ export const GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyManagedRulesTrafficSourcesAction$inboundSchema = z.nativeEnum(GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyManagedRulesTrafficSourcesAction); /** @internal */ export const TrafficSources$inboundSchema = z.object({ active: types.boolean(), action: types.optional(GetFirewallConfigSecurityResponse200ApplicationJSONResponseBodyManagedRulesTrafficSourcesAction$inboundSchema), updatedAt: types.optional(types.string()), userId: types.optional(types.string()), username: types.optional(types.string()), }); export function trafficSourcesFromJSON(jsonString) { return safeParse(jsonString, (x) => TrafficSources$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TrafficSources' from JSON`); } /** @internal */ export const GetFirewallConfigManagedRules$inboundSchema = z.object({ bot_protection: types.optional(z.lazy(() => BotProtection$inboundSchema)), ai_bots: types.optional(z.lazy(() => AiBots$inboundSchema)), owasp: types.optional(z.lazy(() => Owasp$inboundSchema)), vercel_ruleset: types.optional(z.lazy(() => VercelRuleset$inboundSchema)), traffic_sources: types.optional(z.lazy(() => TrafficSources$inboundSchema)), }).transform((v) => { return remap$(v, { "bot_protection": "botProtection", "ai_bots": "aiBots", "vercel_ruleset": "vercelRuleset", "traffic_sources": "trafficSources", }); }); export function getFirewallConfigManagedRulesFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigManagedRules$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigManagedRules' from JSON`); } /** @internal */ export const LogHeaders2$inboundSchema = z .nativeEnum(LogHeaders2); /** @internal */ export const GetFirewallConfigLogHeaders$inboundSchema = smartUnion([z.array(types.string()), LogHeaders2$inboundSchema]); export function getFirewallConfigLogHeadersFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigLogHeaders$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigLogHeaders' from JSON`); } /** @internal */ export const GetFirewallConfigResponseBody$inboundSchema = z.object({ ownerId: types.string(), projectKey: types.string(), id: types.string(), version: types.number(), updatedAt: types.string(), firewallEnabled: types.boolean(), crs: z.lazy(() => GetFirewallConfigCrs$inboundSchema), rules: z.array(smartUnion([ z.lazy(() => Rules1$inboundSchema), z.lazy(() => Rules2$inboundSchema), ])), ips: z.array(z.lazy(() => GetFirewallConfigIps$inboundSchema)), changes: z.array(z.lazy(() => Changes$inboundSchema)), managedRules: types.optional(z.lazy(() => GetFirewallConfigManagedRules$inboundSchema)), botIdEnabled: types.optional(types.boolean()), logHeaders: types.optional(smartUnion([z.array(types.string()), LogHeaders2$inboundSchema])), }); export function getFirewallConfigResponseBodyFromJSON(jsonString) { return safeParse(jsonString, (x) => GetFirewallConfigResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFirewallConfigResponseBody' from JSON`); } //# sourceMappingURL=getfirewallconfigop.js.map