// AUTO-GENERATED by scripts/generate.ts from .generated-specs. Do not edit. import * as S from "@distilled.cloud/core/schema"; import * as API from "@distilled.cloud/core/api"; import * as T from "../traits.ts"; import { CloudflareProtocol, CloudflarePaginatedProtocol, type CloudflareOpError, type CloudflareOpContext, } from "../protocol.ts"; import { cloudflarePaginate, ResultInfo } from "../pagination.ts"; import { CloudflareError, CloudflareRateLimited } from "../errors.ts"; import * as Retry from "../retry.ts"; export type { CloudflareOpError, CloudflareOpContext }; /** Fallback camelCase→wire mapping for opaque content (mined from the distilled SDK). */ const KEY_DICTIONARY: Record> = { allowedModes: "allowed_modes", contentType: "content_type", createdOn: "created_on", defaultMode: "default_mode", documentationUrl: "documentation_url", modifiedOn: "modified_on", modifiedRulesCount: "modified_rules_count", packageId: "package_id", perPage: "per_page", resultInfo: "result_info", rewriteAction: "rewrite_action", rulesCount: "rules_count", totalCount: "total_count", }; export class AccessRuleNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("AccessRuleNotFound", { code: S.Number, message: S.String, }), [{ code: 10001, message: { includes: "not_found" } }, { status: 404 }], ) {} export class DuplicateAccessRule extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("DuplicateAccessRule", { code: S.Number, message: S.String, }), [{ code: 10009, message: { includes: "duplicate_of_existing" } }], ) {} export class DuplicateLockdown extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("DuplicateLockdown", { code: S.Number, message: S.String, }), [ { code: 10009, message: { includes: "zonelockdown.api.duplicate_of_existing" }, }, ], ) {} export class DuplicateUaRule extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("DuplicateUaRule", { code: S.Number, message: S.String, }), [ { code: 10009, message: { includes: "firewalluablock.api.duplicate_of_existing" }, }, ], ) {} export class Forbidden extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("Forbidden", { code: S.Number, message: S.String, }), [{ status: 403 }], ) {} export class LockdownNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("LockdownNotFound", { code: S.Number, message: S.String, }), [ { code: 10001, message: { includes: "zonelockdown.api.not_found" } }, { status: 404 }, ], ) {} export class UaRuleNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("UaRuleNotFound", { code: S.Number, message: S.String, }), [ { code: 10001, message: { includes: "firewalluablock.api.not_found" } }, { status: 404 }, ], ) {} export interface BulkDeleteRulesRequest { /** Defines an identifier. */ zoneId: string; } export const BulkDeleteRulesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/zones/{zone_id}/firewall/rules", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "BulkDeleteRulesRequest", }) as any as S.Schema; export type RulesBulkDeleteResultItemAction = | "block" | "challenge" | "js_challenge" | "managed_challenge" | "allow" | "log" | "bypass"; export const RulesBulkDeleteResultItemAction = /*@__PURE__*/ S.String; export interface RulesBulkDeleteResultItemFilterFirewallFilter { /** The unique identifier of the filter. */ id?: string | null; /** An informative summary of the filter. */ description?: string | null; /** The filter expression. For more information, refer to [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). */ expression?: string | null; /** When true, indicates that the filter is currently paused. */ paused?: boolean | null; /** A short reference tag. Allows you to select related filters. */ ref?: string | null; } export const RulesBulkDeleteResultItemFilterFirewallFilter = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), description: S.optional(S.NullOr(S.String)), expression: S.optional(S.NullOr(S.String)), paused: S.optional(S.NullOr(S.Boolean)), ref: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "RulesBulkDeleteResultItemFilterFirewallFilter", }) as any as S.Schema; export interface RulesBulkDeleteResultItemFilterDeletedFilter { /** The unique identifier of the filter. */ id: string; /** When true, indicates that the firewall rule was deleted. */ deleted: boolean; } export const RulesBulkDeleteResultItemFilterDeletedFilter = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, deleted: S.Boolean, }), ).annotate({ identifier: "RulesBulkDeleteResultItemFilterDeletedFilter", }) as any as S.Schema; export type RulesBulkDeleteResultItemFilter = | RulesBulkDeleteResultItemFilterFirewallFilter | RulesBulkDeleteResultItemFilterDeletedFilter; export const RulesBulkDeleteResultItemFilter = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([ ["id", "description", "expression", "paused", "ref"], ["id", "deleted"], ]), ); export type RulesBulkDeleteResultItemProductsItem = | "zoneLockdown" | "uaBlock" | "bic" | "hot" | "securityLevel" | "rateLimit" | "waf"; export const RulesBulkDeleteResultItemProductsItem = /*@__PURE__*/ S.String; export type RulesBulkDeleteResultItemProductsList = Array; export const RulesBulkDeleteResultItemProductsList = /*@__PURE__*/ S.Array( RulesBulkDeleteResultItemProductsItem, ) as any as S.Schema; export interface RulesBulkDeleteResultItem { /** The unique identifier of the firewall rule. */ id?: string | null; /** The action to apply to a matched request. The `log` action is only available on an Enterprise plan. */ action?: RulesBulkDeleteResultItemAction | null; /** An informative summary of the firewall rule. */ description?: string | null; filter?: RulesBulkDeleteResultItemFilter | null; /** When true, indicates that the firewall rule is currently paused. */ paused?: boolean | null; /** The priority of the rule. Optional value used to define the processing order. A lower number indicates a higher priority. If not provided, rules with a defined priority will be processed before rules without a priority. */ priority?: number | null; products?: RulesBulkDeleteResultItemProductsList | null; /** A short reference tag. Allows you to select related firewall rules. */ ref?: string | null; } export const RulesBulkDeleteResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), action: S.optional(S.NullOr(RulesBulkDeleteResultItemAction)), description: S.optional(S.NullOr(S.String)), filter: S.optional(S.NullOr(RulesBulkDeleteResultItemFilter)), paused: S.optional(S.NullOr(S.Boolean)), priority: S.optional(S.NullOr(S.Number)), products: S.optional(S.NullOr(RulesBulkDeleteResultItemProductsList)), ref: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "RulesBulkDeleteResultItem", }) as any as S.Schema; export type RulesBulkDeleteResultList = Array; export const RulesBulkDeleteResultList = /*@__PURE__*/ S.Array( RulesBulkDeleteResultItem, ) as any as S.Schema; export interface BulkDeleteRulesResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: RulesBulkDeleteResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const BulkDeleteRulesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: RulesBulkDeleteResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "BulkDeleteRulesResponse", }) as any as S.Schema; export interface BulkPatchRulesRequest { /** Defines an identifier. */ zoneId: string; } export const BulkPatchRulesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }) .pipe( T.Http({ method: "PATCH", uri: "/zones/{zone_id}/firewall/rules", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "BulkPatchRulesRequest", }) as any as S.Schema; export type RulesBulkEditResultItemAction = | "block" | "challenge" | "js_challenge" | "managed_challenge" | "allow" | "log" | "bypass"; export const RulesBulkEditResultItemAction = /*@__PURE__*/ S.String; export type RulesBulkEditResultItemFilterFirewallFilter = RulesBulkDeleteResultItemFilterFirewallFilter; export const RulesBulkEditResultItemFilterFirewallFilter = RulesBulkDeleteResultItemFilterFirewallFilter; export type RulesBulkEditResultItemFilterDeletedFilter = RulesBulkDeleteResultItemFilterDeletedFilter; export const RulesBulkEditResultItemFilterDeletedFilter = RulesBulkDeleteResultItemFilterDeletedFilter; export type RulesBulkEditResultItemFilter = | RulesBulkDeleteResultItemFilterFirewallFilter | RulesBulkDeleteResultItemFilterDeletedFilter; export const RulesBulkEditResultItemFilter = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([ ["id", "description", "expression", "paused", "ref"], ["id", "deleted"], ]), ); export type RulesBulkEditResultItemProductsItem = | "zoneLockdown" | "uaBlock" | "bic" | "hot" | "securityLevel" | "rateLimit" | "waf"; export const RulesBulkEditResultItemProductsItem = /*@__PURE__*/ S.String; export type RulesBulkEditResultItemProductsList = Array; export const RulesBulkEditResultItemProductsList = /*@__PURE__*/ S.Array( RulesBulkEditResultItemProductsItem, ) as any as S.Schema; export interface RulesBulkEditResultItem { /** The unique identifier of the firewall rule. */ id?: string | null; /** The action to apply to a matched request. The `log` action is only available on an Enterprise plan. */ action?: RulesBulkEditResultItemAction | null; /** An informative summary of the firewall rule. */ description?: string | null; filter?: RulesBulkEditResultItemFilter | null; /** When true, indicates that the firewall rule is currently paused. */ paused?: boolean | null; /** The priority of the rule. Optional value used to define the processing order. A lower number indicates a higher priority. If not provided, rules with a defined priority will be processed before rules without a priority. */ priority?: number | null; products?: RulesBulkEditResultItemProductsList | null; /** A short reference tag. Allows you to select related firewall rules. */ ref?: string | null; } export const RulesBulkEditResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), action: S.optional(S.NullOr(RulesBulkEditResultItemAction)), description: S.optional(S.NullOr(S.String)), filter: S.optional(S.NullOr(RulesBulkEditResultItemFilter)), paused: S.optional(S.NullOr(S.Boolean)), priority: S.optional(S.NullOr(S.Number)), products: S.optional(S.NullOr(RulesBulkEditResultItemProductsList)), ref: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "RulesBulkEditResultItem", }) as any as S.Schema; export type RulesBulkEditResultList = Array; export const RulesBulkEditResultList = /*@__PURE__*/ S.Array( RulesBulkEditResultItem, ) as any as S.Schema; export interface BulkPatchRulesResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: RulesBulkEditResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const BulkPatchRulesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: RulesBulkEditResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "BulkPatchRulesResponse", }) as any as S.Schema; export interface BulkPutRulesRequest { /** Defines an identifier. */ zoneId: string; } export const BulkPutRulesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }) .pipe( T.Http({ method: "PUT", uri: "/zones/{zone_id}/firewall/rules", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "BulkPutRulesRequest", }) as any as S.Schema; export type RulesBulkUpdateResultItemAction = | "block" | "challenge" | "js_challenge" | "managed_challenge" | "allow" | "log" | "bypass"; export const RulesBulkUpdateResultItemAction = /*@__PURE__*/ S.String; export type RulesBulkUpdateResultItemFilterFirewallFilter = RulesBulkDeleteResultItemFilterFirewallFilter; export const RulesBulkUpdateResultItemFilterFirewallFilter = RulesBulkDeleteResultItemFilterFirewallFilter; export type RulesBulkUpdateResultItemFilterDeletedFilter = RulesBulkDeleteResultItemFilterDeletedFilter; export const RulesBulkUpdateResultItemFilterDeletedFilter = RulesBulkDeleteResultItemFilterDeletedFilter; export type RulesBulkUpdateResultItemFilter = | RulesBulkDeleteResultItemFilterFirewallFilter | RulesBulkDeleteResultItemFilterDeletedFilter; export const RulesBulkUpdateResultItemFilter = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([ ["id", "description", "expression", "paused", "ref"], ["id", "deleted"], ]), ); export type RulesBulkUpdateResultItemProductsItem = | "zoneLockdown" | "uaBlock" | "bic" | "hot" | "securityLevel" | "rateLimit" | "waf"; export const RulesBulkUpdateResultItemProductsItem = /*@__PURE__*/ S.String; export type RulesBulkUpdateResultItemProductsList = Array; export const RulesBulkUpdateResultItemProductsList = /*@__PURE__*/ S.Array( RulesBulkUpdateResultItemProductsItem, ) as any as S.Schema; export interface RulesBulkUpdateResultItem { /** The unique identifier of the firewall rule. */ id?: string | null; /** The action to apply to a matched request. The `log` action is only available on an Enterprise plan. */ action?: RulesBulkUpdateResultItemAction | null; /** An informative summary of the firewall rule. */ description?: string | null; filter?: RulesBulkUpdateResultItemFilter | null; /** When true, indicates that the firewall rule is currently paused. */ paused?: boolean | null; /** The priority of the rule. Optional value used to define the processing order. A lower number indicates a higher priority. If not provided, rules with a defined priority will be processed before rules without a priority. */ priority?: number | null; products?: RulesBulkUpdateResultItemProductsList | null; /** A short reference tag. Allows you to select related firewall rules. */ ref?: string | null; } export const RulesBulkUpdateResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), action: S.optional(S.NullOr(RulesBulkUpdateResultItemAction)), description: S.optional(S.NullOr(S.String)), filter: S.optional(S.NullOr(RulesBulkUpdateResultItemFilter)), paused: S.optional(S.NullOr(S.Boolean)), priority: S.optional(S.NullOr(S.Number)), products: S.optional(S.NullOr(RulesBulkUpdateResultItemProductsList)), ref: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "RulesBulkUpdateResultItem", }) as any as S.Schema; export type RulesBulkUpdateResultList = Array; export const RulesBulkUpdateResultList = /*@__PURE__*/ S.Array( RulesBulkUpdateResultItem, ) as any as S.Schema; export interface BulkPutRulesResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: RulesBulkUpdateResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const BulkPutRulesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: RulesBulkUpdateResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "BulkPutRulesResponse", }) as any as S.Schema; export type AccessRulesCreateRequestConfigurationAccessRuleIPConfigurationTarget = "ip"; export const AccessRulesCreateRequestConfigurationAccessRuleIPConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesCreateRequestConfigurationAccessRuleIPConfiguration { /** The configuration target. You must set the target to `ip` when specifying an IP address in the rule. */ target?: | AccessRulesCreateRequestConfigurationAccessRuleIPConfigurationTarget | (string & {}); /** The IP address to match. This address will be compared to the IP address of incoming requests. */ value?: string; } export const AccessRulesCreateRequestConfigurationAccessRuleIPConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( AccessRulesCreateRequestConfigurationAccessRuleIPConfigurationTarget, ), value: S.optional(S.String), }), ).annotate({ identifier: "AccessRulesCreateRequestConfigurationAccessRuleIPConfiguration", }) as any as S.Schema; export type AccessRulesCreateRequestConfigurationIPV6ConfigurationTarget = "ip6"; export const AccessRulesCreateRequestConfigurationIPV6ConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesCreateRequestConfigurationIPV6Configuration { /** The configuration target. You must set the target to `ip6` when specifying an IPv6 address in the rule. */ target?: | AccessRulesCreateRequestConfigurationIPV6ConfigurationTarget | (string & {}); /** The IPv6 address to match. */ value?: string; } export const AccessRulesCreateRequestConfigurationIPV6Configuration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( AccessRulesCreateRequestConfigurationIPV6ConfigurationTarget, ), value: S.optional(S.String), }), ).annotate({ identifier: "AccessRulesCreateRequestConfigurationIPV6Configuration", }) as any as S.Schema; export type AccessRulesCreateRequestConfigurationAccessRuleCIDRConfigurationTarget = "ip_range"; export const AccessRulesCreateRequestConfigurationAccessRuleCIDRConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesCreateRequestConfigurationAccessRuleCIDRConfiguration { /** The configuration target. You must set the target to `ip_range` when specifying an IP address range in the rule. */ target?: | AccessRulesCreateRequestConfigurationAccessRuleCIDRConfigurationTarget | (string & {}); /** The IP address range to match. You can only use prefix lengths `/16` and `/24` for IPv4 ranges, and prefix lengths `/32`, `/48`, and `/64` for IPv6 ranges. */ value?: string; } export const AccessRulesCreateRequestConfigurationAccessRuleCIDRConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( AccessRulesCreateRequestConfigurationAccessRuleCIDRConfigurationTarget, ), value: S.optional(S.String), }), ).annotate({ identifier: "AccessRulesCreateRequestConfigurationAccessRuleCIDRConfiguration", }) as any as S.Schema; export type AccessRulesCreateRequestConfigurationASNConfigurationTarget = "asn"; export const AccessRulesCreateRequestConfigurationASNConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesCreateRequestConfigurationASNConfiguration { /** The configuration target. You must set the target to `asn` when specifying an Autonomous System Number (ASN) in the rule. */ target?: | AccessRulesCreateRequestConfigurationASNConfigurationTarget | (string & {}); /** The AS number to match. */ value?: string; } export const AccessRulesCreateRequestConfigurationASNConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( AccessRulesCreateRequestConfigurationASNConfigurationTarget, ), value: S.optional(S.String), }), ).annotate({ identifier: "AccessRulesCreateRequestConfigurationASNConfiguration", }) as any as S.Schema; export type AccessRulesCreateRequestConfigurationCountryConfigurationTarget = "country"; export const AccessRulesCreateRequestConfigurationCountryConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesCreateRequestConfigurationCountryConfiguration { /** The configuration target. You must set the target to `country` when specifying a country code in the rule. */ target?: | AccessRulesCreateRequestConfigurationCountryConfigurationTarget | (string & {}); /** The two-letter ISO-3166-1 alpha-2 code to match. For more information, refer to [IP Access rules: Parameters](https://developers.cloudflare.com/waf/tools/ip-access-rules/parameters/#country). */ value?: string; } export const AccessRulesCreateRequestConfigurationCountryConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( AccessRulesCreateRequestConfigurationCountryConfigurationTarget, ), value: S.optional(S.String), }), ).annotate({ identifier: "AccessRulesCreateRequestConfigurationCountryConfiguration", }) as any as S.Schema; export type AccessRulesCreateRequestConfiguration = | AccessRulesCreateRequestConfigurationAccessRuleIPConfiguration | AccessRulesCreateRequestConfigurationIPV6Configuration | AccessRulesCreateRequestConfigurationAccessRuleCIDRConfiguration | AccessRulesCreateRequestConfigurationASNConfiguration | AccessRulesCreateRequestConfigurationCountryConfiguration; export const AccessRulesCreateRequestConfiguration = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([ ["target", "value"], ["target", "value"], ["target", "value"], ["target", "value"], ["target", "value"], ]), ); export type AccessRulesCreateRequestMode = | "block" | "challenge" | "whitelist" | "js_challenge" | "managed_challenge"; export const AccessRulesCreateRequestMode = /*@__PURE__*/ S.String; export interface CreateAccessRuleForAccountRequest { /** The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. */ accountId: string; /** The rule configuration. */ configuration: AccessRulesCreateRequestConfiguration; /** The action to apply to a matched request. */ mode: AccessRulesCreateRequestMode | (string & {}); /** An informative summary of the rule, typically used as a reminder or explanation. */ notes?: string; } export const CreateAccessRuleForAccountRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), configuration: AccessRulesCreateRequestConfiguration, mode: AccessRulesCreateRequestMode, notes: S.optional(S.String), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/firewall/access_rules/rules", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateAccessRuleForAccountRequest", }) as any as S.Schema; export type AccessRulesCreateResponseAllowedModesItem = | "block" | "challenge" | "whitelist" | "js_challenge" | "managed_challenge"; export const AccessRulesCreateResponseAllowedModesItem = /*@__PURE__*/ S.String; export type AccessRulesCreateResponseAllowedModesList = Array; export const AccessRulesCreateResponseAllowedModesList = /*@__PURE__*/ S.Array( AccessRulesCreateResponseAllowedModesItem, ) as any as S.Schema; export type AccessRulesCreateResponseConfigurationAccessRuleIPConfigurationTarget = "ip"; export const AccessRulesCreateResponseConfigurationAccessRuleIPConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesCreateResponseConfigurationAccessRuleIPConfiguration { /** The configuration target. You must set the target to `ip` when specifying an IP address in the rule. */ target?: AccessRulesCreateResponseConfigurationAccessRuleIPConfigurationTarget | null; /** The IP address to match. This address will be compared to the IP address of incoming requests. */ value?: string | null; } export const AccessRulesCreateResponseConfigurationAccessRuleIPConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr( AccessRulesCreateResponseConfigurationAccessRuleIPConfigurationTarget, ), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "AccessRulesCreateResponseConfigurationAccessRuleIPConfiguration", }) as any as S.Schema; export type AccessRulesCreateResponseConfigurationIPV6ConfigurationTarget = "ip6"; export const AccessRulesCreateResponseConfigurationIPV6ConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesCreateResponseConfigurationIPV6Configuration { /** The configuration target. You must set the target to `ip6` when specifying an IPv6 address in the rule. */ target?: AccessRulesCreateResponseConfigurationIPV6ConfigurationTarget | null; /** The IPv6 address to match. */ value?: string | null; } export const AccessRulesCreateResponseConfigurationIPV6Configuration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr(AccessRulesCreateResponseConfigurationIPV6ConfigurationTarget), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "AccessRulesCreateResponseConfigurationIPV6Configuration", }) as any as S.Schema; export type AccessRulesCreateResponseConfigurationAccessRuleCIDRConfigurationTarget = "ip_range"; export const AccessRulesCreateResponseConfigurationAccessRuleCIDRConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesCreateResponseConfigurationAccessRuleCIDRConfiguration { /** The configuration target. You must set the target to `ip_range` when specifying an IP address range in the rule. */ target?: AccessRulesCreateResponseConfigurationAccessRuleCIDRConfigurationTarget | null; /** The IP address range to match. You can only use prefix lengths `/16` and `/24` for IPv4 ranges, and prefix lengths `/32`, `/48`, and `/64` for IPv6 ranges. */ value?: string | null; } export const AccessRulesCreateResponseConfigurationAccessRuleCIDRConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr( AccessRulesCreateResponseConfigurationAccessRuleCIDRConfigurationTarget, ), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "AccessRulesCreateResponseConfigurationAccessRuleCIDRConfiguration", }) as any as S.Schema; export type AccessRulesCreateResponseConfigurationASNConfigurationTarget = "asn"; export const AccessRulesCreateResponseConfigurationASNConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesCreateResponseConfigurationASNConfiguration { /** The configuration target. You must set the target to `asn` when specifying an Autonomous System Number (ASN) in the rule. */ target?: AccessRulesCreateResponseConfigurationASNConfigurationTarget | null; /** The AS number to match. */ value?: string | null; } export const AccessRulesCreateResponseConfigurationASNConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr(AccessRulesCreateResponseConfigurationASNConfigurationTarget), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "AccessRulesCreateResponseConfigurationASNConfiguration", }) as any as S.Schema; export type AccessRulesCreateResponseConfigurationCountryConfigurationTarget = "country"; export const AccessRulesCreateResponseConfigurationCountryConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesCreateResponseConfigurationCountryConfiguration { /** The configuration target. You must set the target to `country` when specifying a country code in the rule. */ target?: AccessRulesCreateResponseConfigurationCountryConfigurationTarget | null; /** The two-letter ISO-3166-1 alpha-2 code to match. For more information, refer to [IP Access rules: Parameters](https://developers.cloudflare.com/waf/tools/ip-access-rules/parameters/#country). */ value?: string | null; } export const AccessRulesCreateResponseConfigurationCountryConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr( AccessRulesCreateResponseConfigurationCountryConfigurationTarget, ), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "AccessRulesCreateResponseConfigurationCountryConfiguration", }) as any as S.Schema; export type AccessRulesCreateResponseConfiguration = | AccessRulesCreateResponseConfigurationAccessRuleIPConfiguration | AccessRulesCreateResponseConfigurationIPV6Configuration | AccessRulesCreateResponseConfigurationAccessRuleCIDRConfiguration | AccessRulesCreateResponseConfigurationASNConfiguration | AccessRulesCreateResponseConfigurationCountryConfiguration; export const AccessRulesCreateResponseConfiguration = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([ ["target", "value"], ["target", "value"], ["target", "value"], ["target", "value"], ["target", "value"], ]), ); export type AccessRulesCreateResponseMode = | "block" | "challenge" | "whitelist" | "js_challenge" | "managed_challenge"; export const AccessRulesCreateResponseMode = /*@__PURE__*/ S.String; export type AccessRulesCreateResponseScopeType = "user" | "organization"; export const AccessRulesCreateResponseScopeType = /*@__PURE__*/ S.String; export interface AccessRulesCreateResponseScope { /** Defines an identifier. */ id?: string | null; /** The contact email address of the user. */ email?: string | null; /** Defines the scope of the rule. */ type?: AccessRulesCreateResponseScopeType | null; } export const AccessRulesCreateResponseScope = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), email: S.optional(S.NullOr(S.String)), type: S.optional(S.NullOr(AccessRulesCreateResponseScopeType)), }), ).annotate({ identifier: "AccessRulesCreateResponseScope", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateAccessRuleResponse { /** The unique identifier of the IP Access rule. */ id: string; /** The available actions that a rule can apply to a matched request. */ allowedModes: AccessRulesCreateResponseAllowedModesList; /** The rule configuration. */ configuration: AccessRulesCreateResponseConfiguration; /** The action to apply to a matched request. */ mode: AccessRulesCreateResponseMode; /** The timestamp of when the rule was created. */ createdOn?: string | null; /** The timestamp of when the rule was last modified. */ modifiedOn?: string | null; /** An informative summary of the rule, typically used as a reminder or explanation. */ notes?: string | null; /** All zones owned by the user will have the rule applied. */ scope?: AccessRulesCreateResponseScope | null; } export const CreateAccessRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, allowedModes: AccessRulesCreateResponseAllowedModesList.pipe( T.Body("allowed_modes"), ), configuration: AccessRulesCreateResponseConfiguration, mode: AccessRulesCreateResponseMode, createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), notes: S.optional(S.NullOr(S.String)), scope: S.optional(S.NullOr(AccessRulesCreateResponseScope)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateAccessRuleResponse", }) as any as S.Schema; export interface CreateAccessRuleForZoneRequest { /** The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. */ zoneId: string; /** The rule configuration. */ configuration: AccessRulesCreateRequestConfiguration; /** The action to apply to a matched request. */ mode: AccessRulesCreateRequestMode | (string & {}); /** An informative summary of the rule, typically used as a reminder or explanation. */ notes?: string; } export const CreateAccessRuleForZoneRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), configuration: AccessRulesCreateRequestConfiguration, mode: AccessRulesCreateRequestMode, notes: S.optional(S.String), }) .pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/firewall/access_rules/rules", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateAccessRuleForZoneRequest", }) as any as S.Schema; export type LockdownsCreateRequestConfigurationsLockdownIPConfigurationTarget = "ip"; export const LockdownsCreateRequestConfigurationsLockdownIPConfigurationTarget = /*@__PURE__*/ S.String; export interface LockdownsCreateRequestConfigurationsLockdownIPConfiguration { /** The configuration target. You must set the target to `ip` when specifying an IP address in the Zone Lockdown rule. */ target?: | LockdownsCreateRequestConfigurationsLockdownIPConfigurationTarget | (string & {}) | null; /** The IP address to match. This address will be compared to the IP address of incoming requests. */ value?: string | null; } export const LockdownsCreateRequestConfigurationsLockdownIPConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr( LockdownsCreateRequestConfigurationsLockdownIPConfigurationTarget, ), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "LockdownsCreateRequestConfigurationsLockdownIPConfiguration", }) as any as S.Schema; export type LockdownsCreateRequestConfigurationsLockdownCIDRConfigurationTarget = "ip_range"; export const LockdownsCreateRequestConfigurationsLockdownCIDRConfigurationTarget = /*@__PURE__*/ S.String; export interface LockdownsCreateRequestConfigurationsLockdownCIDRConfiguration { /** The configuration target. You must set the target to `ip_range` when specifying an IP address range in the Zone Lockdown rule. */ target?: | LockdownsCreateRequestConfigurationsLockdownCIDRConfigurationTarget | (string & {}) | null; /** The IP address range to match. You can only use prefix lengths `/16` and `/24`. */ value?: string | null; } export const LockdownsCreateRequestConfigurationsLockdownCIDRConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr( LockdownsCreateRequestConfigurationsLockdownCIDRConfigurationTarget, ), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "LockdownsCreateRequestConfigurationsLockdownCIDRConfiguration", }) as any as S.Schema; export type LockdownsCreateRequestConfigurations = | LockdownsCreateRequestConfigurationsLockdownIPConfiguration | LockdownsCreateRequestConfigurationsLockdownCIDRConfiguration; export const LockdownsCreateRequestConfigurations = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([ ["target", "value"], ["target", "value"], ]), ); export type LockdownConfigurationsList = Array; export const LockdownConfigurationsList = /*@__PURE__*/ S.Array( LockdownsCreateRequestConfigurations, ) as any as S.Schema; export type LockdownsCreateRequestUrlsList = Array; export const LockdownsCreateRequestUrlsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface CreateLockdownRequest { /** Defines an identifier. */ zoneId: string; /** A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of `ip` or `ip_range` configurations. */ configurations: LockdownConfigurationsList; /** The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns. */ urls: LockdownsCreateRequestUrlsList; /** An informative summary of the rule. This value is sanitized and any tags will be removed. */ description?: string; /** When true, indicates that the rule is currently paused. */ paused?: boolean; /** The priority of the rule to control the processing order. A lower number indicates higher priority. If not provided, any rules with a configured priority will be processed before rules without a priority. */ priority?: number; } export const CreateLockdownRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), configurations: LockdownConfigurationsList, urls: LockdownsCreateRequestUrlsList, description: S.optional(S.String), paused: S.optional(S.Boolean), priority: S.optional(S.Number), }) .pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/firewall/lockdowns", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateLockdownRequest", }) as any as S.Schema; export type LockdownsCreateResponseUrlsList = Array; export const LockdownsCreateResponseUrlsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateLockdownResponse { /** The unique identifier of the Zone Lockdown rule. */ id: string; /** A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of `ip` or `ip_range` configurations. */ configurations: LockdownConfigurationsList; /** The timestamp of when the rule was created. */ createdOn: string; /** An informative summary of the rule. */ description: string; /** The timestamp of when the rule was last modified. */ modifiedOn: string; /** When true, indicates that the rule is currently paused. */ paused: boolean; /** The URLs to include in the rule definition. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns. */ urls: LockdownsCreateResponseUrlsList; /** The priority of the Zone Lockdown rule, echoed on reads. */ priority?: number | null; } export const CreateLockdownResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, configurations: LockdownConfigurationsList, createdOn: S.String.pipe(T.Body("created_on")), description: S.String, modifiedOn: S.String.pipe(T.Body("modified_on")), paused: S.Boolean, urls: LockdownsCreateResponseUrlsList, priority: S.optional(S.NullOr(S.Number)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateLockdownResponse", }) as any as S.Schema; export type RulesCreateRequestActionMode = | "simulate" | "ban" | "challenge" | "js_challenge" | "managed_challenge"; export const RulesCreateRequestActionMode = /*@__PURE__*/ S.String; export interface RulesCreateRequestActionResponse { /** The response body to return. The value must conform to the configured content type. */ body?: string; /** The content type of the body. Must be one of the following: `text/plain`, `text/xml`, or `application/json`. */ contentType?: string; } export const RulesCreateRequestActionResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ body: S.optional(S.String), contentType: S.optional(S.String.pipe(T.Body("content_type"))), }), ).annotate({ identifier: "RulesCreateRequestActionResponse", }) as any as S.Schema; export interface RulesCreateRequestAction { /** The action to perform. */ mode?: RulesCreateRequestActionMode | (string & {}); /** A custom content type and reponse to return when the threshold is exceeded. The custom response configured in this object will override the custom error for the zone. This object is optional. */ response?: RulesCreateRequestActionResponse; /** The time in seconds during which Cloudflare will perform the mitigation action. Must be an integer value greater than or equal to the period. */ timeout?: number; } export const RulesCreateRequestAction = /*@__PURE__*/ S.suspend(() => S.Struct({ mode: S.optional(RulesCreateRequestActionMode), response: S.optional(RulesCreateRequestActionResponse), timeout: S.optional(S.Number), }), ).annotate({ identifier: "RulesCreateRequestAction", }) as any as S.Schema; export interface RulesCreateRequestFilter { /** The unique identifier of the filter. */ id?: string; /** An informative summary of the filter. */ description?: string; /** The filter expression. For more information, refer to [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). */ expression?: string; /** When true, indicates that the filter is currently paused. */ paused?: boolean; /** A short reference tag. Allows you to select related filters. */ ref?: string; } export const RulesCreateRequestFilter = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.String), description: S.optional(S.String), expression: S.optional(S.String), paused: S.optional(S.Boolean), ref: S.optional(S.String), }), ).annotate({ identifier: "RulesCreateRequestFilter", }) as any as S.Schema; export interface CreateRuleRequest { /** Defines an identifier. */ zoneId: string; /** The action to perform when the threshold of matched traffic within the configured period is exceeded. */ action: RulesCreateRequestAction; filter: RulesCreateRequestFilter; } export const CreateRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), action: RulesCreateRequestAction, filter: RulesCreateRequestFilter, }) .pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/firewall/rules", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateRuleRequest", }) as any as S.Schema; export type RulesCreateResultItemAction = | "block" | "challenge" | "js_challenge" | "managed_challenge" | "allow" | "log" | "bypass"; export const RulesCreateResultItemAction = /*@__PURE__*/ S.String; export type RulesCreateResultItemFilterFirewallFilter = RulesBulkDeleteResultItemFilterFirewallFilter; export const RulesCreateResultItemFilterFirewallFilter = RulesBulkDeleteResultItemFilterFirewallFilter; export type RulesCreateResultItemFilterDeletedFilter = RulesBulkDeleteResultItemFilterDeletedFilter; export const RulesCreateResultItemFilterDeletedFilter = RulesBulkDeleteResultItemFilterDeletedFilter; export type RulesCreateResultItemFilter = | RulesBulkDeleteResultItemFilterFirewallFilter | RulesBulkDeleteResultItemFilterDeletedFilter; export const RulesCreateResultItemFilter = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([ ["id", "description", "expression", "paused", "ref"], ["id", "deleted"], ]), ); export type RulesCreateResultItemProductsItem = | "zoneLockdown" | "uaBlock" | "bic" | "hot" | "securityLevel" | "rateLimit" | "waf"; export const RulesCreateResultItemProductsItem = /*@__PURE__*/ S.String; export type RulesCreateResultItemProductsList = Array; export const RulesCreateResultItemProductsList = /*@__PURE__*/ S.Array( RulesCreateResultItemProductsItem, ) as any as S.Schema; export interface RulesCreateResultItem { /** The unique identifier of the firewall rule. */ id?: string | null; /** The action to apply to a matched request. The `log` action is only available on an Enterprise plan. */ action?: RulesCreateResultItemAction | null; /** An informative summary of the firewall rule. */ description?: string | null; filter?: RulesCreateResultItemFilter | null; /** When true, indicates that the firewall rule is currently paused. */ paused?: boolean | null; /** The priority of the rule. Optional value used to define the processing order. A lower number indicates a higher priority. If not provided, rules with a defined priority will be processed before rules without a priority. */ priority?: number | null; products?: RulesCreateResultItemProductsList | null; /** A short reference tag. Allows you to select related firewall rules. */ ref?: string | null; } export const RulesCreateResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), action: S.optional(S.NullOr(RulesCreateResultItemAction)), description: S.optional(S.NullOr(S.String)), filter: S.optional(S.NullOr(RulesCreateResultItemFilter)), paused: S.optional(S.NullOr(S.Boolean)), priority: S.optional(S.NullOr(S.Number)), products: S.optional(S.NullOr(RulesCreateResultItemProductsList)), ref: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "RulesCreateResultItem", }) as any as S.Schema; export type RulesCreateResultList = Array; export const RulesCreateResultList = /*@__PURE__*/ S.Array( RulesCreateResultItem, ) as any as S.Schema; export interface CreateRuleResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: RulesCreateResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const CreateRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: RulesCreateResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateRuleResponse", }) as any as S.Schema; export type UaRulesCreateRequestConfigurationTarget = "ua"; export const UaRulesCreateRequestConfigurationTarget = /*@__PURE__*/ S.String; export interface UaRulesCreateRequestConfiguration { /** The configuration target. You must set the target to `ua` when specifying a user agent in the rule. */ target?: UaRulesCreateRequestConfigurationTarget | (string & {}); /** the user agent to exactly match */ value?: string; } export const UaRulesCreateRequestConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional(UaRulesCreateRequestConfigurationTarget), value: S.optional(S.String), }), ).annotate({ identifier: "UaRulesCreateRequestConfiguration", }) as any as S.Schema; export type UaRulesCreateRequestMode = | "block" | "challenge" | "whitelist" | "js_challenge" | "managed_challenge"; export const UaRulesCreateRequestMode = /*@__PURE__*/ S.String; export interface CreateUaRuleRequest { /** Defines an identifier. */ zoneId: string; configuration: UaRulesCreateRequestConfiguration; /** The action to apply to a matched request. */ mode: UaRulesCreateRequestMode | (string & {}); /** An informative summary of the rule. This value is sanitized and any tags will be removed. */ description?: string; /** When true, indicates that the rule is currently paused. */ paused?: boolean; } export const CreateUaRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), configuration: UaRulesCreateRequestConfiguration, mode: UaRulesCreateRequestMode, description: S.optional(S.String), paused: S.optional(S.Boolean), }) .pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/firewall/ua_rules", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateUaRuleRequest", }) as any as S.Schema; export interface UaRulesCreateResponseConfiguration { /** The configuration target for this rule. You must set the target to `ua` for User Agent Blocking rules. */ target?: string | null; /** The exact user agent string to match. This value will be compared to the received `User-Agent` HTTP header value. */ value?: string | null; } export const UaRulesCreateResponseConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional(S.NullOr(S.String)), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "UaRulesCreateResponseConfiguration", }) as any as S.Schema; export type UaRulesCreateResponseMode = | "block" | "challenge" | "js_challenge" | "managed_challenge"; export const UaRulesCreateResponseMode = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateUaRuleResponse { /** The unique identifier of the User Agent Blocking rule. */ id?: string | null; /** The configuration object for the current rule. */ configuration?: UaRulesCreateResponseConfiguration | null; /** An informative summary of the rule. */ description?: string | null; /** The action to apply to a matched request. */ mode?: UaRulesCreateResponseMode | null; /** When true, indicates that the rule is currently paused. */ paused?: boolean | null; } export const CreateUaRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), configuration: S.optional(S.NullOr(UaRulesCreateResponseConfiguration)), description: S.optional(S.NullOr(S.String)), mode: S.optional(S.NullOr(UaRulesCreateResponseMode)), paused: S.optional(S.NullOr(S.Boolean)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateUaRuleResponse", }) as any as S.Schema; export type WafOverridesCreateRequestUrlsList = Array; export const WafOverridesCreateRequestUrlsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface CreateWafOverrideRequest { /** Defines an identifier. */ zoneId: string; /** The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns. */ urls: WafOverridesCreateRequestUrlsList; } export const CreateWafOverrideRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), urls: WafOverridesCreateRequestUrlsList, }) .pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/firewall/waf/overrides", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateWafOverrideRequest", }) as any as S.Schema; export type WafOverridesCreateResponseGroupsMap = { [key: string]: unknown | undefined; }; export const WafOverridesCreateResponseGroupsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type WafOverridesCreateResponseRewriteActionBlock = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesCreateResponseRewriteActionBlock = /*@__PURE__*/ S.String; export type WafOverridesCreateResponseRewriteActionChallenge = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesCreateResponseRewriteActionChallenge = /*@__PURE__*/ S.String; export type WafOverridesCreateResponseRewriteActionDefault = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesCreateResponseRewriteActionDefault = /*@__PURE__*/ S.String; export type WafOverridesCreateResponseRewriteActionDisable = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesCreateResponseRewriteActionDisable = /*@__PURE__*/ S.String; export type WafOverridesCreateResponseRewriteActionSimulate = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesCreateResponseRewriteActionSimulate = /*@__PURE__*/ S.String; export interface WafOverridesCreateResponseRewriteAction { /** The WAF rule action to apply. */ block?: WafOverridesCreateResponseRewriteActionBlock | null; /** The WAF rule action to apply. */ challenge?: WafOverridesCreateResponseRewriteActionChallenge | null; /** The WAF rule action to apply. */ default?: WafOverridesCreateResponseRewriteActionDefault | null; /** The WAF rule action to apply. */ disable?: WafOverridesCreateResponseRewriteActionDisable | null; /** The WAF rule action to apply. */ simulate?: WafOverridesCreateResponseRewriteActionSimulate | null; } export const WafOverridesCreateResponseRewriteAction = /*@__PURE__*/ S.suspend( () => S.Struct({ block: S.optional(S.NullOr(WafOverridesCreateResponseRewriteActionBlock)), challenge: S.optional( S.NullOr(WafOverridesCreateResponseRewriteActionChallenge), ), default: S.optional( S.NullOr(WafOverridesCreateResponseRewriteActionDefault), ), disable: S.optional( S.NullOr(WafOverridesCreateResponseRewriteActionDisable), ), simulate: S.optional( S.NullOr(WafOverridesCreateResponseRewriteActionSimulate), ), }), ).annotate({ identifier: "WafOverridesCreateResponseRewriteAction", }) as any as S.Schema; export type WafOverridesCreateResponseRules = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesCreateResponseRules = /*@__PURE__*/ S.String; export type WafOverridesCreateResponseUrlsList = Array; export const WafOverridesCreateResponseUrlsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateWafOverrideResponse { /** The unique identifier of the WAF override. */ id?: string | null; /** An informative summary of the current URI-based WAF override. */ description?: string | null; /** An object that allows you to enable or disable WAF rule groups for the current WAF override. Each key of this object must be the ID of a WAF rule group, and each value must be a valid WAF action (usually `default` or `disable`). When creating a new URI-based WAF override, you must provide a `groups` object or a `rules` object. */ groups?: WafOverridesCreateResponseGroupsMap | null; /** When true, indicates that the rule is currently paused. */ paused?: boolean | null; /** The relative priority of the current URI-based WAF override when multiple overrides match a single URL. A lower number indicates higher priority. Higher priority overrides may overwrite values set by lower priority overrides. */ priority?: number | null; /** Specifies that, when a WAF rule matches, its configured action will be replaced by the action configured in this object. */ rewriteAction?: WafOverridesCreateResponseRewriteAction | null; /** An object that allows you to override the action of specific WAF rules. Each key of this object must be the ID of a WAF rule, and each value must be a valid WAF action. Unless you are disabling a rule, ensure that you also enable the rule group that this WAF rule belongs to. When creating a new URI-based WAF override, you must provide a `groups` object or a `rules` object. */ rules?: WafOverridesCreateResponseRules | null; /** The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns. */ urls?: WafOverridesCreateResponseUrlsList | null; } export const CreateWafOverrideResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), description: S.optional(S.NullOr(S.String)), groups: S.optional(S.NullOr(WafOverridesCreateResponseGroupsMap)), paused: S.optional(S.NullOr(S.Boolean)), priority: S.optional(S.NullOr(S.Number)), rewriteAction: S.optional( S.NullOr(WafOverridesCreateResponseRewriteAction).pipe( T.Body("rewrite_action"), ), ), rules: S.optional(S.NullOr(WafOverridesCreateResponseRules)), urls: S.optional(S.NullOr(WafOverridesCreateResponseUrlsList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateWafOverrideResponse", }) as any as S.Schema; export interface DeleteAccessRuleForAccountRequest { /** The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. */ accountId: string; /** Unique identifier for a rule. */ ruleId: string; } export const DeleteAccessRuleForAccountRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), ruleId: S.String.pipe(T.Label("rule_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/accounts/{account_id}/firewall/access_rules/rules/{rule_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteAccessRuleForAccountRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteAccessRuleResponse { /** Defines an identifier. */ id: string; } export const DeleteAccessRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteAccessRuleResponse", }) as any as S.Schema; export interface DeleteAccessRuleForZoneRequest { /** The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. */ zoneId: string; /** Unique identifier for a rule. */ ruleId: string; } export const DeleteAccessRuleForZoneRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), ruleId: S.String.pipe(T.Label("rule_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/zones/{zone_id}/firewall/access_rules/rules/{rule_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteAccessRuleForZoneRequest", }) as any as S.Schema; export interface DeleteLockdownRequest { /** Defines an identifier. */ zoneId: string; /** The unique identifier of the Zone Lockdown rule. */ lockDownsId: string; } export const DeleteLockdownRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), lockDownsId: S.String.pipe(T.Label("lock_downs_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/zones/{zone_id}/firewall/lockdowns/{lock_downs_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteLockdownRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteLockdownResponse { /** The unique identifier of the Zone Lockdown rule. */ id?: string | null; } export const DeleteLockdownResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteLockdownResponse", }) as any as S.Schema; export interface DeleteRuleRequest { /** Defines an identifier. */ zoneId: string; /** The unique identifier of the firewall rule. */ ruleId: string; } export const DeleteRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), ruleId: S.String.pipe(T.Label("rule_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/zones/{zone_id}/firewall/rules/{rule_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteRuleRequest", }) as any as S.Schema; export type RulesDeleteResponseAction = | "block" | "challenge" | "js_challenge" | "managed_challenge" | "allow" | "log" | "bypass"; export const RulesDeleteResponseAction = /*@__PURE__*/ S.String; export type RulesDeleteResponseFilterFirewallFilter = RulesBulkDeleteResultItemFilterFirewallFilter; export const RulesDeleteResponseFilterFirewallFilter = RulesBulkDeleteResultItemFilterFirewallFilter; export type RulesDeleteResponseFilterDeletedFilter = RulesBulkDeleteResultItemFilterDeletedFilter; export const RulesDeleteResponseFilterDeletedFilter = RulesBulkDeleteResultItemFilterDeletedFilter; export type RulesDeleteResponseFilter = | RulesBulkDeleteResultItemFilterFirewallFilter | RulesBulkDeleteResultItemFilterDeletedFilter; export const RulesDeleteResponseFilter = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([ ["id", "description", "expression", "paused", "ref"], ["id", "deleted"], ]), ); export type RulesDeleteResponseProductsItem = | "zoneLockdown" | "uaBlock" | "bic" | "hot" | "securityLevel" | "rateLimit" | "waf"; export const RulesDeleteResponseProductsItem = /*@__PURE__*/ S.String; export type RulesDeleteResponseProductsList = Array; export const RulesDeleteResponseProductsList = /*@__PURE__*/ S.Array( RulesDeleteResponseProductsItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteRuleResponse { /** The unique identifier of the firewall rule. */ id?: string | null; /** The action to apply to a matched request. The `log` action is only available on an Enterprise plan. */ action?: RulesDeleteResponseAction | null; /** An informative summary of the firewall rule. */ description?: string | null; filter?: RulesDeleteResponseFilter | null; /** When true, indicates that the firewall rule is currently paused. */ paused?: boolean | null; /** The priority of the rule. Optional value used to define the processing order. A lower number indicates a higher priority. If not provided, rules with a defined priority will be processed before rules without a priority. */ priority?: number | null; products?: RulesDeleteResponseProductsList | null; /** A short reference tag. Allows you to select related firewall rules. */ ref?: string | null; } export const DeleteRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), action: S.optional(S.NullOr(RulesDeleteResponseAction)), description: S.optional(S.NullOr(S.String)), filter: S.optional(S.NullOr(RulesDeleteResponseFilter)), paused: S.optional(S.NullOr(S.Boolean)), priority: S.optional(S.NullOr(S.Number)), products: S.optional(S.NullOr(RulesDeleteResponseProductsList)), ref: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteRuleResponse", }) as any as S.Schema; export interface DeleteUaRuleRequest { /** Defines an identifier. */ zoneId: string; /** The unique identifier of the User Agent Blocking rule. */ uaRuleId: string; } export const DeleteUaRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), uaRuleId: S.String.pipe(T.Label("ua_rule_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/zones/{zone_id}/firewall/ua_rules/{ua_rule_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteUaRuleRequest", }) as any as S.Schema; export type UaRulesDeleteResponseConfiguration = UaRulesCreateResponseConfiguration; export const UaRulesDeleteResponseConfiguration = UaRulesCreateResponseConfiguration; export type UaRulesDeleteResponseMode = | "block" | "challenge" | "js_challenge" | "managed_challenge"; export const UaRulesDeleteResponseMode = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteUaRuleResponse { /** The unique identifier of the User Agent Blocking rule. */ id?: string | null; /** The configuration object for the current rule. */ configuration?: UaRulesCreateResponseConfiguration | null; /** An informative summary of the rule. */ description?: string | null; /** The action to apply to a matched request. */ mode?: UaRulesDeleteResponseMode | null; /** When true, indicates that the rule is currently paused. */ paused?: boolean | null; } export const DeleteUaRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), configuration: S.optional(S.NullOr(UaRulesCreateResponseConfiguration)), description: S.optional(S.NullOr(S.String)), mode: S.optional(S.NullOr(UaRulesDeleteResponseMode)), paused: S.optional(S.NullOr(S.Boolean)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteUaRuleResponse", }) as any as S.Schema; export interface DeleteWafOverrideRequest { /** Defines an identifier. */ zoneId: string; /** The unique identifier of the WAF override. */ overridesId: string; } export const DeleteWafOverrideRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), overridesId: S.String.pipe(T.Label("overrides_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/zones/{zone_id}/firewall/waf/overrides/{overrides_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteWafOverrideRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteWafOverrideResponse { /** The unique identifier of the WAF override. */ id?: string | null; } export const DeleteWafOverrideResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteWafOverrideResponse", }) as any as S.Schema; export interface GetAccessRuleForAccountRequest { /** The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. */ accountId: string; /** Unique identifier for a rule. */ ruleId: string; } export const GetAccessRuleForAccountRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), ruleId: S.String.pipe(T.Label("rule_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/firewall/access_rules/rules/{rule_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetAccessRuleForAccountRequest", }) as any as S.Schema; export type AccessRulesGetResponseAllowedModesItem = | "block" | "challenge" | "whitelist" | "js_challenge" | "managed_challenge"; export const AccessRulesGetResponseAllowedModesItem = /*@__PURE__*/ S.String; export type AccessRulesGetResponseAllowedModesList = Array; export const AccessRulesGetResponseAllowedModesList = /*@__PURE__*/ S.Array( AccessRulesGetResponseAllowedModesItem, ) as any as S.Schema; export type AccessRulesGetResponseConfigurationAccessRuleIPConfigurationTarget = "ip"; export const AccessRulesGetResponseConfigurationAccessRuleIPConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesGetResponseConfigurationAccessRuleIPConfiguration { /** The configuration target. You must set the target to `ip` when specifying an IP address in the rule. */ target?: AccessRulesGetResponseConfigurationAccessRuleIPConfigurationTarget | null; /** The IP address to match. This address will be compared to the IP address of incoming requests. */ value?: string | null; } export const AccessRulesGetResponseConfigurationAccessRuleIPConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr( AccessRulesGetResponseConfigurationAccessRuleIPConfigurationTarget, ), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "AccessRulesGetResponseConfigurationAccessRuleIPConfiguration", }) as any as S.Schema; export type AccessRulesGetResponseConfigurationIPV6ConfigurationTarget = "ip6"; export const AccessRulesGetResponseConfigurationIPV6ConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesGetResponseConfigurationIPV6Configuration { /** The configuration target. You must set the target to `ip6` when specifying an IPv6 address in the rule. */ target?: AccessRulesGetResponseConfigurationIPV6ConfigurationTarget | null; /** The IPv6 address to match. */ value?: string | null; } export const AccessRulesGetResponseConfigurationIPV6Configuration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr(AccessRulesGetResponseConfigurationIPV6ConfigurationTarget), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "AccessRulesGetResponseConfigurationIPV6Configuration", }) as any as S.Schema; export type AccessRulesGetResponseConfigurationAccessRuleCIDRConfigurationTarget = "ip_range"; export const AccessRulesGetResponseConfigurationAccessRuleCIDRConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesGetResponseConfigurationAccessRuleCIDRConfiguration { /** The configuration target. You must set the target to `ip_range` when specifying an IP address range in the rule. */ target?: AccessRulesGetResponseConfigurationAccessRuleCIDRConfigurationTarget | null; /** The IP address range to match. You can only use prefix lengths `/16` and `/24` for IPv4 ranges, and prefix lengths `/32`, `/48`, and `/64` for IPv6 ranges. */ value?: string | null; } export const AccessRulesGetResponseConfigurationAccessRuleCIDRConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr( AccessRulesGetResponseConfigurationAccessRuleCIDRConfigurationTarget, ), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "AccessRulesGetResponseConfigurationAccessRuleCIDRConfiguration", }) as any as S.Schema; export type AccessRulesGetResponseConfigurationASNConfigurationTarget = "asn"; export const AccessRulesGetResponseConfigurationASNConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesGetResponseConfigurationASNConfiguration { /** The configuration target. You must set the target to `asn` when specifying an Autonomous System Number (ASN) in the rule. */ target?: AccessRulesGetResponseConfigurationASNConfigurationTarget | null; /** The AS number to match. */ value?: string | null; } export const AccessRulesGetResponseConfigurationASNConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr(AccessRulesGetResponseConfigurationASNConfigurationTarget), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "AccessRulesGetResponseConfigurationASNConfiguration", }) as any as S.Schema; export type AccessRulesGetResponseConfigurationCountryConfigurationTarget = "country"; export const AccessRulesGetResponseConfigurationCountryConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesGetResponseConfigurationCountryConfiguration { /** The configuration target. You must set the target to `country` when specifying a country code in the rule. */ target?: AccessRulesGetResponseConfigurationCountryConfigurationTarget | null; /** The two-letter ISO-3166-1 alpha-2 code to match. For more information, refer to [IP Access rules: Parameters](https://developers.cloudflare.com/waf/tools/ip-access-rules/parameters/#country). */ value?: string | null; } export const AccessRulesGetResponseConfigurationCountryConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr(AccessRulesGetResponseConfigurationCountryConfigurationTarget), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "AccessRulesGetResponseConfigurationCountryConfiguration", }) as any as S.Schema; export type AccessRulesGetResponseConfiguration = | AccessRulesGetResponseConfigurationAccessRuleIPConfiguration | AccessRulesGetResponseConfigurationIPV6Configuration | AccessRulesGetResponseConfigurationAccessRuleCIDRConfiguration | AccessRulesGetResponseConfigurationASNConfiguration | AccessRulesGetResponseConfigurationCountryConfiguration; export const AccessRulesGetResponseConfiguration = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([ ["target", "value"], ["target", "value"], ["target", "value"], ["target", "value"], ["target", "value"], ]), ); export type AccessRulesGetResponseMode = | "block" | "challenge" | "whitelist" | "js_challenge" | "managed_challenge"; export const AccessRulesGetResponseMode = /*@__PURE__*/ S.String; export type AccessRulesGetResponseScopeType = "user" | "organization"; export const AccessRulesGetResponseScopeType = /*@__PURE__*/ S.String; export interface AccessRulesGetResponseScope { /** Defines an identifier. */ id?: string | null; /** The contact email address of the user. */ email?: string | null; /** Defines the scope of the rule. */ type?: AccessRulesGetResponseScopeType | null; } export const AccessRulesGetResponseScope = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), email: S.optional(S.NullOr(S.String)), type: S.optional(S.NullOr(AccessRulesGetResponseScopeType)), }), ).annotate({ identifier: "AccessRulesGetResponseScope", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetAccessRuleResponse { /** The unique identifier of the IP Access rule. */ id: string; /** The available actions that a rule can apply to a matched request. */ allowedModes: AccessRulesGetResponseAllowedModesList; /** The rule configuration. */ configuration: AccessRulesGetResponseConfiguration; /** The action to apply to a matched request. */ mode: AccessRulesGetResponseMode; /** The timestamp of when the rule was created. */ createdOn?: string | null; /** The timestamp of when the rule was last modified. */ modifiedOn?: string | null; /** An informative summary of the rule, typically used as a reminder or explanation. */ notes?: string | null; /** All zones owned by the user will have the rule applied. */ scope?: AccessRulesGetResponseScope | null; } export const GetAccessRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, allowedModes: AccessRulesGetResponseAllowedModesList.pipe( T.Body("allowed_modes"), ), configuration: AccessRulesGetResponseConfiguration, mode: AccessRulesGetResponseMode, createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), notes: S.optional(S.NullOr(S.String)), scope: S.optional(S.NullOr(AccessRulesGetResponseScope)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetAccessRuleResponse", }) as any as S.Schema; export interface GetAccessRuleForZoneRequest { /** The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. */ zoneId: string; /** Unique identifier for a rule. */ ruleId: string; } export const GetAccessRuleForZoneRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), ruleId: S.String.pipe(T.Label("rule_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/firewall/access_rules/rules/{rule_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetAccessRuleForZoneRequest", }) as any as S.Schema; export interface GetLockdownRequest { /** Defines an identifier. */ zoneId: string; /** The unique identifier of the Zone Lockdown rule. */ lockDownsId: string; } export const GetLockdownRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), lockDownsId: S.String.pipe(T.Label("lock_downs_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/firewall/lockdowns/{lock_downs_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetLockdownRequest", }) as any as S.Schema; export type LockdownsGetResponseUrlsList = Array; export const LockdownsGetResponseUrlsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetLockdownResponse { /** The unique identifier of the Zone Lockdown rule. */ id: string; /** A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of `ip` or `ip_range` configurations. */ configurations: LockdownConfigurationsList; /** The timestamp of when the rule was created. */ createdOn: string; /** An informative summary of the rule. */ description: string; /** The timestamp of when the rule was last modified. */ modifiedOn: string; /** When true, indicates that the rule is currently paused. */ paused: boolean; /** The URLs to include in the rule definition. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns. */ urls: LockdownsGetResponseUrlsList; /** The priority of the Zone Lockdown rule, echoed on reads. */ priority?: number | null; } export const GetLockdownResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, configurations: LockdownConfigurationsList, createdOn: S.String.pipe(T.Body("created_on")), description: S.String, modifiedOn: S.String.pipe(T.Body("modified_on")), paused: S.Boolean, urls: LockdownsGetResponseUrlsList, priority: S.optional(S.NullOr(S.Number)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetLockdownResponse", }) as any as S.Schema; export interface GetRuleRequest { /** Defines an identifier. */ zoneId: string; /** The unique identifier of the firewall rule. */ ruleId: string; } export const GetRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), ruleId: S.String.pipe(T.Label("rule_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/firewall/rules/{rule_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetRuleRequest" }) as any as S.Schema; export type RulesGetResponseAction = | "block" | "challenge" | "js_challenge" | "managed_challenge" | "allow" | "log" | "bypass"; export const RulesGetResponseAction = /*@__PURE__*/ S.String; export type RulesGetResponseFilterFirewallFilter = RulesBulkDeleteResultItemFilterFirewallFilter; export const RulesGetResponseFilterFirewallFilter = RulesBulkDeleteResultItemFilterFirewallFilter; export type RulesGetResponseFilterDeletedFilter = RulesBulkDeleteResultItemFilterDeletedFilter; export const RulesGetResponseFilterDeletedFilter = RulesBulkDeleteResultItemFilterDeletedFilter; export type RulesGetResponseFilter = | RulesBulkDeleteResultItemFilterFirewallFilter | RulesBulkDeleteResultItemFilterDeletedFilter; export const RulesGetResponseFilter = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([ ["id", "description", "expression", "paused", "ref"], ["id", "deleted"], ]), ); export type RulesGetResponseProductsItem = | "zoneLockdown" | "uaBlock" | "bic" | "hot" | "securityLevel" | "rateLimit" | "waf"; export const RulesGetResponseProductsItem = /*@__PURE__*/ S.String; export type RulesGetResponseProductsList = Array; export const RulesGetResponseProductsList = /*@__PURE__*/ S.Array( RulesGetResponseProductsItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetRuleResponse { /** The unique identifier of the firewall rule. */ id?: string | null; /** The action to apply to a matched request. The `log` action is only available on an Enterprise plan. */ action?: RulesGetResponseAction | null; /** An informative summary of the firewall rule. */ description?: string | null; filter?: RulesGetResponseFilter | null; /** When true, indicates that the firewall rule is currently paused. */ paused?: boolean | null; /** The priority of the rule. Optional value used to define the processing order. A lower number indicates a higher priority. If not provided, rules with a defined priority will be processed before rules without a priority. */ priority?: number | null; products?: RulesGetResponseProductsList | null; /** A short reference tag. Allows you to select related firewall rules. */ ref?: string | null; } export const GetRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), action: S.optional(S.NullOr(RulesGetResponseAction)), description: S.optional(S.NullOr(S.String)), filter: S.optional(S.NullOr(RulesGetResponseFilter)), paused: S.optional(S.NullOr(S.Boolean)), priority: S.optional(S.NullOr(S.Number)), products: S.optional(S.NullOr(RulesGetResponseProductsList)), ref: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetRuleResponse", }) as any as S.Schema; export interface GetUaRuleRequest { /** Defines an identifier. */ zoneId: string; /** The unique identifier of the User Agent Blocking rule. */ uaRuleId: string; } export const GetUaRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), uaRuleId: S.String.pipe(T.Label("ua_rule_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/firewall/ua_rules/{ua_rule_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetUaRuleRequest", }) as any as S.Schema; export type UaRulesGetResponseConfiguration = UaRulesCreateResponseConfiguration; export const UaRulesGetResponseConfiguration = UaRulesCreateResponseConfiguration; export type UaRulesGetResponseMode = | "block" | "challenge" | "js_challenge" | "managed_challenge"; export const UaRulesGetResponseMode = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetUaRuleResponse { /** The unique identifier of the User Agent Blocking rule. */ id?: string | null; /** The configuration object for the current rule. */ configuration?: UaRulesCreateResponseConfiguration | null; /** An informative summary of the rule. */ description?: string | null; /** The action to apply to a matched request. */ mode?: UaRulesGetResponseMode | null; /** When true, indicates that the rule is currently paused. */ paused?: boolean | null; } export const GetUaRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), configuration: S.optional(S.NullOr(UaRulesCreateResponseConfiguration)), description: S.optional(S.NullOr(S.String)), mode: S.optional(S.NullOr(UaRulesGetResponseMode)), paused: S.optional(S.NullOr(S.Boolean)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetUaRuleResponse", }) as any as S.Schema; export interface GetWafOverrideRequest { /** Defines an identifier. */ zoneId: string; /** The unique identifier of the WAF override. */ overridesId: string; } export const GetWafOverrideRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), overridesId: S.String.pipe(T.Label("overrides_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/firewall/waf/overrides/{overrides_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetWafOverrideRequest", }) as any as S.Schema; export type WafOverridesGetResponseGroupsMap = { [key: string]: unknown | undefined; }; export const WafOverridesGetResponseGroupsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type WafOverridesGetResponseRewriteActionBlock = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesGetResponseRewriteActionBlock = /*@__PURE__*/ S.String; export type WafOverridesGetResponseRewriteActionChallenge = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesGetResponseRewriteActionChallenge = /*@__PURE__*/ S.String; export type WafOverridesGetResponseRewriteActionDefault = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesGetResponseRewriteActionDefault = /*@__PURE__*/ S.String; export type WafOverridesGetResponseRewriteActionDisable = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesGetResponseRewriteActionDisable = /*@__PURE__*/ S.String; export type WafOverridesGetResponseRewriteActionSimulate = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesGetResponseRewriteActionSimulate = /*@__PURE__*/ S.String; export interface WafOverridesGetResponseRewriteAction { /** The WAF rule action to apply. */ block?: WafOverridesGetResponseRewriteActionBlock | null; /** The WAF rule action to apply. */ challenge?: WafOverridesGetResponseRewriteActionChallenge | null; /** The WAF rule action to apply. */ default?: WafOverridesGetResponseRewriteActionDefault | null; /** The WAF rule action to apply. */ disable?: WafOverridesGetResponseRewriteActionDisable | null; /** The WAF rule action to apply. */ simulate?: WafOverridesGetResponseRewriteActionSimulate | null; } export const WafOverridesGetResponseRewriteAction = /*@__PURE__*/ S.suspend( () => S.Struct({ block: S.optional(S.NullOr(WafOverridesGetResponseRewriteActionBlock)), challenge: S.optional( S.NullOr(WafOverridesGetResponseRewriteActionChallenge), ), default: S.optional( S.NullOr(WafOverridesGetResponseRewriteActionDefault), ), disable: S.optional( S.NullOr(WafOverridesGetResponseRewriteActionDisable), ), simulate: S.optional( S.NullOr(WafOverridesGetResponseRewriteActionSimulate), ), }), ).annotate({ identifier: "WafOverridesGetResponseRewriteAction", }) as any as S.Schema; export type WafOverridesGetResponseRules = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesGetResponseRules = /*@__PURE__*/ S.String; export type WafOverridesGetResponseUrlsList = Array; export const WafOverridesGetResponseUrlsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetWafOverrideResponse { /** The unique identifier of the WAF override. */ id?: string | null; /** An informative summary of the current URI-based WAF override. */ description?: string | null; /** An object that allows you to enable or disable WAF rule groups for the current WAF override. Each key of this object must be the ID of a WAF rule group, and each value must be a valid WAF action (usually `default` or `disable`). When creating a new URI-based WAF override, you must provide a `groups` object or a `rules` object. */ groups?: WafOverridesGetResponseGroupsMap | null; /** When true, indicates that the rule is currently paused. */ paused?: boolean | null; /** The relative priority of the current URI-based WAF override when multiple overrides match a single URL. A lower number indicates higher priority. Higher priority overrides may overwrite values set by lower priority overrides. */ priority?: number | null; /** Specifies that, when a WAF rule matches, its configured action will be replaced by the action configured in this object. */ rewriteAction?: WafOverridesGetResponseRewriteAction | null; /** An object that allows you to override the action of specific WAF rules. Each key of this object must be the ID of a WAF rule, and each value must be a valid WAF action. Unless you are disabling a rule, ensure that you also enable the rule group that this WAF rule belongs to. When creating a new URI-based WAF override, you must provide a `groups` object or a `rules` object. */ rules?: WafOverridesGetResponseRules | null; /** The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns. */ urls?: WafOverridesGetResponseUrlsList | null; } export const GetWafOverrideResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), description: S.optional(S.NullOr(S.String)), groups: S.optional(S.NullOr(WafOverridesGetResponseGroupsMap)), paused: S.optional(S.NullOr(S.Boolean)), priority: S.optional(S.NullOr(S.Number)), rewriteAction: S.optional( S.NullOr(WafOverridesGetResponseRewriteAction).pipe( T.Body("rewrite_action"), ), ), rules: S.optional(S.NullOr(WafOverridesGetResponseRules)), urls: S.optional(S.NullOr(WafOverridesGetResponseUrlsList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetWafOverrideResponse", }) as any as S.Schema; export interface GetWafPackageRequest { /** Defines an identifier. */ zoneId: string; /** Defines a package identifier. */ packageId: string; } export const GetWafPackageRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), packageId: S.String.pipe(T.Label("package_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/firewall/waf/packages/{package_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetWafPackageRequest", }) as any as S.Schema; /** Raw response payload (operation does not use the standard v4 result envelope). */ export interface GetWafPackageResponse {} export const GetWafPackageResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetWafPackageResponse", }) as any as S.Schema; export interface GetWafPackageGroupRequest { /** Defines an identifier of a schema. */ zoneId: string; /** Defines the unique identifier of a WAF package. */ packageId: string; /** Defines the unique identifier of a WAF package. */ groupId: string; } export const GetWafPackageGroupRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), packageId: S.String.pipe(T.Label("package_id")), groupId: S.String.pipe(T.Label("group_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/firewall/waf/packages/{package_id}/groups/{group_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetWafPackageGroupRequest", }) as any as S.Schema; export type GetWafPackageGroupResponse = unknown; export const GetWafPackageGroupResponse = /*@__PURE__*/ S.suspend(() => S.Unknown.pipe(T.EnvelopePayloadRoot(), T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetWafPackageGroupResponse", }) as any as S.Schema; export interface GetWafPackageRuleRequest { /** Defines an identifier of a schema. */ zoneId: string; /** Defines the unique identifier of a WAF package. */ packageId: string; /** Defines the unique identifier of a WAF package. */ ruleId: string; } export const GetWafPackageRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), packageId: S.String.pipe(T.Label("package_id")), ruleId: S.String.pipe(T.Label("rule_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/firewall/waf/packages/{package_id}/rules/{rule_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetWafPackageRuleRequest", }) as any as S.Schema; export type GetWafPackageRuleResponse = unknown; export const GetWafPackageRuleResponse = /*@__PURE__*/ S.suspend(() => S.Unknown.pipe(T.EnvelopePayloadRoot(), T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetWafPackageRuleResponse", }) as any as S.Schema; export type AccessRulesListRequestConfigurationTarget = | "ip" | "ip_range" | "asn" | "country"; export const AccessRulesListRequestConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesListRequestConfiguration { /** Defines the target to search in existing rules. */ target?: AccessRulesListRequestConfigurationTarget | (string & {}); /** Defines the target value to search for in existing rules: an IP address, an IP address range, or a country code, depending on the provided `configuration.target`. */ value?: string; } export const AccessRulesListRequestConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional(AccessRulesListRequestConfigurationTarget), value: S.optional(S.String), }), ).annotate({ identifier: "AccessRulesListRequestConfiguration", }) as any as S.Schema; export type AccessRulesListRequestDirection = "asc" | "desc"; export const AccessRulesListRequestDirection = /*@__PURE__*/ S.String; export type AccessRulesListRequestMatch = "any" | "all"; export const AccessRulesListRequestMatch = /*@__PURE__*/ S.String; export type AccessRulesListRequestMode = | "block" | "challenge" | "whitelist" | "js_challenge" | "managed_challenge"; export const AccessRulesListRequestMode = /*@__PURE__*/ S.String; export type AccessRulesListRequestOrder = | "configuration.target" | "configuration.value" | "mode"; export const AccessRulesListRequestOrder = /*@__PURE__*/ S.String; export interface ListAccessRulesForAccountRequest { /** The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. */ accountId: string; configuration?: AccessRulesListRequestConfiguration; /** Defines the direction used to sort returned rules. */ direction?: AccessRulesListRequestDirection | (string & {}); /** Defines the search requirements. When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match. */ match?: AccessRulesListRequestMatch | (string & {}); /** The action to apply to a matched request. */ mode?: AccessRulesListRequestMode | (string & {}); /** Defines the string to search for in the notes of existing IP Access rules. */ notes?: string; /** Defines the field used to sort returned rules. */ order?: AccessRulesListRequestOrder | (string & {}); /** Defines the requested page within paginated list of results. */ page?: number; /** Defines the maximum number of results requested. */ perPage?: number; } export const ListAccessRulesForAccountRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), configuration: S.optional( AccessRulesListRequestConfiguration.pipe(T.DeepQuery("configuration")), ), direction: S.optional(AccessRulesListRequestDirection.pipe(T.Query())), match: S.optional(AccessRulesListRequestMatch.pipe(T.Query())), mode: S.optional(AccessRulesListRequestMode.pipe(T.Query())), notes: S.optional(S.String.pipe(T.Query())), order: S.optional(AccessRulesListRequestOrder.pipe(T.Query())), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/firewall/access_rules/rules", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListAccessRulesForAccountRequest", }) as any as S.Schema; export type AccessRulesListResultItemAllowedModesItem = | "block" | "challenge" | "whitelist" | "js_challenge" | "managed_challenge"; export const AccessRulesListResultItemAllowedModesItem = /*@__PURE__*/ S.String; export type AccessRulesListResultItemAllowedModesList = Array; export const AccessRulesListResultItemAllowedModesList = /*@__PURE__*/ S.Array( AccessRulesListResultItemAllowedModesItem, ) as any as S.Schema; export type AccessRulesListResultItemConfigurationAccessRuleIPConfigurationTarget = "ip"; export const AccessRulesListResultItemConfigurationAccessRuleIPConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesListResultItemConfigurationAccessRuleIPConfiguration { /** The configuration target. You must set the target to `ip` when specifying an IP address in the rule. */ target?: AccessRulesListResultItemConfigurationAccessRuleIPConfigurationTarget | null; /** The IP address to match. This address will be compared to the IP address of incoming requests. */ value?: string | null; } export const AccessRulesListResultItemConfigurationAccessRuleIPConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr( AccessRulesListResultItemConfigurationAccessRuleIPConfigurationTarget, ), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "AccessRulesListResultItemConfigurationAccessRuleIPConfiguration", }) as any as S.Schema; export type AccessRulesListResultItemConfigurationIPV6ConfigurationTarget = "ip6"; export const AccessRulesListResultItemConfigurationIPV6ConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesListResultItemConfigurationIPV6Configuration { /** The configuration target. You must set the target to `ip6` when specifying an IPv6 address in the rule. */ target?: AccessRulesListResultItemConfigurationIPV6ConfigurationTarget | null; /** The IPv6 address to match. */ value?: string | null; } export const AccessRulesListResultItemConfigurationIPV6Configuration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr(AccessRulesListResultItemConfigurationIPV6ConfigurationTarget), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "AccessRulesListResultItemConfigurationIPV6Configuration", }) as any as S.Schema; export type AccessRulesListResultItemConfigurationAccessRuleCIDRConfigurationTarget = "ip_range"; export const AccessRulesListResultItemConfigurationAccessRuleCIDRConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesListResultItemConfigurationAccessRuleCIDRConfiguration { /** The configuration target. You must set the target to `ip_range` when specifying an IP address range in the rule. */ target?: AccessRulesListResultItemConfigurationAccessRuleCIDRConfigurationTarget | null; /** The IP address range to match. You can only use prefix lengths `/16` and `/24` for IPv4 ranges, and prefix lengths `/32`, `/48`, and `/64` for IPv6 ranges. */ value?: string | null; } export const AccessRulesListResultItemConfigurationAccessRuleCIDRConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr( AccessRulesListResultItemConfigurationAccessRuleCIDRConfigurationTarget, ), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "AccessRulesListResultItemConfigurationAccessRuleCIDRConfiguration", }) as any as S.Schema; export type AccessRulesListResultItemConfigurationASNConfigurationTarget = "asn"; export const AccessRulesListResultItemConfigurationASNConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesListResultItemConfigurationASNConfiguration { /** The configuration target. You must set the target to `asn` when specifying an Autonomous System Number (ASN) in the rule. */ target?: AccessRulesListResultItemConfigurationASNConfigurationTarget | null; /** The AS number to match. */ value?: string | null; } export const AccessRulesListResultItemConfigurationASNConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr(AccessRulesListResultItemConfigurationASNConfigurationTarget), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "AccessRulesListResultItemConfigurationASNConfiguration", }) as any as S.Schema; export type AccessRulesListResultItemConfigurationCountryConfigurationTarget = "country"; export const AccessRulesListResultItemConfigurationCountryConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesListResultItemConfigurationCountryConfiguration { /** The configuration target. You must set the target to `country` when specifying a country code in the rule. */ target?: AccessRulesListResultItemConfigurationCountryConfigurationTarget | null; /** The two-letter ISO-3166-1 alpha-2 code to match. For more information, refer to [IP Access rules: Parameters](https://developers.cloudflare.com/waf/tools/ip-access-rules/parameters/#country). */ value?: string | null; } export const AccessRulesListResultItemConfigurationCountryConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr( AccessRulesListResultItemConfigurationCountryConfigurationTarget, ), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "AccessRulesListResultItemConfigurationCountryConfiguration", }) as any as S.Schema; export type AccessRulesListResultItemConfiguration = | AccessRulesListResultItemConfigurationAccessRuleIPConfiguration | AccessRulesListResultItemConfigurationIPV6Configuration | AccessRulesListResultItemConfigurationAccessRuleCIDRConfiguration | AccessRulesListResultItemConfigurationASNConfiguration | AccessRulesListResultItemConfigurationCountryConfiguration; export const AccessRulesListResultItemConfiguration = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([ ["target", "value"], ["target", "value"], ["target", "value"], ["target", "value"], ["target", "value"], ]), ); export type AccessRulesListResultItemMode = | "block" | "challenge" | "whitelist" | "js_challenge" | "managed_challenge"; export const AccessRulesListResultItemMode = /*@__PURE__*/ S.String; export type AccessRulesListResultItemScopeType = "user" | "organization"; export const AccessRulesListResultItemScopeType = /*@__PURE__*/ S.String; export interface AccessRulesListResultItemScope { /** Defines an identifier. */ id?: string | null; /** The contact email address of the user. */ email?: string | null; /** Defines the scope of the rule. */ type?: AccessRulesListResultItemScopeType | null; } export const AccessRulesListResultItemScope = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), email: S.optional(S.NullOr(S.String)), type: S.optional(S.NullOr(AccessRulesListResultItemScopeType)), }), ).annotate({ identifier: "AccessRulesListResultItemScope", }) as any as S.Schema; export interface AccessRulesListResultItem { /** The unique identifier of the IP Access rule. */ id: string; /** The available actions that a rule can apply to a matched request. */ allowedModes: AccessRulesListResultItemAllowedModesList; /** The rule configuration. */ configuration: AccessRulesListResultItemConfiguration; /** The action to apply to a matched request. */ mode: AccessRulesListResultItemMode; /** The timestamp of when the rule was created. */ createdOn?: string | null; /** The timestamp of when the rule was last modified. */ modifiedOn?: string | null; /** An informative summary of the rule, typically used as a reminder or explanation. */ notes?: string | null; /** All zones owned by the user will have the rule applied. */ scope?: AccessRulesListResultItemScope | null; } export const AccessRulesListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, allowedModes: AccessRulesListResultItemAllowedModesList.pipe( T.Body("allowed_modes"), ), configuration: AccessRulesListResultItemConfiguration, mode: AccessRulesListResultItemMode, createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), notes: S.optional(S.NullOr(S.String)), scope: S.optional(S.NullOr(AccessRulesListResultItemScope)), }), ).annotate({ identifier: "AccessRulesListResultItem", }) as any as S.Schema; export type AccessRulesListResultList = Array; export const AccessRulesListResultList = /*@__PURE__*/ S.Array( AccessRulesListResultItem, ) as any as S.Schema; export interface ListAccessRulesResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: AccessRulesListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListAccessRulesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: AccessRulesListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListAccessRulesResponse", }) as any as S.Schema; export interface ListAccessRulesForZoneRequest { /** The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. */ zoneId: string; configuration?: AccessRulesListRequestConfiguration; /** Defines the direction used to sort returned rules. */ direction?: AccessRulesListRequestDirection | (string & {}); /** Defines the search requirements. When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match. */ match?: AccessRulesListRequestMatch | (string & {}); /** The action to apply to a matched request. */ mode?: AccessRulesListRequestMode | (string & {}); /** Defines the string to search for in the notes of existing IP Access rules. */ notes?: string; /** Defines the field used to sort returned rules. */ order?: AccessRulesListRequestOrder | (string & {}); /** Defines the requested page within paginated list of results. */ page?: number; /** Defines the maximum number of results requested. */ perPage?: number; } export const ListAccessRulesForZoneRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), configuration: S.optional( AccessRulesListRequestConfiguration.pipe(T.DeepQuery("configuration")), ), direction: S.optional(AccessRulesListRequestDirection.pipe(T.Query())), match: S.optional(AccessRulesListRequestMatch.pipe(T.Query())), mode: S.optional(AccessRulesListRequestMode.pipe(T.Query())), notes: S.optional(S.String.pipe(T.Query())), order: S.optional(AccessRulesListRequestOrder.pipe(T.Query())), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/firewall/access_rules/rules", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListAccessRulesForZoneRequest", }) as any as S.Schema; export interface ListLockdownsRequest { /** Defines an identifier. */ zoneId: string; /** The timestamp of when the rule was created. */ createdOn?: string; /** A string to search for in the description of existing rules. */ description?: string; /** A string to search for in the description of existing rules. */ descriptionSearch?: string; /** A single IP address to search for in existing rules. */ ip?: string; /** A single IP address range to search for in existing rules. */ ipRangeSearch?: string; /** A single IP address to search for in existing rules. */ ipSearch?: string; /** The timestamp of when the rule was last modified. */ modifiedOn?: string; /** Page number of paginated results. */ page?: number; /** The maximum number of results per page. You can only set the value to `1` or to a multiple of 5 such as `5`, `10`, `15`, or `20`. */ perPage?: number; /** The priority of the rule to control the processing order. A lower number indicates higher priority. If not provided, any rules with a configured priority will be processed before rules without a priority. */ priority?: number; /** A single URI to search for in the list of URLs of existing rules. */ uriSearch?: string; } export const ListLockdownsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), createdOn: S.optional(S.String.pipe(T.Query("created_on"))), description: S.optional(S.String.pipe(T.Query())), descriptionSearch: S.optional(S.String.pipe(T.Query("description_search"))), ip: S.optional(S.String.pipe(T.Query())), ipRangeSearch: S.optional(S.String.pipe(T.Query("ip_range_search"))), ipSearch: S.optional(S.String.pipe(T.Query("ip_search"))), modifiedOn: S.optional(S.String.pipe(T.Query("modified_on"))), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), priority: S.optional(S.Number.pipe(T.Query())), uriSearch: S.optional(S.String.pipe(T.Query("uri_search"))), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/firewall/lockdowns", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListLockdownsRequest", }) as any as S.Schema; export type LockdownsListResultItemUrlsList = Array; export const LockdownsListResultItemUrlsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface LockdownsListResultItem { /** The unique identifier of the Zone Lockdown rule. */ id: string; /** A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of `ip` or `ip_range` configurations. */ configurations: LockdownConfigurationsList; /** The timestamp of when the rule was created. */ createdOn: string; /** An informative summary of the rule. */ description: string; /** The timestamp of when the rule was last modified. */ modifiedOn: string; /** When true, indicates that the rule is currently paused. */ paused: boolean; /** The URLs to include in the rule definition. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns. */ urls: LockdownsListResultItemUrlsList; /** The priority of the Zone Lockdown rule, echoed on reads. */ priority?: number | null; } export const LockdownsListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, configurations: LockdownConfigurationsList, createdOn: S.String.pipe(T.Body("created_on")), description: S.String, modifiedOn: S.String.pipe(T.Body("modified_on")), paused: S.Boolean, urls: LockdownsListResultItemUrlsList, priority: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "LockdownsListResultItem", }) as any as S.Schema; export type LockdownsListResultList = Array; export const LockdownsListResultList = /*@__PURE__*/ S.Array( LockdownsListResultItem, ) as any as S.Schema; export interface ListLockdownsResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: LockdownsListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListLockdownsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: LockdownsListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListLockdownsResponse", }) as any as S.Schema; export interface ListRulesRequest { /** Defines an identifier. */ zoneId: string; /** The unique identifier of the firewall rule. */ id?: string; /** The action to search for. Must be an exact match. */ action?: string; /** A case-insensitive string to find in the description. */ description?: string; /** Page number of paginated results. */ page?: number; /** When true, indicates that the firewall rule is currently paused. */ paused?: boolean; /** Number of firewall rules per page. */ perPage?: number; } export const ListRulesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), id: S.optional(S.String.pipe(T.Query())), action: S.optional(S.String.pipe(T.Query())), description: S.optional(S.String.pipe(T.Query())), page: S.optional(S.Number.pipe(T.Query())), paused: S.optional(S.Boolean.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/firewall/rules", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListRulesRequest", }) as any as S.Schema; export type RulesListResultItemAction = | "block" | "challenge" | "js_challenge" | "managed_challenge" | "allow" | "log" | "bypass"; export const RulesListResultItemAction = /*@__PURE__*/ S.String; export type RulesListResultItemFilterFirewallFilter = RulesBulkDeleteResultItemFilterFirewallFilter; export const RulesListResultItemFilterFirewallFilter = RulesBulkDeleteResultItemFilterFirewallFilter; export type RulesListResultItemFilterDeletedFilter = RulesBulkDeleteResultItemFilterDeletedFilter; export const RulesListResultItemFilterDeletedFilter = RulesBulkDeleteResultItemFilterDeletedFilter; export type RulesListResultItemFilter = | RulesBulkDeleteResultItemFilterFirewallFilter | RulesBulkDeleteResultItemFilterDeletedFilter; export const RulesListResultItemFilter = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([ ["id", "description", "expression", "paused", "ref"], ["id", "deleted"], ]), ); export type RulesListResultItemProductsItem = | "zoneLockdown" | "uaBlock" | "bic" | "hot" | "securityLevel" | "rateLimit" | "waf"; export const RulesListResultItemProductsItem = /*@__PURE__*/ S.String; export type RulesListResultItemProductsList = Array; export const RulesListResultItemProductsList = /*@__PURE__*/ S.Array( RulesListResultItemProductsItem, ) as any as S.Schema; export interface RulesListResultItem { /** The unique identifier of the firewall rule. */ id?: string | null; /** The action to apply to a matched request. The `log` action is only available on an Enterprise plan. */ action?: RulesListResultItemAction | null; /** An informative summary of the firewall rule. */ description?: string | null; filter?: RulesListResultItemFilter | null; /** When true, indicates that the firewall rule is currently paused. */ paused?: boolean | null; /** The priority of the rule. Optional value used to define the processing order. A lower number indicates a higher priority. If not provided, rules with a defined priority will be processed before rules without a priority. */ priority?: number | null; products?: RulesListResultItemProductsList | null; /** A short reference tag. Allows you to select related firewall rules. */ ref?: string | null; } export const RulesListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), action: S.optional(S.NullOr(RulesListResultItemAction)), description: S.optional(S.NullOr(S.String)), filter: S.optional(S.NullOr(RulesListResultItemFilter)), paused: S.optional(S.NullOr(S.Boolean)), priority: S.optional(S.NullOr(S.Number)), products: S.optional(S.NullOr(RulesListResultItemProductsList)), ref: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "RulesListResultItem", }) as any as S.Schema; export type RulesListResultList = Array; export const RulesListResultList = /*@__PURE__*/ S.Array( RulesListResultItem, ) as any as S.Schema; export interface ListRulesResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: RulesListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListRulesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: RulesListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListRulesResponse", }) as any as S.Schema; export interface ListUaRulesRequest { /** Defines an identifier. */ zoneId: string; /** A string to search for in the description of existing rules. */ description?: string; /** Page number of paginated results. */ page?: number; /** When true, indicates that the rule is currently paused. */ paused?: boolean; /** The maximum number of results per page. You can only set the value to `1` or to a multiple of 5 such as `5`, `10`, `15`, or `20`. */ perPage?: number; /** A string to search for in the user agent values of existing rules. */ userAgent?: string; } export const ListUaRulesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), description: S.optional(S.String.pipe(T.Query())), page: S.optional(S.Number.pipe(T.Query())), paused: S.optional(S.Boolean.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), userAgent: S.optional(S.String.pipe(T.Query("user_agent"))), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/firewall/ua_rules", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListUaRulesRequest", }) as any as S.Schema; export type UaRulesListResultItemConfiguration = UaRulesCreateResponseConfiguration; export const UaRulesListResultItemConfiguration = UaRulesCreateResponseConfiguration; export type UaRulesListResultItemMode = | "block" | "challenge" | "js_challenge" | "managed_challenge"; export const UaRulesListResultItemMode = /*@__PURE__*/ S.String; export interface UaRulesListResultItem { /** The unique identifier of the User Agent Blocking rule. */ id?: string | null; /** The configuration object for the current rule. */ configuration?: UaRulesCreateResponseConfiguration | null; /** An informative summary of the rule. */ description?: string | null; /** The action to apply to a matched request. */ mode?: UaRulesListResultItemMode | null; /** When true, indicates that the rule is currently paused. */ paused?: boolean | null; } export const UaRulesListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), configuration: S.optional(S.NullOr(UaRulesCreateResponseConfiguration)), description: S.optional(S.NullOr(S.String)), mode: S.optional(S.NullOr(UaRulesListResultItemMode)), paused: S.optional(S.NullOr(S.Boolean)), }), ).annotate({ identifier: "UaRulesListResultItem", }) as any as S.Schema; export type UaRulesListResultList = Array; export const UaRulesListResultList = /*@__PURE__*/ S.Array( UaRulesListResultItem, ) as any as S.Schema; export interface ListUaRulesResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: UaRulesListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListUaRulesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: UaRulesListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListUaRulesResponse", }) as any as S.Schema; export interface ListWafOverridesRequest { /** Defines an identifier. */ zoneId: string; /** The page number of paginated results. */ page?: number; /** The number of WAF overrides per page. */ perPage?: number; } export const ListWafOverridesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/firewall/waf/overrides", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListWafOverridesRequest", }) as any as S.Schema; export type WafOverridesListResultItemGroupsMap = { [key: string]: unknown | undefined; }; export const WafOverridesListResultItemGroupsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type WafOverridesListResultItemRewriteActionBlock = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesListResultItemRewriteActionBlock = /*@__PURE__*/ S.String; export type WafOverridesListResultItemRewriteActionChallenge = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesListResultItemRewriteActionChallenge = /*@__PURE__*/ S.String; export type WafOverridesListResultItemRewriteActionDefault = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesListResultItemRewriteActionDefault = /*@__PURE__*/ S.String; export type WafOverridesListResultItemRewriteActionDisable = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesListResultItemRewriteActionDisable = /*@__PURE__*/ S.String; export type WafOverridesListResultItemRewriteActionSimulate = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesListResultItemRewriteActionSimulate = /*@__PURE__*/ S.String; export interface WafOverridesListResultItemRewriteAction { /** The WAF rule action to apply. */ block?: WafOverridesListResultItemRewriteActionBlock | null; /** The WAF rule action to apply. */ challenge?: WafOverridesListResultItemRewriteActionChallenge | null; /** The WAF rule action to apply. */ default?: WafOverridesListResultItemRewriteActionDefault | null; /** The WAF rule action to apply. */ disable?: WafOverridesListResultItemRewriteActionDisable | null; /** The WAF rule action to apply. */ simulate?: WafOverridesListResultItemRewriteActionSimulate | null; } export const WafOverridesListResultItemRewriteAction = /*@__PURE__*/ S.suspend( () => S.Struct({ block: S.optional(S.NullOr(WafOverridesListResultItemRewriteActionBlock)), challenge: S.optional( S.NullOr(WafOverridesListResultItemRewriteActionChallenge), ), default: S.optional( S.NullOr(WafOverridesListResultItemRewriteActionDefault), ), disable: S.optional( S.NullOr(WafOverridesListResultItemRewriteActionDisable), ), simulate: S.optional( S.NullOr(WafOverridesListResultItemRewriteActionSimulate), ), }), ).annotate({ identifier: "WafOverridesListResultItemRewriteAction", }) as any as S.Schema; export type WafOverridesListResultItemRules = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesListResultItemRules = /*@__PURE__*/ S.String; export type WafOverridesListResultItemUrlsList = Array; export const WafOverridesListResultItemUrlsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface WafOverridesListResultItem { /** The unique identifier of the WAF override. */ id?: string | null; /** An informative summary of the current URI-based WAF override. */ description?: string | null; /** An object that allows you to enable or disable WAF rule groups for the current WAF override. Each key of this object must be the ID of a WAF rule group, and each value must be a valid WAF action (usually `default` or `disable`). When creating a new URI-based WAF override, you must provide a `groups` object or a `rules` object. */ groups?: WafOverridesListResultItemGroupsMap | null; /** When true, indicates that the rule is currently paused. */ paused?: boolean | null; /** The relative priority of the current URI-based WAF override when multiple overrides match a single URL. A lower number indicates higher priority. Higher priority overrides may overwrite values set by lower priority overrides. */ priority?: number | null; /** Specifies that, when a WAF rule matches, its configured action will be replaced by the action configured in this object. */ rewriteAction?: WafOverridesListResultItemRewriteAction | null; /** An object that allows you to override the action of specific WAF rules. Each key of this object must be the ID of a WAF rule, and each value must be a valid WAF action. Unless you are disabling a rule, ensure that you also enable the rule group that this WAF rule belongs to. When creating a new URI-based WAF override, you must provide a `groups` object or a `rules` object. */ rules?: WafOverridesListResultItemRules | null; /** The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns. */ urls?: WafOverridesListResultItemUrlsList | null; } export const WafOverridesListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), description: S.optional(S.NullOr(S.String)), groups: S.optional(S.NullOr(WafOverridesListResultItemGroupsMap)), paused: S.optional(S.NullOr(S.Boolean)), priority: S.optional(S.NullOr(S.Number)), rewriteAction: S.optional( S.NullOr(WafOverridesListResultItemRewriteAction).pipe( T.Body("rewrite_action"), ), ), rules: S.optional(S.NullOr(WafOverridesListResultItemRules)), urls: S.optional(S.NullOr(WafOverridesListResultItemUrlsList)), }), ).annotate({ identifier: "WafOverridesListResultItem", }) as any as S.Schema; export type WafOverridesListResultList = Array; export const WafOverridesListResultList = /*@__PURE__*/ S.Array( WafOverridesListResultItem, ) as any as S.Schema; export interface ListWafOverridesResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: WafOverridesListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListWafOverridesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: WafOverridesListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListWafOverridesResponse", }) as any as S.Schema; export type WafPackagesGroupsListRequestDirection = "asc" | "desc"; export const WafPackagesGroupsListRequestDirection = /*@__PURE__*/ S.String; export type WafPackagesGroupsListRequestMatch = "any" | "all"; export const WafPackagesGroupsListRequestMatch = /*@__PURE__*/ S.String; export type WafPackagesGroupsListRequestMode = "on" | "off"; export const WafPackagesGroupsListRequestMode = /*@__PURE__*/ S.String; export type WafPackagesGroupsListRequestOrder = "mode" | "rules_count"; export const WafPackagesGroupsListRequestOrder = /*@__PURE__*/ S.String; export interface ListWafPackageGroupsRequest { /** Defines an identifier of a schema. */ zoneId: string; /** Defines the unique identifier of a WAF package. */ packageId: string; /** Defines the direction used to sort returned rule groups. */ direction?: WafPackagesGroupsListRequestDirection | (string & {}); /** Defines the condition for search requirements. When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match. */ match?: WafPackagesGroupsListRequestMatch | (string & {}); /** Defines the state of the rules contained in the rule group. When `on`, the rules in the group are configurable/usable. */ mode?: WafPackagesGroupsListRequestMode | (string & {}); /** Defines the name of the rule group. */ name?: string; /** Defines the field used to sort returned rule groups. */ order?: WafPackagesGroupsListRequestOrder | (string & {}); /** Defines the page number of paginated results. */ page?: number; /** Defines the number of rule groups per page. */ perPage?: number; /** Defines the number of rules in the current rule group. */ rulesCount?: number; } export const ListWafPackageGroupsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), packageId: S.String.pipe(T.Label("package_id")), direction: S.optional( WafPackagesGroupsListRequestDirection.pipe(T.Query()), ), match: S.optional(WafPackagesGroupsListRequestMatch.pipe(T.Query())), mode: S.optional(WafPackagesGroupsListRequestMode.pipe(T.Query())), name: S.optional(S.String.pipe(T.Query())), order: S.optional(WafPackagesGroupsListRequestOrder.pipe(T.Query())), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), rulesCount: S.optional(S.Number.pipe(T.Query("rules_count"))), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/firewall/waf/packages/{package_id}/groups", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListWafPackageGroupsRequest", }) as any as S.Schema; export type WafPackagesGroupsListResultItemMode = "on" | "off"; export const WafPackagesGroupsListResultItemMode = /*@__PURE__*/ S.String; export type WafPackagesGroupsListResultItemAllowedModesItem = "on" | "off"; export const WafPackagesGroupsListResultItemAllowedModesItem = /*@__PURE__*/ S.String; export type WafPackagesGroupsListResultItemAllowedModesList = Array; export const WafPackagesGroupsListResultItemAllowedModesList = /*@__PURE__*/ S.Array( WafPackagesGroupsListResultItemAllowedModesItem, ) as any as S.Schema; export interface WafPackagesGroupsListResultItem { /** Defines the unique identifier of the rule group. */ id: string; /** Defines an informative summary of what the rule group does. */ description: string; /** Defines the state of the rules contained in the rule group. When `on`, the rules in the group are configurable/usable. */ mode: WafPackagesGroupsListResultItemMode; /** Defines the name of the rule group. */ name: string; /** Defines the number of rules in the current rule group. */ rulesCount: number; /** Defines the available states for the rule group. */ allowedModes?: WafPackagesGroupsListResultItemAllowedModesList | null; /** Defines the number of rules within the group that have been modified from their default configuration. */ modifiedRulesCount?: number | null; /** Defines the unique identifier of a WAF package. */ packageId?: string | null; } export const WafPackagesGroupsListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, description: S.String, mode: WafPackagesGroupsListResultItemMode, name: S.String, rulesCount: S.Number.pipe(T.Body("rules_count")), allowedModes: S.optional( S.NullOr(WafPackagesGroupsListResultItemAllowedModesList).pipe( T.Body("allowed_modes"), ), ), modifiedRulesCount: S.optional( S.NullOr(S.Number).pipe(T.Body("modified_rules_count")), ), packageId: S.optional(S.NullOr(S.String).pipe(T.Body("package_id"))), }), ).annotate({ identifier: "WafPackagesGroupsListResultItem", }) as any as S.Schema; export type WafPackagesGroupsListResultList = Array; export const WafPackagesGroupsListResultList = /*@__PURE__*/ S.Array( WafPackagesGroupsListResultItem, ) as any as S.Schema; export interface ListWafPackageGroupsResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: WafPackagesGroupsListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListWafPackageGroupsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: WafPackagesGroupsListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListWafPackageGroupsResponse", }) as any as S.Schema; export type WafPackagesRulesListRequestDirection = "asc" | "desc"; export const WafPackagesRulesListRequestDirection = /*@__PURE__*/ S.String; export type WafPackagesRulesListRequestMatch = "any" | "all"; export const WafPackagesRulesListRequestMatch = /*@__PURE__*/ S.String; export type WafPackagesRulesListRequestMode = "DIS" | "CHL" | "BLK" | "SIM"; export const WafPackagesRulesListRequestMode = /*@__PURE__*/ S.String; export type WafPackagesRulesListRequestOrder = | "priority" | "group_id" | "description"; export const WafPackagesRulesListRequestOrder = /*@__PURE__*/ S.String; export interface ListWafPackageRulesRequest { /** Defines an identifier of a schema. */ zoneId: string; /** Defines the unique identifier of a WAF package. */ packageId: string; /** Defines the public description of the WAF rule. */ description?: string; /** Defines the direction used to sort returned rules. */ direction?: WafPackagesRulesListRequestDirection | (string & {}); /** Defines the unique identifier of the rule group. */ groupId?: string; /** Defines the search requirements. When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match. */ match?: WafPackagesRulesListRequestMatch | (string & {}); /** Defines the action/mode a rule has been overridden to perform. */ mode?: WafPackagesRulesListRequestMode | (string & {}); /** Defines the field used to sort returned rules. */ order?: WafPackagesRulesListRequestOrder | (string & {}); /** Defines the page number of paginated results. */ page?: number; /** Defines the number of rules per page. */ perPage?: number; /** Defines the order in which the individual WAF rule is executed within its rule group. */ priority?: string; } export const ListWafPackageRulesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), packageId: S.String.pipe(T.Label("package_id")), description: S.optional(S.String.pipe(T.Query())), direction: S.optional(WafPackagesRulesListRequestDirection.pipe(T.Query())), groupId: S.optional(S.String.pipe(T.Query("group_id"))), match: S.optional(WafPackagesRulesListRequestMatch.pipe(T.Query())), mode: S.optional(WafPackagesRulesListRequestMode.pipe(T.Query())), order: S.optional(WafPackagesRulesListRequestOrder.pipe(T.Query())), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), priority: S.optional(S.String.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/firewall/waf/packages/{package_id}/rules", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListWafPackageRulesRequest", }) as any as S.Schema; export type WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleAllowedModesItem = | "on" | "off"; export const WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleAllowedModesItem = /*@__PURE__*/ S.String; export type WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleAllowedModesList = Array; export const WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleAllowedModesList = /*@__PURE__*/ S.Array( WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleAllowedModesItem, ) as any as S.Schema; export interface WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleGroup { /** Defines the unique identifier of the rule group. */ id?: string | null; /** Defines the name of the rule group. */ name?: string | null; } export const WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleGroup = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), name: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleGroup", }) as any as S.Schema; export type WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleMode = | "on" | "off"; export const WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleMode = /*@__PURE__*/ S.String; export interface WafPackagesRulesListResultItemWAFManagedRulesAnomalyRule { /** Defines the unique identifier of the WAF rule. */ id: string; /** Defines the available modes for the current WAF rule. Applies to anomaly detection WAF rules. */ allowedModes: WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleAllowedModesList; /** Defines the public description of the WAF rule. */ description: string; /** Defines the rule group to which the current WAF rule belongs. */ group: WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleGroup; /** Defines the mode anomaly. When set to `on`, the current WAF rule will be used when evaluating the request. Applies to anomaly detection WAF rules. */ mode: WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleMode; /** Defines the unique identifier of a WAF package. */ packageId: string; /** Defines the order in which the individual WAF rule is executed within its rule group. */ priority: string; } export const WafPackagesRulesListResultItemWAFManagedRulesAnomalyRule = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, allowedModes: WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleAllowedModesList.pipe( T.Body("allowed_modes"), ), description: S.String, group: WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleGroup, mode: WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleMode, packageId: S.String.pipe(T.Body("package_id")), priority: S.String, }), ).annotate({ identifier: "WafPackagesRulesListResultItemWAFManagedRulesAnomalyRule", }) as any as S.Schema; export type WafPackagesRulesListResultItemWAFManagedRulesTraditionalDenyRuleAllowedModesItem = | "default" | "disable" | "simulate" | "block" | "challenge"; export const WafPackagesRulesListResultItemWAFManagedRulesTraditionalDenyRuleAllowedModesItem = /*@__PURE__*/ S.String; export type WafPackagesRulesListResultItemWAFManagedRulesTraditionalDenyRuleAllowedModesList = Array; export const WafPackagesRulesListResultItemWAFManagedRulesTraditionalDenyRuleAllowedModesList = /*@__PURE__*/ S.Array( WafPackagesRulesListResultItemWAFManagedRulesTraditionalDenyRuleAllowedModesItem, ) as any as S.Schema; export type WafPackagesRulesListResultItemWAFManagedRulesTraditionalDenyRuleDefaultMode = | "disable" | "simulate" | "block" | "challenge"; export const WafPackagesRulesListResultItemWAFManagedRulesTraditionalDenyRuleDefaultMode = /*@__PURE__*/ S.String; export type WafPackagesRulesListResultItemWAFManagedRulesTraditionalDenyRuleMode = | "default" | "disable" | "simulate" | "block" | "challenge"; export const WafPackagesRulesListResultItemWAFManagedRulesTraditionalDenyRuleMode = /*@__PURE__*/ S.String; export interface WafPackagesRulesListResultItemWAFManagedRulesTraditionalDenyRule { /** Defines the unique identifier of the WAF rule. */ id: string; /** Defines the list of possible actions of the WAF rule when it is triggered. */ allowedModes: WafPackagesRulesListResultItemWAFManagedRulesTraditionalDenyRuleAllowedModesList; /** Defines the default action/mode of a rule. */ defaultMode: WafPackagesRulesListResultItemWAFManagedRulesTraditionalDenyRuleDefaultMode; /** Defines the public description of the WAF rule. */ description: string; /** Defines the rule group to which the current WAF rule belongs. */ group: WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleGroup; /** Defines the action that the current WAF rule will perform when triggered. Applies to traditional (deny) WAF rules. */ mode: WafPackagesRulesListResultItemWAFManagedRulesTraditionalDenyRuleMode; /** Defines the unique identifier of a WAF package. */ packageId: string; /** Defines the order in which the individual WAF rule is executed within its rule group. */ priority: string; } export const WafPackagesRulesListResultItemWAFManagedRulesTraditionalDenyRule = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, allowedModes: WafPackagesRulesListResultItemWAFManagedRulesTraditionalDenyRuleAllowedModesList.pipe( T.Body("allowed_modes"), ), defaultMode: WafPackagesRulesListResultItemWAFManagedRulesTraditionalDenyRuleDefaultMode.pipe( T.Body("default_mode"), ), description: S.String, group: WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleGroup, mode: WafPackagesRulesListResultItemWAFManagedRulesTraditionalDenyRuleMode, packageId: S.String.pipe(T.Body("package_id")), priority: S.String, }), ).annotate({ identifier: "WafPackagesRulesListResultItemWAFManagedRulesTraditionalDenyRule", }) as any as S.Schema; export type WafPackagesRulesListResultItemWAFManagedRulesTraditionalAllowRuleAllowedModesItem = | "on" | "off"; export const WafPackagesRulesListResultItemWAFManagedRulesTraditionalAllowRuleAllowedModesItem = /*@__PURE__*/ S.String; export type WafPackagesRulesListResultItemWAFManagedRulesTraditionalAllowRuleAllowedModesList = Array; export const WafPackagesRulesListResultItemWAFManagedRulesTraditionalAllowRuleAllowedModesList = /*@__PURE__*/ S.Array( WafPackagesRulesListResultItemWAFManagedRulesTraditionalAllowRuleAllowedModesItem, ) as any as S.Schema; export type WafPackagesRulesListResultItemWAFManagedRulesTraditionalAllowRuleMode = | "on" | "off"; export const WafPackagesRulesListResultItemWAFManagedRulesTraditionalAllowRuleMode = /*@__PURE__*/ S.String; export interface WafPackagesRulesListResultItemWAFManagedRulesTraditionalAllowRule { /** Defines the unique identifier of the WAF rule. */ id: string; /** Defines the available modes for the current WAF rule. */ allowedModes: WafPackagesRulesListResultItemWAFManagedRulesTraditionalAllowRuleAllowedModesList; /** Defines the public description of the WAF rule. */ description: string; /** Defines the rule group to which the current WAF rule belongs. */ group: WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleGroup; /** When set to `on`, the current rule will be used when evaluating the request. Applies to traditional (allow) WAF rules. */ mode: WafPackagesRulesListResultItemWAFManagedRulesTraditionalAllowRuleMode; /** Defines the unique identifier of a WAF package. */ packageId: string; /** Defines the order in which the individual WAF rule is executed within its rule group. */ priority: string; } export const WafPackagesRulesListResultItemWAFManagedRulesTraditionalAllowRule = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, allowedModes: WafPackagesRulesListResultItemWAFManagedRulesTraditionalAllowRuleAllowedModesList.pipe( T.Body("allowed_modes"), ), description: S.String, group: WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleGroup, mode: WafPackagesRulesListResultItemWAFManagedRulesTraditionalAllowRuleMode, packageId: S.String.pipe(T.Body("package_id")), priority: S.String, }), ).annotate({ identifier: "WafPackagesRulesListResultItemWAFManagedRulesTraditionalAllowRule", }) as any as S.Schema; export type WafPackagesRulesListResultItem = | WafPackagesRulesListResultItemWAFManagedRulesAnomalyRule | WafPackagesRulesListResultItemWAFManagedRulesTraditionalDenyRule | WafPackagesRulesListResultItemWAFManagedRulesTraditionalAllowRule; export const WafPackagesRulesListResultItem = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([ [ "id", "allowedModes", "description", "group", "mode", "packageId", "priority", ], [ "id", "allowedModes", "defaultMode", "description", "group", "mode", "packageId", "priority", ], [ "id", "allowedModes", "description", "group", "mode", "packageId", "priority", ], ]), ); export type WafPackagesRulesListResultList = Array; export const WafPackagesRulesListResultList = /*@__PURE__*/ S.Array( WafPackagesRulesListResultItem, ) as any as S.Schema; export interface ListWafPackageRulesResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: WafPackagesRulesListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListWafPackageRulesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: WafPackagesRulesListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListWafPackageRulesResponse", }) as any as S.Schema; export type WafPackagesListRequestDirection = "asc" | "desc"; export const WafPackagesListRequestDirection = /*@__PURE__*/ S.String; export type WafPackagesListRequestMatch = "any" | "all"; export const WafPackagesListRequestMatch = /*@__PURE__*/ S.String; export type WafPackagesListRequestOrder = "name"; export const WafPackagesListRequestOrder = /*@__PURE__*/ S.String; export interface ListWafPackagesRequest { /** Defines an identifier. */ zoneId: string; /** The direction used to sort returned packages. */ direction?: WafPackagesListRequestDirection | (string & {}); /** When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match. */ match?: WafPackagesListRequestMatch | (string & {}); /** The name of the WAF package. */ name?: string; /** The field used to sort returned packages. */ order?: WafPackagesListRequestOrder | (string & {}); /** The page number of paginated results. */ page?: number; /** The number of packages per page. */ perPage?: number; } export const ListWafPackagesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), direction: S.optional(WafPackagesListRequestDirection.pipe(T.Query())), match: S.optional(WafPackagesListRequestMatch.pipe(T.Query())), name: S.optional(S.String.pipe(T.Query())), order: S.optional(WafPackagesListRequestOrder.pipe(T.Query())), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/firewall/waf/packages", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListWafPackagesRequest", }) as any as S.Schema; /** Raw response payload (operation does not use the standard v4 result envelope). */ export interface ListWafPackagesResponse {} export const ListWafPackagesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListWafPackagesResponse", }) as any as S.Schema; export type AccessRulesEditRequestConfigurationAccessRuleIPConfigurationTarget = "ip"; export const AccessRulesEditRequestConfigurationAccessRuleIPConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesEditRequestConfigurationAccessRuleIPConfiguration { /** The configuration target. You must set the target to `ip` when specifying an IP address in the rule. */ target?: | AccessRulesEditRequestConfigurationAccessRuleIPConfigurationTarget | (string & {}); /** The IP address to match. This address will be compared to the IP address of incoming requests. */ value?: string; } export const AccessRulesEditRequestConfigurationAccessRuleIPConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( AccessRulesEditRequestConfigurationAccessRuleIPConfigurationTarget, ), value: S.optional(S.String), }), ).annotate({ identifier: "AccessRulesEditRequestConfigurationAccessRuleIPConfiguration", }) as any as S.Schema; export type AccessRulesEditRequestConfigurationIPV6ConfigurationTarget = "ip6"; export const AccessRulesEditRequestConfigurationIPV6ConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesEditRequestConfigurationIPV6Configuration { /** The configuration target. You must set the target to `ip6` when specifying an IPv6 address in the rule. */ target?: | AccessRulesEditRequestConfigurationIPV6ConfigurationTarget | (string & {}); /** The IPv6 address to match. */ value?: string; } export const AccessRulesEditRequestConfigurationIPV6Configuration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( AccessRulesEditRequestConfigurationIPV6ConfigurationTarget, ), value: S.optional(S.String), }), ).annotate({ identifier: "AccessRulesEditRequestConfigurationIPV6Configuration", }) as any as S.Schema; export type AccessRulesEditRequestConfigurationAccessRuleCIDRConfigurationTarget = "ip_range"; export const AccessRulesEditRequestConfigurationAccessRuleCIDRConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesEditRequestConfigurationAccessRuleCIDRConfiguration { /** The configuration target. You must set the target to `ip_range` when specifying an IP address range in the rule. */ target?: | AccessRulesEditRequestConfigurationAccessRuleCIDRConfigurationTarget | (string & {}); /** The IP address range to match. You can only use prefix lengths `/16` and `/24` for IPv4 ranges, and prefix lengths `/32`, `/48`, and `/64` for IPv6 ranges. */ value?: string; } export const AccessRulesEditRequestConfigurationAccessRuleCIDRConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( AccessRulesEditRequestConfigurationAccessRuleCIDRConfigurationTarget, ), value: S.optional(S.String), }), ).annotate({ identifier: "AccessRulesEditRequestConfigurationAccessRuleCIDRConfiguration", }) as any as S.Schema; export type AccessRulesEditRequestConfigurationASNConfigurationTarget = "asn"; export const AccessRulesEditRequestConfigurationASNConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesEditRequestConfigurationASNConfiguration { /** The configuration target. You must set the target to `asn` when specifying an Autonomous System Number (ASN) in the rule. */ target?: | AccessRulesEditRequestConfigurationASNConfigurationTarget | (string & {}); /** The AS number to match. */ value?: string; } export const AccessRulesEditRequestConfigurationASNConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( AccessRulesEditRequestConfigurationASNConfigurationTarget, ), value: S.optional(S.String), }), ).annotate({ identifier: "AccessRulesEditRequestConfigurationASNConfiguration", }) as any as S.Schema; export type AccessRulesEditRequestConfigurationCountryConfigurationTarget = "country"; export const AccessRulesEditRequestConfigurationCountryConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesEditRequestConfigurationCountryConfiguration { /** The configuration target. You must set the target to `country` when specifying a country code in the rule. */ target?: | AccessRulesEditRequestConfigurationCountryConfigurationTarget | (string & {}); /** The two-letter ISO-3166-1 alpha-2 code to match. For more information, refer to [IP Access rules: Parameters](https://developers.cloudflare.com/waf/tools/ip-access-rules/parameters/#country). */ value?: string; } export const AccessRulesEditRequestConfigurationCountryConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( AccessRulesEditRequestConfigurationCountryConfigurationTarget, ), value: S.optional(S.String), }), ).annotate({ identifier: "AccessRulesEditRequestConfigurationCountryConfiguration", }) as any as S.Schema; export type AccessRulesEditRequestConfiguration = | AccessRulesEditRequestConfigurationAccessRuleIPConfiguration | AccessRulesEditRequestConfigurationIPV6Configuration | AccessRulesEditRequestConfigurationAccessRuleCIDRConfiguration | AccessRulesEditRequestConfigurationASNConfiguration | AccessRulesEditRequestConfigurationCountryConfiguration; export const AccessRulesEditRequestConfiguration = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([ ["target", "value"], ["target", "value"], ["target", "value"], ["target", "value"], ["target", "value"], ]), ); export type AccessRulesEditRequestMode = | "block" | "challenge" | "whitelist" | "js_challenge" | "managed_challenge"; export const AccessRulesEditRequestMode = /*@__PURE__*/ S.String; export interface PatchAccessRuleForAccountRequest { /** The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. */ accountId: string; /** Unique identifier for a rule. */ ruleId: string; /** The rule configuration. */ configuration: AccessRulesEditRequestConfiguration; /** The action to apply to a matched request. */ mode: AccessRulesEditRequestMode | (string & {}); /** An informative summary of the rule, typically used as a reminder or explanation. */ notes?: string; } export const PatchAccessRuleForAccountRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), ruleId: S.String.pipe(T.Label("rule_id")), configuration: AccessRulesEditRequestConfiguration, mode: AccessRulesEditRequestMode, notes: S.optional(S.String), }) .pipe( T.Http({ method: "PATCH", uri: "/accounts/{account_id}/firewall/access_rules/rules/{rule_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchAccessRuleForAccountRequest", }) as any as S.Schema; export type AccessRulesEditResponseAllowedModesItem = | "block" | "challenge" | "whitelist" | "js_challenge" | "managed_challenge"; export const AccessRulesEditResponseAllowedModesItem = /*@__PURE__*/ S.String; export type AccessRulesEditResponseAllowedModesList = Array; export const AccessRulesEditResponseAllowedModesList = /*@__PURE__*/ S.Array( AccessRulesEditResponseAllowedModesItem, ) as any as S.Schema; export type AccessRulesEditResponseConfigurationAccessRuleIPConfigurationTarget = "ip"; export const AccessRulesEditResponseConfigurationAccessRuleIPConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesEditResponseConfigurationAccessRuleIPConfiguration { /** The configuration target. You must set the target to `ip` when specifying an IP address in the rule. */ target?: AccessRulesEditResponseConfigurationAccessRuleIPConfigurationTarget | null; /** The IP address to match. This address will be compared to the IP address of incoming requests. */ value?: string | null; } export const AccessRulesEditResponseConfigurationAccessRuleIPConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr( AccessRulesEditResponseConfigurationAccessRuleIPConfigurationTarget, ), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "AccessRulesEditResponseConfigurationAccessRuleIPConfiguration", }) as any as S.Schema; export type AccessRulesEditResponseConfigurationIPV6ConfigurationTarget = "ip6"; export const AccessRulesEditResponseConfigurationIPV6ConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesEditResponseConfigurationIPV6Configuration { /** The configuration target. You must set the target to `ip6` when specifying an IPv6 address in the rule. */ target?: AccessRulesEditResponseConfigurationIPV6ConfigurationTarget | null; /** The IPv6 address to match. */ value?: string | null; } export const AccessRulesEditResponseConfigurationIPV6Configuration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr(AccessRulesEditResponseConfigurationIPV6ConfigurationTarget), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "AccessRulesEditResponseConfigurationIPV6Configuration", }) as any as S.Schema; export type AccessRulesEditResponseConfigurationAccessRuleCIDRConfigurationTarget = "ip_range"; export const AccessRulesEditResponseConfigurationAccessRuleCIDRConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesEditResponseConfigurationAccessRuleCIDRConfiguration { /** The configuration target. You must set the target to `ip_range` when specifying an IP address range in the rule. */ target?: AccessRulesEditResponseConfigurationAccessRuleCIDRConfigurationTarget | null; /** The IP address range to match. You can only use prefix lengths `/16` and `/24` for IPv4 ranges, and prefix lengths `/32`, `/48`, and `/64` for IPv6 ranges. */ value?: string | null; } export const AccessRulesEditResponseConfigurationAccessRuleCIDRConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr( AccessRulesEditResponseConfigurationAccessRuleCIDRConfigurationTarget, ), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "AccessRulesEditResponseConfigurationAccessRuleCIDRConfiguration", }) as any as S.Schema; export type AccessRulesEditResponseConfigurationASNConfigurationTarget = "asn"; export const AccessRulesEditResponseConfigurationASNConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesEditResponseConfigurationASNConfiguration { /** The configuration target. You must set the target to `asn` when specifying an Autonomous System Number (ASN) in the rule. */ target?: AccessRulesEditResponseConfigurationASNConfigurationTarget | null; /** The AS number to match. */ value?: string | null; } export const AccessRulesEditResponseConfigurationASNConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr(AccessRulesEditResponseConfigurationASNConfigurationTarget), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "AccessRulesEditResponseConfigurationASNConfiguration", }) as any as S.Schema; export type AccessRulesEditResponseConfigurationCountryConfigurationTarget = "country"; export const AccessRulesEditResponseConfigurationCountryConfigurationTarget = /*@__PURE__*/ S.String; export interface AccessRulesEditResponseConfigurationCountryConfiguration { /** The configuration target. You must set the target to `country` when specifying a country code in the rule. */ target?: AccessRulesEditResponseConfigurationCountryConfigurationTarget | null; /** The two-letter ISO-3166-1 alpha-2 code to match. For more information, refer to [IP Access rules: Parameters](https://developers.cloudflare.com/waf/tools/ip-access-rules/parameters/#country). */ value?: string | null; } export const AccessRulesEditResponseConfigurationCountryConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( S.NullOr( AccessRulesEditResponseConfigurationCountryConfigurationTarget, ), ), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "AccessRulesEditResponseConfigurationCountryConfiguration", }) as any as S.Schema; export type AccessRulesEditResponseConfiguration = | AccessRulesEditResponseConfigurationAccessRuleIPConfiguration | AccessRulesEditResponseConfigurationIPV6Configuration | AccessRulesEditResponseConfigurationAccessRuleCIDRConfiguration | AccessRulesEditResponseConfigurationASNConfiguration | AccessRulesEditResponseConfigurationCountryConfiguration; export const AccessRulesEditResponseConfiguration = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([ ["target", "value"], ["target", "value"], ["target", "value"], ["target", "value"], ["target", "value"], ]), ); export type AccessRulesEditResponseMode = | "block" | "challenge" | "whitelist" | "js_challenge" | "managed_challenge"; export const AccessRulesEditResponseMode = /*@__PURE__*/ S.String; export type AccessRulesEditResponseScopeType = "user" | "organization"; export const AccessRulesEditResponseScopeType = /*@__PURE__*/ S.String; export interface AccessRulesEditResponseScope { /** Defines an identifier. */ id?: string | null; /** The contact email address of the user. */ email?: string | null; /** Defines the scope of the rule. */ type?: AccessRulesEditResponseScopeType | null; } export const AccessRulesEditResponseScope = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), email: S.optional(S.NullOr(S.String)), type: S.optional(S.NullOr(AccessRulesEditResponseScopeType)), }), ).annotate({ identifier: "AccessRulesEditResponseScope", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PatchAccessRuleResponse { /** The unique identifier of the IP Access rule. */ id: string; /** The available actions that a rule can apply to a matched request. */ allowedModes: AccessRulesEditResponseAllowedModesList; /** The rule configuration. */ configuration: AccessRulesEditResponseConfiguration; /** The action to apply to a matched request. */ mode: AccessRulesEditResponseMode; /** The timestamp of when the rule was created. */ createdOn?: string | null; /** The timestamp of when the rule was last modified. */ modifiedOn?: string | null; /** An informative summary of the rule, typically used as a reminder or explanation. */ notes?: string | null; /** All zones owned by the user will have the rule applied. */ scope?: AccessRulesEditResponseScope | null; } export const PatchAccessRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, allowedModes: AccessRulesEditResponseAllowedModesList.pipe( T.Body("allowed_modes"), ), configuration: AccessRulesEditResponseConfiguration, mode: AccessRulesEditResponseMode, createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), notes: S.optional(S.NullOr(S.String)), scope: S.optional(S.NullOr(AccessRulesEditResponseScope)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchAccessRuleResponse", }) as any as S.Schema; export interface PatchAccessRuleForZoneRequest { /** The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. */ zoneId: string; /** Unique identifier for a rule. */ ruleId: string; /** The rule configuration. */ configuration: AccessRulesEditRequestConfiguration; /** The action to apply to a matched request. */ mode: AccessRulesEditRequestMode | (string & {}); /** An informative summary of the rule, typically used as a reminder or explanation. */ notes?: string; } export const PatchAccessRuleForZoneRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), ruleId: S.String.pipe(T.Label("rule_id")), configuration: AccessRulesEditRequestConfiguration, mode: AccessRulesEditRequestMode, notes: S.optional(S.String), }) .pipe( T.Http({ method: "PATCH", uri: "/zones/{zone_id}/firewall/access_rules/rules/{rule_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchAccessRuleForZoneRequest", }) as any as S.Schema; export interface PatchRuleRequest { /** Defines an identifier. */ zoneId: string; /** The unique identifier of the firewall rule. */ ruleId: string; } export const PatchRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), ruleId: S.String.pipe(T.Label("rule_id")), }) .pipe( T.Http({ method: "PATCH", uri: "/zones/{zone_id}/firewall/rules/{rule_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchRuleRequest", }) as any as S.Schema; export type RulesEditResultItemAction = | "block" | "challenge" | "js_challenge" | "managed_challenge" | "allow" | "log" | "bypass"; export const RulesEditResultItemAction = /*@__PURE__*/ S.String; export type RulesEditResultItemFilterFirewallFilter = RulesBulkDeleteResultItemFilterFirewallFilter; export const RulesEditResultItemFilterFirewallFilter = RulesBulkDeleteResultItemFilterFirewallFilter; export type RulesEditResultItemFilterDeletedFilter = RulesBulkDeleteResultItemFilterDeletedFilter; export const RulesEditResultItemFilterDeletedFilter = RulesBulkDeleteResultItemFilterDeletedFilter; export type RulesEditResultItemFilter = | RulesBulkDeleteResultItemFilterFirewallFilter | RulesBulkDeleteResultItemFilterDeletedFilter; export const RulesEditResultItemFilter = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([ ["id", "description", "expression", "paused", "ref"], ["id", "deleted"], ]), ); export type RulesEditResultItemProductsItem = | "zoneLockdown" | "uaBlock" | "bic" | "hot" | "securityLevel" | "rateLimit" | "waf"; export const RulesEditResultItemProductsItem = /*@__PURE__*/ S.String; export type RulesEditResultItemProductsList = Array; export const RulesEditResultItemProductsList = /*@__PURE__*/ S.Array( RulesEditResultItemProductsItem, ) as any as S.Schema; export interface RulesEditResultItem { /** The unique identifier of the firewall rule. */ id?: string | null; /** The action to apply to a matched request. The `log` action is only available on an Enterprise plan. */ action?: RulesEditResultItemAction | null; /** An informative summary of the firewall rule. */ description?: string | null; filter?: RulesEditResultItemFilter | null; /** When true, indicates that the firewall rule is currently paused. */ paused?: boolean | null; /** The priority of the rule. Optional value used to define the processing order. A lower number indicates a higher priority. If not provided, rules with a defined priority will be processed before rules without a priority. */ priority?: number | null; products?: RulesEditResultItemProductsList | null; /** A short reference tag. Allows you to select related firewall rules. */ ref?: string | null; } export const RulesEditResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), action: S.optional(S.NullOr(RulesEditResultItemAction)), description: S.optional(S.NullOr(S.String)), filter: S.optional(S.NullOr(RulesEditResultItemFilter)), paused: S.optional(S.NullOr(S.Boolean)), priority: S.optional(S.NullOr(S.Number)), products: S.optional(S.NullOr(RulesEditResultItemProductsList)), ref: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "RulesEditResultItem", }) as any as S.Schema; export type RulesEditResultList = Array; export const RulesEditResultList = /*@__PURE__*/ S.Array( RulesEditResultItem, ) as any as S.Schema; export interface PatchRuleResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: RulesEditResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const PatchRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: RulesEditResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchRuleResponse", }) as any as S.Schema; export type WafPackagesGroupsEditRequestMode = "on" | "off"; export const WafPackagesGroupsEditRequestMode = /*@__PURE__*/ S.String; export interface PatchWafPackageGroupRequest { /** Defines an identifier of a schema. */ zoneId: string; /** Defines the unique identifier of a WAF package. */ packageId: string; /** Defines the unique identifier of a WAF package. */ groupId: string; /** Defines the state of the rules contained in the rule group. When `on`, the rules in the group are configurable/usable. */ mode?: WafPackagesGroupsEditRequestMode | (string & {}); } export const PatchWafPackageGroupRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), packageId: S.String.pipe(T.Label("package_id")), groupId: S.String.pipe(T.Label("group_id")), mode: S.optional(WafPackagesGroupsEditRequestMode), }) .pipe( T.Http({ method: "PATCH", uri: "/zones/{zone_id}/firewall/waf/packages/{package_id}/groups/{group_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchWafPackageGroupRequest", }) as any as S.Schema; export type PatchWafPackageGroupResponse = unknown; export const PatchWafPackageGroupResponse = /*@__PURE__*/ S.suspend(() => S.Unknown.pipe(T.EnvelopePayloadRoot(), T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchWafPackageGroupResponse", }) as any as S.Schema; export type WafPackagesRulesEditRequestMode = | "default" | "disable" | "simulate" | "block" | "challenge" | "on" | "off"; export const WafPackagesRulesEditRequestMode = /*@__PURE__*/ S.String; export interface PatchWafPackageRuleRequest { /** Defines an identifier of a schema. */ zoneId: string; /** Defines the unique identifier of a WAF package. */ packageId: string; /** Defines the unique identifier of a WAF package. */ ruleId: string; /** Defines the mode/action of the rule when triggered. You must use a value from the `allowed_modes` array of the current rule. */ mode?: WafPackagesRulesEditRequestMode | (string & {}); } export const PatchWafPackageRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), packageId: S.String.pipe(T.Label("package_id")), ruleId: S.String.pipe(T.Label("rule_id")), mode: S.optional(WafPackagesRulesEditRequestMode), }) .pipe( T.Http({ method: "PATCH", uri: "/zones/{zone_id}/firewall/waf/packages/{package_id}/rules/{rule_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchWafPackageRuleRequest", }) as any as S.Schema; export type WafPackagesRulesEditResultWAFManagedRulesAnomalyRuleAllowedModesItem = | "on" | "off"; export const WafPackagesRulesEditResultWAFManagedRulesAnomalyRuleAllowedModesItem = /*@__PURE__*/ S.String; export type WafPackagesRulesEditResultWAFManagedRulesAnomalyRuleAllowedModesList = Array; export const WafPackagesRulesEditResultWAFManagedRulesAnomalyRuleAllowedModesList = /*@__PURE__*/ S.Array( WafPackagesRulesEditResultWAFManagedRulesAnomalyRuleAllowedModesItem, ) as any as S.Schema; export type WafPackagesRulesEditResultWAFManagedRulesAnomalyRuleGroup = WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleGroup; export const WafPackagesRulesEditResultWAFManagedRulesAnomalyRuleGroup = WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleGroup; export type WafPackagesRulesEditResultWAFManagedRulesAnomalyRuleMode = | "on" | "off"; export const WafPackagesRulesEditResultWAFManagedRulesAnomalyRuleMode = /*@__PURE__*/ S.String; export interface WafPackagesRulesEditResultWAFManagedRulesAnomalyRule { /** Defines the unique identifier of the WAF rule. */ id: string; /** Defines the available modes for the current WAF rule. Applies to anomaly detection WAF rules. */ allowedModes: WafPackagesRulesEditResultWAFManagedRulesAnomalyRuleAllowedModesList; /** Defines the public description of the WAF rule. */ description: string; /** Defines the rule group to which the current WAF rule belongs. */ group: WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleGroup; /** Defines the mode anomaly. When set to `on`, the current WAF rule will be used when evaluating the request. Applies to anomaly detection WAF rules. */ mode: WafPackagesRulesEditResultWAFManagedRulesAnomalyRuleMode; /** Defines the unique identifier of a WAF package. */ packageId: string; /** Defines the order in which the individual WAF rule is executed within its rule group. */ priority: string; } export const WafPackagesRulesEditResultWAFManagedRulesAnomalyRule = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, allowedModes: WafPackagesRulesEditResultWAFManagedRulesAnomalyRuleAllowedModesList.pipe( T.Body("allowed_modes"), ), description: S.String, group: WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleGroup, mode: WafPackagesRulesEditResultWAFManagedRulesAnomalyRuleMode, packageId: S.String.pipe(T.Body("package_id")), priority: S.String, }), ).annotate({ identifier: "WafPackagesRulesEditResultWAFManagedRulesAnomalyRule", }) as any as S.Schema; export type WafPackagesRulesEditResultWAFManagedRulesTraditionalDenyRuleAllowedModesItem = | "default" | "disable" | "simulate" | "block" | "challenge"; export const WafPackagesRulesEditResultWAFManagedRulesTraditionalDenyRuleAllowedModesItem = /*@__PURE__*/ S.String; export type WafPackagesRulesEditResultWAFManagedRulesTraditionalDenyRuleAllowedModesList = Array; export const WafPackagesRulesEditResultWAFManagedRulesTraditionalDenyRuleAllowedModesList = /*@__PURE__*/ S.Array( WafPackagesRulesEditResultWAFManagedRulesTraditionalDenyRuleAllowedModesItem, ) as any as S.Schema; export type WafPackagesRulesEditResultWAFManagedRulesTraditionalDenyRuleDefaultMode = | "disable" | "simulate" | "block" | "challenge"; export const WafPackagesRulesEditResultWAFManagedRulesTraditionalDenyRuleDefaultMode = /*@__PURE__*/ S.String; export type WafPackagesRulesEditResultWAFManagedRulesTraditionalDenyRuleMode = | "default" | "disable" | "simulate" | "block" | "challenge"; export const WafPackagesRulesEditResultWAFManagedRulesTraditionalDenyRuleMode = /*@__PURE__*/ S.String; export interface WafPackagesRulesEditResultWAFManagedRulesTraditionalDenyRule { /** Defines the unique identifier of the WAF rule. */ id: string; /** Defines the list of possible actions of the WAF rule when it is triggered. */ allowedModes: WafPackagesRulesEditResultWAFManagedRulesTraditionalDenyRuleAllowedModesList; /** Defines the default action/mode of a rule. */ defaultMode: WafPackagesRulesEditResultWAFManagedRulesTraditionalDenyRuleDefaultMode; /** Defines the public description of the WAF rule. */ description: string; /** Defines the rule group to which the current WAF rule belongs. */ group: WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleGroup; /** Defines the action that the current WAF rule will perform when triggered. Applies to traditional (deny) WAF rules. */ mode: WafPackagesRulesEditResultWAFManagedRulesTraditionalDenyRuleMode; /** Defines the unique identifier of a WAF package. */ packageId: string; /** Defines the order in which the individual WAF rule is executed within its rule group. */ priority: string; } export const WafPackagesRulesEditResultWAFManagedRulesTraditionalDenyRule = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, allowedModes: WafPackagesRulesEditResultWAFManagedRulesTraditionalDenyRuleAllowedModesList.pipe( T.Body("allowed_modes"), ), defaultMode: WafPackagesRulesEditResultWAFManagedRulesTraditionalDenyRuleDefaultMode.pipe( T.Body("default_mode"), ), description: S.String, group: WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleGroup, mode: WafPackagesRulesEditResultWAFManagedRulesTraditionalDenyRuleMode, packageId: S.String.pipe(T.Body("package_id")), priority: S.String, }), ).annotate({ identifier: "WafPackagesRulesEditResultWAFManagedRulesTraditionalDenyRule", }) as any as S.Schema; export type WafPackagesRulesEditResultWAFManagedRulesTraditionalAllowRuleAllowedModesItem = | "on" | "off"; export const WafPackagesRulesEditResultWAFManagedRulesTraditionalAllowRuleAllowedModesItem = /*@__PURE__*/ S.String; export type WafPackagesRulesEditResultWAFManagedRulesTraditionalAllowRuleAllowedModesList = Array; export const WafPackagesRulesEditResultWAFManagedRulesTraditionalAllowRuleAllowedModesList = /*@__PURE__*/ S.Array( WafPackagesRulesEditResultWAFManagedRulesTraditionalAllowRuleAllowedModesItem, ) as any as S.Schema; export type WafPackagesRulesEditResultWAFManagedRulesTraditionalAllowRuleMode = | "on" | "off"; export const WafPackagesRulesEditResultWAFManagedRulesTraditionalAllowRuleMode = /*@__PURE__*/ S.String; export interface WafPackagesRulesEditResultWAFManagedRulesTraditionalAllowRule { /** Defines the unique identifier of the WAF rule. */ id: string; /** Defines the available modes for the current WAF rule. */ allowedModes: WafPackagesRulesEditResultWAFManagedRulesTraditionalAllowRuleAllowedModesList; /** Defines the public description of the WAF rule. */ description: string; /** Defines the rule group to which the current WAF rule belongs. */ group: WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleGroup; /** When set to `on`, the current rule will be used when evaluating the request. Applies to traditional (allow) WAF rules. */ mode: WafPackagesRulesEditResultWAFManagedRulesTraditionalAllowRuleMode; /** Defines the unique identifier of a WAF package. */ packageId: string; /** Defines the order in which the individual WAF rule is executed within its rule group. */ priority: string; } export const WafPackagesRulesEditResultWAFManagedRulesTraditionalAllowRule = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, allowedModes: WafPackagesRulesEditResultWAFManagedRulesTraditionalAllowRuleAllowedModesList.pipe( T.Body("allowed_modes"), ), description: S.String, group: WafPackagesRulesListResultItemWAFManagedRulesAnomalyRuleGroup, mode: WafPackagesRulesEditResultWAFManagedRulesTraditionalAllowRuleMode, packageId: S.String.pipe(T.Body("package_id")), priority: S.String, }), ).annotate({ identifier: "WafPackagesRulesEditResultWAFManagedRulesTraditionalAllowRule", }) as any as S.Schema; export type WafPackagesRulesEditResult = | WafPackagesRulesEditResultWAFManagedRulesAnomalyRule | WafPackagesRulesEditResultWAFManagedRulesTraditionalDenyRule | WafPackagesRulesEditResultWAFManagedRulesTraditionalAllowRule; export const WafPackagesRulesEditResult = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([ [ "id", "allowedModes", "description", "group", "mode", "packageId", "priority", ], [ "id", "allowedModes", "defaultMode", "description", "group", "mode", "packageId", "priority", ], [ "id", "allowedModes", "description", "group", "mode", "packageId", "priority", ], ]), ); export type PatchWafPackageRuleResponse = WafPackagesRulesEditResult; export const PatchWafPackageRuleResponse = /*@__PURE__*/ S.suspend(() => WafPackagesRulesEditResult.pipe( T.EnvelopePayloadRoot(), T.KeyDictionary(KEY_DICTIONARY), ), ).annotate({ identifier: "PatchWafPackageRuleResponse", }) as any as S.Schema; export type LockdownsUpdateRequestUrlsList = Array; export const LockdownsUpdateRequestUrlsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface UpdateLockdownRequest { /** Defines an identifier. */ zoneId: string; /** The unique identifier of the Zone Lockdown rule. */ lockDownsId: string; /** A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of `ip` or `ip_range` configurations. */ configurations: LockdownConfigurationsList; /** The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns. */ urls: LockdownsUpdateRequestUrlsList; /** An informative summary of the rule. This value is sanitized and any tags will be removed. */ description?: string; /** When true, indicates that the rule is currently paused. */ paused?: boolean; /** The priority of the rule to control the processing order. A lower number indicates higher priority. If not provided, any rules with a configured priority will be processed before rules without a priority. */ priority?: number; } export const UpdateLockdownRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), lockDownsId: S.String.pipe(T.Label("lock_downs_id")), configurations: LockdownConfigurationsList, urls: LockdownsUpdateRequestUrlsList, description: S.optional(S.String), paused: S.optional(S.Boolean), priority: S.optional(S.Number), }) .pipe( T.Http({ method: "PUT", uri: "/zones/{zone_id}/firewall/lockdowns/{lock_downs_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateLockdownRequest", }) as any as S.Schema; export type LockdownsUpdateResponseUrlsList = Array; export const LockdownsUpdateResponseUrlsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdateLockdownResponse { /** The unique identifier of the Zone Lockdown rule. */ id: string; /** A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of `ip` or `ip_range` configurations. */ configurations: LockdownConfigurationsList; /** The timestamp of when the rule was created. */ createdOn: string; /** An informative summary of the rule. */ description: string; /** The timestamp of when the rule was last modified. */ modifiedOn: string; /** When true, indicates that the rule is currently paused. */ paused: boolean; /** The URLs to include in the rule definition. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns. */ urls: LockdownsUpdateResponseUrlsList; /** The priority of the Zone Lockdown rule, echoed on reads. */ priority?: number | null; } export const UpdateLockdownResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, configurations: LockdownConfigurationsList, createdOn: S.String.pipe(T.Body("created_on")), description: S.String, modifiedOn: S.String.pipe(T.Body("modified_on")), paused: S.Boolean, urls: LockdownsUpdateResponseUrlsList, priority: S.optional(S.NullOr(S.Number)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateLockdownResponse", }) as any as S.Schema; export type RulesUpdateRequestActionMode = | "simulate" | "ban" | "challenge" | "js_challenge" | "managed_challenge"; export const RulesUpdateRequestActionMode = /*@__PURE__*/ S.String; export type RulesUpdateRequestActionResponse = RulesCreateRequestActionResponse; export const RulesUpdateRequestActionResponse = RulesCreateRequestActionResponse; export interface RulesUpdateRequestAction { /** The action to perform. */ mode?: RulesUpdateRequestActionMode | (string & {}); /** A custom content type and reponse to return when the threshold is exceeded. The custom response configured in this object will override the custom error for the zone. This object is optional. */ response?: RulesCreateRequestActionResponse; /** The time in seconds during which Cloudflare will perform the mitigation action. Must be an integer value greater than or equal to the period. */ timeout?: number; } export const RulesUpdateRequestAction = /*@__PURE__*/ S.suspend(() => S.Struct({ mode: S.optional(RulesUpdateRequestActionMode), response: S.optional(RulesCreateRequestActionResponse), timeout: S.optional(S.Number), }), ).annotate({ identifier: "RulesUpdateRequestAction", }) as any as S.Schema; export type RulesUpdateRequestFilter = RulesCreateRequestFilter; export const RulesUpdateRequestFilter = RulesCreateRequestFilter; export interface UpdateRuleRequest { /** Defines an identifier. */ zoneId: string; /** The unique identifier of the firewall rule. */ ruleId: string; /** The action to perform when the threshold of matched traffic within the configured period is exceeded. */ action: RulesUpdateRequestAction; filter: RulesCreateRequestFilter; } export const UpdateRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), ruleId: S.String.pipe(T.Label("rule_id")), action: RulesUpdateRequestAction, filter: RulesCreateRequestFilter, }) .pipe( T.Http({ method: "PUT", uri: "/zones/{zone_id}/firewall/rules/{rule_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateRuleRequest", }) as any as S.Schema; export type RulesUpdateResponseAction = | "block" | "challenge" | "js_challenge" | "managed_challenge" | "allow" | "log" | "bypass"; export const RulesUpdateResponseAction = /*@__PURE__*/ S.String; export type RulesUpdateResponseFilterFirewallFilter = RulesBulkDeleteResultItemFilterFirewallFilter; export const RulesUpdateResponseFilterFirewallFilter = RulesBulkDeleteResultItemFilterFirewallFilter; export type RulesUpdateResponseFilterDeletedFilter = RulesBulkDeleteResultItemFilterDeletedFilter; export const RulesUpdateResponseFilterDeletedFilter = RulesBulkDeleteResultItemFilterDeletedFilter; export type RulesUpdateResponseFilter = | RulesBulkDeleteResultItemFilterFirewallFilter | RulesBulkDeleteResultItemFilterDeletedFilter; export const RulesUpdateResponseFilter = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([ ["id", "description", "expression", "paused", "ref"], ["id", "deleted"], ]), ); export type RulesUpdateResponseProductsItem = | "zoneLockdown" | "uaBlock" | "bic" | "hot" | "securityLevel" | "rateLimit" | "waf"; export const RulesUpdateResponseProductsItem = /*@__PURE__*/ S.String; export type RulesUpdateResponseProductsList = Array; export const RulesUpdateResponseProductsList = /*@__PURE__*/ S.Array( RulesUpdateResponseProductsItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdateRuleResponse { /** The unique identifier of the firewall rule. */ id?: string | null; /** The action to apply to a matched request. The `log` action is only available on an Enterprise plan. */ action?: RulesUpdateResponseAction | null; /** An informative summary of the firewall rule. */ description?: string | null; filter?: RulesUpdateResponseFilter | null; /** When true, indicates that the firewall rule is currently paused. */ paused?: boolean | null; /** The priority of the rule. Optional value used to define the processing order. A lower number indicates a higher priority. If not provided, rules with a defined priority will be processed before rules without a priority. */ priority?: number | null; products?: RulesUpdateResponseProductsList | null; /** A short reference tag. Allows you to select related firewall rules. */ ref?: string | null; } export const UpdateRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), action: S.optional(S.NullOr(RulesUpdateResponseAction)), description: S.optional(S.NullOr(S.String)), filter: S.optional(S.NullOr(RulesUpdateResponseFilter)), paused: S.optional(S.NullOr(S.Boolean)), priority: S.optional(S.NullOr(S.Number)), products: S.optional(S.NullOr(RulesUpdateResponseProductsList)), ref: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateRuleResponse", }) as any as S.Schema; export type UaRulesUpdateRequestConfigurationAccessRuleIPConfigurationTarget = "ip"; export const UaRulesUpdateRequestConfigurationAccessRuleIPConfigurationTarget = /*@__PURE__*/ S.String; export interface UaRulesUpdateRequestConfigurationAccessRuleIPConfiguration { /** The configuration target. You must set the target to `ip` when specifying an IP address in the rule. */ target?: | UaRulesUpdateRequestConfigurationAccessRuleIPConfigurationTarget | (string & {}); /** The IP address to match. This address will be compared to the IP address of incoming requests. */ value?: string; } export const UaRulesUpdateRequestConfigurationAccessRuleIPConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( UaRulesUpdateRequestConfigurationAccessRuleIPConfigurationTarget, ), value: S.optional(S.String), }), ).annotate({ identifier: "UaRulesUpdateRequestConfigurationAccessRuleIPConfiguration", }) as any as S.Schema; export type UaRulesUpdateRequestConfigurationIPV6ConfigurationTarget = "ip6"; export const UaRulesUpdateRequestConfigurationIPV6ConfigurationTarget = /*@__PURE__*/ S.String; export interface UaRulesUpdateRequestConfigurationIPV6Configuration { /** The configuration target. You must set the target to `ip6` when specifying an IPv6 address in the rule. */ target?: | UaRulesUpdateRequestConfigurationIPV6ConfigurationTarget | (string & {}); /** The IPv6 address to match. */ value?: string; } export const UaRulesUpdateRequestConfigurationIPV6Configuration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( UaRulesUpdateRequestConfigurationIPV6ConfigurationTarget, ), value: S.optional(S.String), }), ).annotate({ identifier: "UaRulesUpdateRequestConfigurationIPV6Configuration", }) as any as S.Schema; export type UaRulesUpdateRequestConfigurationAccessRuleCIDRConfigurationTarget = "ip_range"; export const UaRulesUpdateRequestConfigurationAccessRuleCIDRConfigurationTarget = /*@__PURE__*/ S.String; export interface UaRulesUpdateRequestConfigurationAccessRuleCIDRConfiguration { /** The configuration target. You must set the target to `ip_range` when specifying an IP address range in the rule. */ target?: | UaRulesUpdateRequestConfigurationAccessRuleCIDRConfigurationTarget | (string & {}); /** The IP address range to match. You can only use prefix lengths `/16` and `/24` for IPv4 ranges, and prefix lengths `/32`, `/48`, and `/64` for IPv6 ranges. */ value?: string; } export const UaRulesUpdateRequestConfigurationAccessRuleCIDRConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( UaRulesUpdateRequestConfigurationAccessRuleCIDRConfigurationTarget, ), value: S.optional(S.String), }), ).annotate({ identifier: "UaRulesUpdateRequestConfigurationAccessRuleCIDRConfiguration", }) as any as S.Schema; export type UaRulesUpdateRequestConfigurationASNConfigurationTarget = "asn"; export const UaRulesUpdateRequestConfigurationASNConfigurationTarget = /*@__PURE__*/ S.String; export interface UaRulesUpdateRequestConfigurationASNConfiguration { /** The configuration target. You must set the target to `asn` when specifying an Autonomous System Number (ASN) in the rule. */ target?: | UaRulesUpdateRequestConfigurationASNConfigurationTarget | (string & {}); /** The AS number to match. */ value?: string; } export const UaRulesUpdateRequestConfigurationASNConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( UaRulesUpdateRequestConfigurationASNConfigurationTarget, ), value: S.optional(S.String), }), ).annotate({ identifier: "UaRulesUpdateRequestConfigurationASNConfiguration", }) as any as S.Schema; export type UaRulesUpdateRequestConfigurationCountryConfigurationTarget = "country"; export const UaRulesUpdateRequestConfigurationCountryConfigurationTarget = /*@__PURE__*/ S.String; export interface UaRulesUpdateRequestConfigurationCountryConfiguration { /** The configuration target. You must set the target to `country` when specifying a country code in the rule. */ target?: | UaRulesUpdateRequestConfigurationCountryConfigurationTarget | (string & {}); /** The two-letter ISO-3166-1 alpha-2 code to match. For more information, refer to [IP Access rules: Parameters](https://developers.cloudflare.com/waf/tools/ip-access-rules/parameters/#country). */ value?: string; } export const UaRulesUpdateRequestConfigurationCountryConfiguration = /*@__PURE__*/ S.suspend(() => S.Struct({ target: S.optional( UaRulesUpdateRequestConfigurationCountryConfigurationTarget, ), value: S.optional(S.String), }), ).annotate({ identifier: "UaRulesUpdateRequestConfigurationCountryConfiguration", }) as any as S.Schema; export type UaRulesUpdateRequestConfiguration = | UaRulesUpdateRequestConfigurationAccessRuleIPConfiguration | UaRulesUpdateRequestConfigurationIPV6Configuration | UaRulesUpdateRequestConfigurationAccessRuleCIDRConfiguration | UaRulesUpdateRequestConfigurationASNConfiguration | UaRulesUpdateRequestConfigurationCountryConfiguration; export const UaRulesUpdateRequestConfiguration = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([ ["target", "value"], ["target", "value"], ["target", "value"], ["target", "value"], ["target", "value"], ]), ); export type UaRulesUpdateRequestMode = | "block" | "challenge" | "whitelist" | "js_challenge" | "managed_challenge"; export const UaRulesUpdateRequestMode = /*@__PURE__*/ S.String; export interface UpdateUaRuleRequest { /** Defines an identifier. */ zoneId: string; /** The unique identifier of the User Agent Blocking rule. */ uaRuleId: string; /** The rule configuration. */ configuration: UaRulesUpdateRequestConfiguration; /** The action to apply to a matched request. */ mode: UaRulesUpdateRequestMode | (string & {}); /** An informative summary of the rule. This value is sanitized and any tags will be removed. */ description?: string; /** When true, indicates that the rule is currently paused. */ paused?: boolean; } export const UpdateUaRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), uaRuleId: S.String.pipe(T.Label("ua_rule_id")), configuration: UaRulesUpdateRequestConfiguration, mode: UaRulesUpdateRequestMode, description: S.optional(S.String), paused: S.optional(S.Boolean), }) .pipe( T.Http({ method: "PUT", uri: "/zones/{zone_id}/firewall/ua_rules/{ua_rule_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateUaRuleRequest", }) as any as S.Schema; export type UaRulesUpdateResponseConfiguration = UaRulesCreateResponseConfiguration; export const UaRulesUpdateResponseConfiguration = UaRulesCreateResponseConfiguration; export type UaRulesUpdateResponseMode = | "block" | "challenge" | "js_challenge" | "managed_challenge"; export const UaRulesUpdateResponseMode = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdateUaRuleResponse { /** The unique identifier of the User Agent Blocking rule. */ id?: string | null; /** The configuration object for the current rule. */ configuration?: UaRulesCreateResponseConfiguration | null; /** An informative summary of the rule. */ description?: string | null; /** The action to apply to a matched request. */ mode?: UaRulesUpdateResponseMode | null; /** When true, indicates that the rule is currently paused. */ paused?: boolean | null; } export const UpdateUaRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), configuration: S.optional(S.NullOr(UaRulesCreateResponseConfiguration)), description: S.optional(S.NullOr(S.String)), mode: S.optional(S.NullOr(UaRulesUpdateResponseMode)), paused: S.optional(S.NullOr(S.Boolean)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateUaRuleResponse", }) as any as S.Schema; export type WafOverridesUpdateRequestRewriteActionBlock = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesUpdateRequestRewriteActionBlock = /*@__PURE__*/ S.String; export type WafOverridesUpdateRequestRewriteActionChallenge = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesUpdateRequestRewriteActionChallenge = /*@__PURE__*/ S.String; export type WafOverridesUpdateRequestRewriteActionDefault = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesUpdateRequestRewriteActionDefault = /*@__PURE__*/ S.String; export type WafOverridesUpdateRequestRewriteActionDisable = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesUpdateRequestRewriteActionDisable = /*@__PURE__*/ S.String; export type WafOverridesUpdateRequestRewriteActionSimulate = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesUpdateRequestRewriteActionSimulate = /*@__PURE__*/ S.String; export interface WafOverridesUpdateRequestRewriteAction { /** The WAF rule action to apply. */ block?: WafOverridesUpdateRequestRewriteActionBlock | (string & {}); /** The WAF rule action to apply. */ challenge?: WafOverridesUpdateRequestRewriteActionChallenge | (string & {}); /** The WAF rule action to apply. */ default?: WafOverridesUpdateRequestRewriteActionDefault | (string & {}); /** The WAF rule action to apply. */ disable?: WafOverridesUpdateRequestRewriteActionDisable | (string & {}); /** The WAF rule action to apply. */ simulate?: WafOverridesUpdateRequestRewriteActionSimulate | (string & {}); } export const WafOverridesUpdateRequestRewriteAction = /*@__PURE__*/ S.suspend( () => S.Struct({ block: S.optional(WafOverridesUpdateRequestRewriteActionBlock), challenge: S.optional(WafOverridesUpdateRequestRewriteActionChallenge), default: S.optional(WafOverridesUpdateRequestRewriteActionDefault), disable: S.optional(WafOverridesUpdateRequestRewriteActionDisable), simulate: S.optional(WafOverridesUpdateRequestRewriteActionSimulate), }), ).annotate({ identifier: "WafOverridesUpdateRequestRewriteAction", }) as any as S.Schema; export type WafOverridesUpdateRequestRules = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesUpdateRequestRules = /*@__PURE__*/ S.String; export type WafOverridesUpdateRequestUrlsList = Array; export const WafOverridesUpdateRequestUrlsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface UpdateWafOverrideRequest { /** Defines an identifier. */ zoneId: string; /** The unique identifier of the WAF override. */ overridesId: string; /** Defines an identifier. */ id: string; /** Specifies that, when a WAF rule matches, its configured action will be replaced by the action configured in this object. */ rewriteAction: WafOverridesUpdateRequestRewriteAction; /** An object that allows you to override the action of specific WAF rules. Each key of this object must be the ID of a WAF rule, and each value must be a valid WAF action. Unless you are disabling a rule, ensure that you also enable the rule group that this WAF rule belongs to. When creating a new URI-based WAF override, you must provide a `groups` object or a `rules` object. */ rules: WafOverridesUpdateRequestRules | (string & {}); /** The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns. */ urls: WafOverridesUpdateRequestUrlsList; } export const UpdateWafOverrideRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), overridesId: S.String.pipe(T.Label("overrides_id")), id: S.String, rewriteAction: WafOverridesUpdateRequestRewriteAction.pipe( T.Body("rewrite_action"), ), rules: WafOverridesUpdateRequestRules, urls: WafOverridesUpdateRequestUrlsList, }) .pipe( T.Http({ method: "PUT", uri: "/zones/{zone_id}/firewall/waf/overrides/{overrides_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateWafOverrideRequest", }) as any as S.Schema; export type WafOverridesUpdateResponseGroupsMap = { [key: string]: unknown | undefined; }; export const WafOverridesUpdateResponseGroupsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type WafOverridesUpdateResponseRewriteActionBlock = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesUpdateResponseRewriteActionBlock = /*@__PURE__*/ S.String; export type WafOverridesUpdateResponseRewriteActionChallenge = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesUpdateResponseRewriteActionChallenge = /*@__PURE__*/ S.String; export type WafOverridesUpdateResponseRewriteActionDefault = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesUpdateResponseRewriteActionDefault = /*@__PURE__*/ S.String; export type WafOverridesUpdateResponseRewriteActionDisable = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesUpdateResponseRewriteActionDisable = /*@__PURE__*/ S.String; export type WafOverridesUpdateResponseRewriteActionSimulate = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesUpdateResponseRewriteActionSimulate = /*@__PURE__*/ S.String; export interface WafOverridesUpdateResponseRewriteAction { /** The WAF rule action to apply. */ block?: WafOverridesUpdateResponseRewriteActionBlock | null; /** The WAF rule action to apply. */ challenge?: WafOverridesUpdateResponseRewriteActionChallenge | null; /** The WAF rule action to apply. */ default?: WafOverridesUpdateResponseRewriteActionDefault | null; /** The WAF rule action to apply. */ disable?: WafOverridesUpdateResponseRewriteActionDisable | null; /** The WAF rule action to apply. */ simulate?: WafOverridesUpdateResponseRewriteActionSimulate | null; } export const WafOverridesUpdateResponseRewriteAction = /*@__PURE__*/ S.suspend( () => S.Struct({ block: S.optional(S.NullOr(WafOverridesUpdateResponseRewriteActionBlock)), challenge: S.optional( S.NullOr(WafOverridesUpdateResponseRewriteActionChallenge), ), default: S.optional( S.NullOr(WafOverridesUpdateResponseRewriteActionDefault), ), disable: S.optional( S.NullOr(WafOverridesUpdateResponseRewriteActionDisable), ), simulate: S.optional( S.NullOr(WafOverridesUpdateResponseRewriteActionSimulate), ), }), ).annotate({ identifier: "WafOverridesUpdateResponseRewriteAction", }) as any as S.Schema; export type WafOverridesUpdateResponseRules = | "challenge" | "block" | "simulate" | "disable" | "default"; export const WafOverridesUpdateResponseRules = /*@__PURE__*/ S.String; export type WafOverridesUpdateResponseUrlsList = Array; export const WafOverridesUpdateResponseUrlsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdateWafOverrideResponse { /** The unique identifier of the WAF override. */ id?: string | null; /** An informative summary of the current URI-based WAF override. */ description?: string | null; /** An object that allows you to enable or disable WAF rule groups for the current WAF override. Each key of this object must be the ID of a WAF rule group, and each value must be a valid WAF action (usually `default` or `disable`). When creating a new URI-based WAF override, you must provide a `groups` object or a `rules` object. */ groups?: WafOverridesUpdateResponseGroupsMap | null; /** When true, indicates that the rule is currently paused. */ paused?: boolean | null; /** The relative priority of the current URI-based WAF override when multiple overrides match a single URL. A lower number indicates higher priority. Higher priority overrides may overwrite values set by lower priority overrides. */ priority?: number | null; /** Specifies that, when a WAF rule matches, its configured action will be replaced by the action configured in this object. */ rewriteAction?: WafOverridesUpdateResponseRewriteAction | null; /** An object that allows you to override the action of specific WAF rules. Each key of this object must be the ID of a WAF rule, and each value must be a valid WAF action. Unless you are disabling a rule, ensure that you also enable the rule group that this WAF rule belongs to. When creating a new URI-based WAF override, you must provide a `groups` object or a `rules` object. */ rules?: WafOverridesUpdateResponseRules | null; /** The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns. */ urls?: WafOverridesUpdateResponseUrlsList | null; } export const UpdateWafOverrideResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), description: S.optional(S.NullOr(S.String)), groups: S.optional(S.NullOr(WafOverridesUpdateResponseGroupsMap)), paused: S.optional(S.NullOr(S.Boolean)), priority: S.optional(S.NullOr(S.Number)), rewriteAction: S.optional( S.NullOr(WafOverridesUpdateResponseRewriteAction).pipe( T.Body("rewrite_action"), ), ), rules: S.optional(S.NullOr(WafOverridesUpdateResponseRules)), urls: S.optional(S.NullOr(WafOverridesUpdateResponseUrlsList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateWafOverrideResponse", }) as any as S.Schema; export type BulkDeleteRulesError = CloudflareOpError; /** Deletes existing firewall rules. */ export const bulkDeleteRules: API.PaginatedOperationMethod< BulkDeleteRulesRequest, BulkDeleteRulesResponse, BulkDeleteRulesError, CloudflareOpContext, RulesBulkDeleteResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: BulkDeleteRulesRequest, output: BulkDeleteRulesResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type BulkPatchRulesError = CloudflareOpError; /** Updates the priority of existing firewall rules. */ export const bulkPatchRules: API.PaginatedOperationMethod< BulkPatchRulesRequest, BulkPatchRulesResponse, BulkPatchRulesError, CloudflareOpContext, RulesBulkEditResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: BulkPatchRulesRequest, output: BulkPatchRulesResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type BulkPutRulesError = CloudflareOpError; /** Updates one or more existing firewall rules. */ export const bulkPutRules: API.PaginatedOperationMethod< BulkPutRulesRequest, BulkPutRulesResponse, BulkPutRulesError, CloudflareOpContext, RulesBulkUpdateResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: BulkPutRulesRequest, output: BulkPutRulesResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type CreateAccessRuleForAccountError = | DuplicateAccessRule | Forbidden | CloudflareOpError; /** Creates a new IP Access rule for an account or zone. The rule will apply to all zones in the account or zone. Note: To create an IP Access rule that applies to a single zone, refer to the [IP Access rules for a zone](#ip-access-rules-for-a-zone) endpoints. */ export const createAccessRuleForAccount: API.OperationMethod< CreateAccessRuleForAccountRequest, CreateAccessRuleResponse, CreateAccessRuleForAccountError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateAccessRuleForAccountRequest, output: CreateAccessRuleResponse, errors: [ DuplicateAccessRule, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateAccessRuleForZoneError = | DuplicateAccessRule | Forbidden | CloudflareOpError; /** Creates a new IP Access rule for an account or zone. The rule will apply to all zones in the account or zone. Note: To create an IP Access rule that applies to a single zone, refer to the [IP Access rules for a zone](#ip-access-rules-for-a-zone) endpoints. */ export const createAccessRuleForZone: API.OperationMethod< CreateAccessRuleForZoneRequest, CreateAccessRuleResponse, CreateAccessRuleForZoneError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateAccessRuleForZoneRequest, output: CreateAccessRuleResponse, errors: [ DuplicateAccessRule, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateLockdownError = | DuplicateLockdown | Forbidden | CloudflareOpError; /** Creates a new Zone Lockdown rule. */ export const createLockdown: API.OperationMethod< CreateLockdownRequest, CreateLockdownResponse, CreateLockdownError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateLockdownRequest, output: CreateLockdownResponse, errors: [ DuplicateLockdown, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateRuleError = CloudflareOpError; /** Create one or more firewall rules. */ export const createRule: API.PaginatedOperationMethod< CreateRuleRequest, CreateRuleResponse, CreateRuleError, CloudflareOpContext, RulesCreateResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: CreateRuleRequest, output: CreateRuleResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type CreateUaRuleError = DuplicateUaRule | Forbidden | CloudflareOpError; /** Creates a new User Agent Blocking rule in a zone. */ export const createUaRule: API.OperationMethod< CreateUaRuleRequest, CreateUaRuleResponse, CreateUaRuleError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateUaRuleRequest, output: CreateUaRuleResponse, errors: [DuplicateUaRule, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateWafOverrideError = CloudflareOpError; /** Creates a URI-based WAF override for a zone. **Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). */ export const createWafOverride: API.OperationMethod< CreateWafOverrideRequest, CreateWafOverrideResponse, CreateWafOverrideError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateWafOverrideRequest, output: CreateWafOverrideResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteAccessRuleForAccountError = | AccessRuleNotFound | Forbidden | CloudflareOpError; /** Deletes an existing IP Access rule defined. Note: This operation will affect all zones in the account or zone. */ export const deleteAccessRuleForAccount: API.OperationMethod< DeleteAccessRuleForAccountRequest, DeleteAccessRuleResponse, DeleteAccessRuleForAccountError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteAccessRuleForAccountRequest, output: DeleteAccessRuleResponse, errors: [ AccessRuleNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteAccessRuleForZoneError = | AccessRuleNotFound | Forbidden | CloudflareOpError; /** Deletes an existing IP Access rule defined. Note: This operation will affect all zones in the account or zone. */ export const deleteAccessRuleForZone: API.OperationMethod< DeleteAccessRuleForZoneRequest, DeleteAccessRuleResponse, DeleteAccessRuleForZoneError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteAccessRuleForZoneRequest, output: DeleteAccessRuleResponse, errors: [ AccessRuleNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteLockdownError = | LockdownNotFound | Forbidden | CloudflareOpError; /** Deletes an existing Zone Lockdown rule. */ export const deleteLockdown: API.OperationMethod< DeleteLockdownRequest, DeleteLockdownResponse, DeleteLockdownError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteLockdownRequest, output: DeleteLockdownResponse, errors: [LockdownNotFound, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteRuleError = CloudflareOpError; /** Deletes an existing firewall rule. */ export const deleteRule: API.OperationMethod< DeleteRuleRequest, DeleteRuleResponse, DeleteRuleError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteRuleRequest, output: DeleteRuleResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteUaRuleError = UaRuleNotFound | Forbidden | CloudflareOpError; /** Deletes an existing User Agent Blocking rule. */ export const deleteUaRule: API.OperationMethod< DeleteUaRuleRequest, DeleteUaRuleResponse, DeleteUaRuleError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteUaRuleRequest, output: DeleteUaRuleResponse, errors: [UaRuleNotFound, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteWafOverrideError = CloudflareOpError; /** Deletes an existing URI-based WAF override. **Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). */ export const deleteWafOverride: API.OperationMethod< DeleteWafOverrideRequest, DeleteWafOverrideResponse, DeleteWafOverrideError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteWafOverrideRequest, output: DeleteWafOverrideResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetAccessRuleForAccountError = | AccessRuleNotFound | Forbidden | CloudflareOpError; /** Fetches the details of an IP Access rule defined. */ export const getAccessRuleForAccount: API.OperationMethod< GetAccessRuleForAccountRequest, GetAccessRuleResponse, GetAccessRuleForAccountError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetAccessRuleForAccountRequest, output: GetAccessRuleResponse, errors: [ AccessRuleNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetAccessRuleForZoneError = | AccessRuleNotFound | Forbidden | CloudflareOpError; /** Fetches the details of an IP Access rule defined. */ export const getAccessRuleForZone: API.OperationMethod< GetAccessRuleForZoneRequest, GetAccessRuleResponse, GetAccessRuleForZoneError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetAccessRuleForZoneRequest, output: GetAccessRuleResponse, errors: [ AccessRuleNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetLockdownError = LockdownNotFound | Forbidden | CloudflareOpError; /** Fetches the details of a Zone Lockdown rule. */ export const getLockdown: API.OperationMethod< GetLockdownRequest, GetLockdownResponse, GetLockdownError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetLockdownRequest, output: GetLockdownResponse, errors: [LockdownNotFound, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetRuleError = CloudflareOpError; /** Fetches the details of a firewall rule. */ export const getRule: API.OperationMethod< GetRuleRequest, GetRuleResponse, GetRuleError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetRuleRequest, output: GetRuleResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetUaRuleError = UaRuleNotFound | Forbidden | CloudflareOpError; /** Fetches the details of a User Agent Blocking rule. */ export const getUaRule: API.OperationMethod< GetUaRuleRequest, GetUaRuleResponse, GetUaRuleError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetUaRuleRequest, output: GetUaRuleResponse, errors: [UaRuleNotFound, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetWafOverrideError = CloudflareOpError; /** Fetches the details of a URI-based WAF override. **Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). */ export const getWafOverride: API.OperationMethod< GetWafOverrideRequest, GetWafOverrideResponse, GetWafOverrideError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetWafOverrideRequest, output: GetWafOverrideResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetWafPackageError = CloudflareOpError; /** Fetches the details of a WAF package. **Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). */ export const getWafPackage: API.OperationMethod< GetWafPackageRequest, GetWafPackageResponse, GetWafPackageError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetWafPackageRequest, output: GetWafPackageResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetWafPackageGroupError = CloudflareOpError; /** Fetches the details of a WAF rule group. **Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). */ export const getWafPackageGroup: API.OperationMethod< GetWafPackageGroupRequest, GetWafPackageGroupResponse, GetWafPackageGroupError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetWafPackageGroupRequest, output: GetWafPackageGroupResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetWafPackageRuleError = CloudflareOpError; /** Fetches the details of a WAF rule in a WAF package. **Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). */ export const getWafPackageRule: API.OperationMethod< GetWafPackageRuleRequest, GetWafPackageRuleResponse, GetWafPackageRuleError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetWafPackageRuleRequest, output: GetWafPackageRuleResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListAccessRulesForAccountError = Forbidden | CloudflareOpError; /** Fetches IP Access rules of an account or zone. These rules apply to all the zones in the account or zone. You can filter the results using several optional parameters. */ export const listAccessRulesForAccount: API.PaginatedOperationMethod< ListAccessRulesForAccountRequest, ListAccessRulesResponse, ListAccessRulesForAccountError, CloudflareOpContext, AccessRulesListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListAccessRulesForAccountRequest, output: ListAccessRulesResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "resultInfo.page", items: "result", pageSize: "perPage", } as const, }), cloudflarePaginate, ) as any; export type ListAccessRulesForZoneError = Forbidden | CloudflareOpError; /** Fetches IP Access rules of an account or zone. These rules apply to all the zones in the account or zone. You can filter the results using several optional parameters. */ export const listAccessRulesForZone: API.PaginatedOperationMethod< ListAccessRulesForZoneRequest, ListAccessRulesResponse, ListAccessRulesForZoneError, CloudflareOpContext, AccessRulesListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListAccessRulesForZoneRequest, output: ListAccessRulesResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "resultInfo.page", items: "result", pageSize: "perPage", } as const, }), cloudflarePaginate, ) as any; export type ListLockdownsError = Forbidden | CloudflareOpError; /** Fetches Zone Lockdown rules. You can filter the results using several optional parameters. */ export const listLockdowns: API.PaginatedOperationMethod< ListLockdownsRequest, ListLockdownsResponse, ListLockdownsError, CloudflareOpContext, LockdownsListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListLockdownsRequest, output: ListLockdownsResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "resultInfo.page", items: "result", pageSize: "perPage", } as const, }), cloudflarePaginate, ) as any; export type ListRulesError = CloudflareOpError; /** Fetches firewall rules in a zone. You can filter the results using several optional parameters. */ export const listRules: API.PaginatedOperationMethod< ListRulesRequest, ListRulesResponse, ListRulesError, CloudflareOpContext, RulesListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListRulesRequest, output: ListRulesResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "resultInfo.page", items: "result", pageSize: "perPage", } as const, }), cloudflarePaginate, ) as any; export type ListUaRulesError = Forbidden | CloudflareOpError; /** Fetches User Agent Blocking rules in a zone. You can filter the results using several optional parameters. */ export const listUaRules: API.PaginatedOperationMethod< ListUaRulesRequest, ListUaRulesResponse, ListUaRulesError, CloudflareOpContext, UaRulesListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListUaRulesRequest, output: ListUaRulesResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "resultInfo.page", items: "result", pageSize: "perPage", } as const, }), cloudflarePaginate, ) as any; export type ListWafOverridesError = CloudflareOpError; /** Fetches the URI-based WAF overrides in a zone. **Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). */ export const listWafOverrides: API.PaginatedOperationMethod< ListWafOverridesRequest, ListWafOverridesResponse, ListWafOverridesError, CloudflareOpContext, WafOverridesListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListWafOverridesRequest, output: ListWafOverridesResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "resultInfo.page", items: "result", pageSize: "perPage", } as const, }), cloudflarePaginate, ) as any; export type ListWafPackageGroupsError = CloudflareOpError; /** Fetches the WAF rule groups in a WAF package. **Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). */ export const listWafPackageGroups: API.PaginatedOperationMethod< ListWafPackageGroupsRequest, ListWafPackageGroupsResponse, ListWafPackageGroupsError, CloudflareOpContext, WafPackagesGroupsListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListWafPackageGroupsRequest, output: ListWafPackageGroupsResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "resultInfo.page", items: "result", pageSize: "perPage", } as const, }), cloudflarePaginate, ) as any; export type ListWafPackageRulesError = CloudflareOpError; /** Fetches WAF rules in a WAF package. **Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). */ export const listWafPackageRules: API.PaginatedOperationMethod< ListWafPackageRulesRequest, ListWafPackageRulesResponse, ListWafPackageRulesError, CloudflareOpContext, WafPackagesRulesListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListWafPackageRulesRequest, output: ListWafPackageRulesResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "resultInfo.page", items: "result", pageSize: "perPage", } as const, }), cloudflarePaginate, ) as any; export type ListWafPackagesError = CloudflareOpError; /** Fetches WAF packages for a zone. **Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). */ export const listWafPackages: API.OperationMethod< ListWafPackagesRequest, ListWafPackagesResponse, ListWafPackagesError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListWafPackagesRequest, output: ListWafPackagesResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PatchAccessRuleForAccountError = | AccessRuleNotFound | Forbidden | CloudflareOpError; /** Updates an IP Access rule defined. Note: This operation will affect all zones in the account or zone. */ export const patchAccessRuleForAccount: API.OperationMethod< PatchAccessRuleForAccountRequest, PatchAccessRuleResponse, PatchAccessRuleForAccountError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PatchAccessRuleForAccountRequest, output: PatchAccessRuleResponse, errors: [ AccessRuleNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PatchAccessRuleForZoneError = | AccessRuleNotFound | Forbidden | CloudflareOpError; /** Updates an IP Access rule defined. Note: This operation will affect all zones in the account or zone. */ export const patchAccessRuleForZone: API.OperationMethod< PatchAccessRuleForZoneRequest, PatchAccessRuleResponse, PatchAccessRuleForZoneError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PatchAccessRuleForZoneRequest, output: PatchAccessRuleResponse, errors: [ AccessRuleNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PatchRuleError = CloudflareOpError; /** Updates the priority of an existing firewall rule. */ export const patchRule: API.PaginatedOperationMethod< PatchRuleRequest, PatchRuleResponse, PatchRuleError, CloudflareOpContext, RulesEditResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: PatchRuleRequest, output: PatchRuleResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type PatchWafPackageGroupError = CloudflareOpError; /** Updates a WAF rule group. You can update the state (`mode` parameter) of a rule group. **Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). */ export const patchWafPackageGroup: API.OperationMethod< PatchWafPackageGroupRequest, PatchWafPackageGroupResponse, PatchWafPackageGroupError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PatchWafPackageGroupRequest, output: PatchWafPackageGroupResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PatchWafPackageRuleError = CloudflareOpError; /** Updates a WAF rule. You can only update the mode/action of the rule. **Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). */ export const patchWafPackageRule: API.OperationMethod< PatchWafPackageRuleRequest, PatchWafPackageRuleResponse, PatchWafPackageRuleError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PatchWafPackageRuleRequest, output: PatchWafPackageRuleResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UpdateLockdownError = | LockdownNotFound | DuplicateLockdown | Forbidden | CloudflareOpError; /** Updates an existing Zone Lockdown rule. */ export const updateLockdown: API.OperationMethod< UpdateLockdownRequest, UpdateLockdownResponse, UpdateLockdownError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateLockdownRequest, output: UpdateLockdownResponse, errors: [ LockdownNotFound, DuplicateLockdown, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UpdateRuleError = CloudflareOpError; /** Updates an existing firewall rule. */ export const updateRule: API.OperationMethod< UpdateRuleRequest, UpdateRuleResponse, UpdateRuleError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateRuleRequest, output: UpdateRuleResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UpdateUaRuleError = | UaRuleNotFound | DuplicateUaRule | Forbidden | CloudflareOpError; /** Updates an existing User Agent Blocking rule. */ export const updateUaRule: API.OperationMethod< UpdateUaRuleRequest, UpdateUaRuleResponse, UpdateUaRuleError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateUaRuleRequest, output: UpdateUaRuleResponse, errors: [ UaRuleNotFound, DuplicateUaRule, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UpdateWafOverrideError = CloudflareOpError; /** Updates an existing URI-based WAF override. **Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). */ export const updateWafOverride: API.OperationMethod< UpdateWafOverrideRequest, UpdateWafOverrideResponse, UpdateWafOverrideError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateWafOverrideRequest, output: UpdateWafOverrideResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, }));