From 4dbe42349b3e95f9973f6d0af6c763a3702b9ff4 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 9 Apr 2024 23:56:14 +0000
Subject: [PATCH] feat(api): update via SDK Studio (#273)
---
api.md | 4 +
src/resources/rulesets/phases/phases.ts | 1310 +--------
src/resources/rulesets/phases/versions.ts | 457 +---
src/resources/rulesets/rules.ts | 1659 +-----------
src/resources/rulesets/rulesets.ts | 2693 ++++---------------
src/resources/rulesets/versions/by-tag.ts | 458 +---
src/resources/rulesets/versions/versions.ts | 457 +---
7 files changed, 656 insertions(+), 6382 deletions(-)
diff --git a/api.md b/api.md
index 38af470aa4..41d51a0544 100644
--- a/api.md
+++ b/api.md
@@ -2530,7 +2530,11 @@ Methods:
Types:
+- BlockRule
+- ExecuteRule
+- LogRule
- Ruleset
+- SkipRule
- RulesetCreateResponse
- RulesetUpdateResponse
- RulesetGetResponse
diff --git a/src/resources/rulesets/phases/phases.ts b/src/resources/rulesets/phases/phases.ts
index 1057bd7281..aa0aa655da 100644
--- a/src/resources/rulesets/phases/phases.ts
+++ b/src/resources/rulesets/phases/phases.ts
@@ -5,7 +5,7 @@ import { APIResource } from 'cloudflare/resource';
import { isRequestOptions } from 'cloudflare/core';
import { CloudflareError } from 'cloudflare/error';
import * as PhasesAPI from 'cloudflare/resources/rulesets/phases/phases';
-import * as Shared from 'cloudflare/resources/shared';
+import * as RulesetsAPI from 'cloudflare/resources/rulesets/rulesets';
import * as VersionsAPI from 'cloudflare/resources/rulesets/phases/versions';
export class Phases extends APIResource {
@@ -238,12 +238,7 @@ export interface PhaseUpdateResponse {
/**
* The list of rules in the ruleset.
*/
- rules: Array<
- | PhaseUpdateResponse.RulesetsBlockRule
- | PhaseUpdateResponse.RulesetsExecuteRule
- | PhaseUpdateResponse.RulesetsLogRule
- | PhaseUpdateResponse.RulesetsSkipRule
- >;
+ rules: Array;
/**
* The version of the ruleset.
@@ -256,455 +251,6 @@ export interface PhaseUpdateResponse {
description?: string;
}
-export namespace PhaseUpdateResponse {
- export interface RulesetsBlockRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'block';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsBlockRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsBlockRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- response?: ActionParameters.Response;
- }
-
- export namespace ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- export interface Response {
- /**
- * The content to return.
- */
- content: string;
-
- /**
- * The type of the content to return.
- */
- content_type: string;
-
- /**
- * The status code to return.
- */
- status_code: number;
- }
- }
- }
-
- export interface RulesetsExecuteRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'execute';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsExecuteRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsExecuteRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The ID of the ruleset to execute.
- */
- id: string;
-
- /**
- * The configuration to use for matched data logging.
- */
- matched_data?: ActionParameters.MatchedData;
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- overrides?: ActionParameters.Overrides;
- }
-
- export namespace ActionParameters {
- /**
- * The configuration to use for matched data logging.
- */
- export interface MatchedData {
- /**
- * The public key to encrypt matched data logs with.
- */
- public_key: string;
- }
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- export interface Overrides {
- /**
- * An action to override all rules with. This option has lower precedence than rule
- * and category overrides.
- */
- action?: string;
-
- /**
- * A list of category-level overrides. This option has the second-highest
- * precedence after rule-level overrides.
- */
- categories?: Array;
-
- /**
- * Whether to enable execution of all rules. This option has lower precedence than
- * rule and category overrides.
- */
- enabled?: boolean;
-
- /**
- * A list of rule-level overrides. This option has the highest precedence.
- */
- rules?: Array;
-
- /**
- * A sensitivity level to set for all rules. This option has lower precedence than
- * rule and category overrides and is only applicable for DDoS phases.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- export namespace Overrides {
- /**
- * A category-level override
- */
- export interface Category {
- /**
- * The name of the category to override.
- */
- category: string;
-
- /**
- * The action to override rules in the category with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of rules in the category.
- */
- enabled?: boolean;
-
- /**
- * The sensitivity level to use for rules in the category.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- /**
- * A rule-level override
- */
- export interface Rule {
- /**
- * The ID of the rule to override.
- */
- id: string;
-
- /**
- * The action to override the rule with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of the rule.
- */
- enabled?: boolean;
-
- /**
- * The score threshold to use for the rule.
- */
- score_threshold?: number;
-
- /**
- * The sensitivity level to use for the rule.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
- }
- }
- }
-
- export interface RulesetsLogRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'log';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: unknown;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export interface RulesetsSkipRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'skip';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsSkipRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsSkipRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * A list of phases to skip the execution of. This option is incompatible with the
- * ruleset and rulesets options.
- */
- phases?: Array<
- | 'ddos_l4'
- | 'ddos_l7'
- | 'http_config_settings'
- | 'http_custom_errors'
- | 'http_log_custom_fields'
- | 'http_ratelimit'
- | 'http_request_cache_settings'
- | 'http_request_dynamic_redirect'
- | 'http_request_firewall_custom'
- | 'http_request_firewall_managed'
- | 'http_request_late_transform'
- | 'http_request_origin'
- | 'http_request_redirect'
- | 'http_request_sanitize'
- | 'http_request_sbfm'
- | 'http_request_select_configuration'
- | 'http_request_transform'
- | 'http_response_compression'
- | 'http_response_firewall_managed'
- | 'http_response_headers_transform'
- | 'magic_transit'
- | 'magic_transit_ids_managed'
- | 'magic_transit_managed'
- >;
-
- /**
- * A list of legacy security products to skip the execution of.
- */
- products?: Array<'bic' | 'hot' | 'rateLimit' | 'securityLevel' | 'uaBlock' | 'waf' | 'zoneLockdown'>;
-
- /**
- * A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- * execution of. This option is incompatible with the ruleset option.
- */
- rules?: Record>;
-
- /**
- * A ruleset to skip the execution of. This option is incompatible with the
- * rulesets, rules and phases options.
- */
- ruleset?: 'current';
-
- /**
- * A list of ruleset IDs to skip the execution of. This option is incompatible with
- * the ruleset and phases options.
- */
- rulesets?: Array;
- }
- }
-}
-
/**
* A ruleset object.
*/
@@ -760,12 +306,7 @@ export interface PhaseGetResponse {
/**
* The list of rules in the ruleset.
*/
- rules: Array<
- | PhaseGetResponse.RulesetsBlockRule
- | PhaseGetResponse.RulesetsExecuteRule
- | PhaseGetResponse.RulesetsLogRule
- | PhaseGetResponse.RulesetsSkipRule
- >;
+ rules: Array;
/**
* The version of the ruleset.
@@ -778,465 +319,11 @@ export interface PhaseGetResponse {
description?: string;
}
-export namespace PhaseGetResponse {
- export interface RulesetsBlockRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'block';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsBlockRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsBlockRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- response?: ActionParameters.Response;
- }
-
- export namespace ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- export interface Response {
- /**
- * The content to return.
- */
- content: string;
-
- /**
- * The type of the content to return.
- */
- content_type: string;
-
- /**
- * The status code to return.
- */
- status_code: number;
- }
- }
- }
-
- export interface RulesetsExecuteRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'execute';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsExecuteRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsExecuteRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The ID of the ruleset to execute.
- */
- id: string;
-
- /**
- * The configuration to use for matched data logging.
- */
- matched_data?: ActionParameters.MatchedData;
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- overrides?: ActionParameters.Overrides;
- }
-
- export namespace ActionParameters {
- /**
- * The configuration to use for matched data logging.
- */
- export interface MatchedData {
- /**
- * The public key to encrypt matched data logs with.
- */
- public_key: string;
- }
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- export interface Overrides {
- /**
- * An action to override all rules with. This option has lower precedence than rule
- * and category overrides.
- */
- action?: string;
-
- /**
- * A list of category-level overrides. This option has the second-highest
- * precedence after rule-level overrides.
- */
- categories?: Array;
-
- /**
- * Whether to enable execution of all rules. This option has lower precedence than
- * rule and category overrides.
- */
- enabled?: boolean;
-
- /**
- * A list of rule-level overrides. This option has the highest precedence.
- */
- rules?: Array;
-
- /**
- * A sensitivity level to set for all rules. This option has lower precedence than
- * rule and category overrides and is only applicable for DDoS phases.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- export namespace Overrides {
- /**
- * A category-level override
- */
- export interface Category {
- /**
- * The name of the category to override.
- */
- category: string;
-
- /**
- * The action to override rules in the category with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of rules in the category.
- */
- enabled?: boolean;
-
- /**
- * The sensitivity level to use for rules in the category.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- /**
- * A rule-level override
- */
- export interface Rule {
- /**
- * The ID of the rule to override.
- */
- id: string;
-
- /**
- * The action to override the rule with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of the rule.
- */
- enabled?: boolean;
-
- /**
- * The score threshold to use for the rule.
- */
- score_threshold?: number;
-
- /**
- * The sensitivity level to use for the rule.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
- }
- }
- }
-
- export interface RulesetsLogRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'log';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: unknown;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export interface RulesetsSkipRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'skip';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsSkipRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsSkipRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * A list of phases to skip the execution of. This option is incompatible with the
- * ruleset and rulesets options.
- */
- phases?: Array<
- | 'ddos_l4'
- | 'ddos_l7'
- | 'http_config_settings'
- | 'http_custom_errors'
- | 'http_log_custom_fields'
- | 'http_ratelimit'
- | 'http_request_cache_settings'
- | 'http_request_dynamic_redirect'
- | 'http_request_firewall_custom'
- | 'http_request_firewall_managed'
- | 'http_request_late_transform'
- | 'http_request_origin'
- | 'http_request_redirect'
- | 'http_request_sanitize'
- | 'http_request_sbfm'
- | 'http_request_select_configuration'
- | 'http_request_transform'
- | 'http_response_compression'
- | 'http_response_firewall_managed'
- | 'http_response_headers_transform'
- | 'magic_transit'
- | 'magic_transit_ids_managed'
- | 'magic_transit_managed'
- >;
-
- /**
- * A list of legacy security products to skip the execution of.
- */
- products?: Array<'bic' | 'hot' | 'rateLimit' | 'securityLevel' | 'uaBlock' | 'waf' | 'zoneLockdown'>;
-
- /**
- * A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- * execution of. This option is incompatible with the ruleset option.
- */
- rules?: Record>;
-
- /**
- * A ruleset to skip the execution of. This option is incompatible with the
- * rulesets, rules and phases options.
- */
- ruleset?: 'current';
-
- /**
- * A list of ruleset IDs to skip the execution of. This option is incompatible with
- * the ruleset and phases options.
- */
- rulesets?: Array;
- }
- }
-}
-
export interface PhaseUpdateParams {
/**
* Body param: The list of rules in the ruleset.
*/
- rules: Array<
- | PhaseUpdateParams.RulesetsBlockRule
- | PhaseUpdateParams.RulesetsExecuteRule
- | PhaseUpdateParams.RulesetsLogRule
- | PhaseUpdateParams.RulesetsSkipRule
- >;
+ rules: Array;
/**
* Path param: The Account ID to use for this endpoint. Mutually exclusive with the
@@ -1294,395 +381,6 @@ export interface PhaseUpdateParams {
| 'magic_transit_managed';
}
-export namespace PhaseUpdateParams {
- export interface RulesetsBlockRule {
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'block';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsBlockRule.ActionParameters;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsBlockRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- response?: ActionParameters.Response;
- }
-
- export namespace ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- export interface Response {
- /**
- * The content to return.
- */
- content: string;
-
- /**
- * The type of the content to return.
- */
- content_type: string;
-
- /**
- * The status code to return.
- */
- status_code: number;
- }
- }
- }
-
- export interface RulesetsExecuteRule {
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'execute';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsExecuteRule.ActionParameters;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsExecuteRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The ID of the ruleset to execute.
- */
- id: string;
-
- /**
- * The configuration to use for matched data logging.
- */
- matched_data?: ActionParameters.MatchedData;
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- overrides?: ActionParameters.Overrides;
- }
-
- export namespace ActionParameters {
- /**
- * The configuration to use for matched data logging.
- */
- export interface MatchedData {
- /**
- * The public key to encrypt matched data logs with.
- */
- public_key: string;
- }
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- export interface Overrides {
- /**
- * An action to override all rules with. This option has lower precedence than rule
- * and category overrides.
- */
- action?: string;
-
- /**
- * A list of category-level overrides. This option has the second-highest
- * precedence after rule-level overrides.
- */
- categories?: Array;
-
- /**
- * Whether to enable execution of all rules. This option has lower precedence than
- * rule and category overrides.
- */
- enabled?: boolean;
-
- /**
- * A list of rule-level overrides. This option has the highest precedence.
- */
- rules?: Array;
-
- /**
- * A sensitivity level to set for all rules. This option has lower precedence than
- * rule and category overrides and is only applicable for DDoS phases.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- export namespace Overrides {
- /**
- * A category-level override
- */
- export interface Category {
- /**
- * The name of the category to override.
- */
- category: string;
-
- /**
- * The action to override rules in the category with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of rules in the category.
- */
- enabled?: boolean;
-
- /**
- * The sensitivity level to use for rules in the category.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- /**
- * A rule-level override
- */
- export interface Rule {
- /**
- * The ID of the rule to override.
- */
- id: string;
-
- /**
- * The action to override the rule with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of the rule.
- */
- enabled?: boolean;
-
- /**
- * The score threshold to use for the rule.
- */
- score_threshold?: number;
-
- /**
- * The sensitivity level to use for the rule.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
- }
- }
- }
-
- export interface RulesetsLogRule {
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'log';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: unknown;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export interface RulesetsSkipRule {
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'skip';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsSkipRule.ActionParameters;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsSkipRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * A list of phases to skip the execution of. This option is incompatible with the
- * ruleset and rulesets options.
- */
- phases?: Array<
- | 'ddos_l4'
- | 'ddos_l7'
- | 'http_config_settings'
- | 'http_custom_errors'
- | 'http_log_custom_fields'
- | 'http_ratelimit'
- | 'http_request_cache_settings'
- | 'http_request_dynamic_redirect'
- | 'http_request_firewall_custom'
- | 'http_request_firewall_managed'
- | 'http_request_late_transform'
- | 'http_request_origin'
- | 'http_request_redirect'
- | 'http_request_sanitize'
- | 'http_request_sbfm'
- | 'http_request_select_configuration'
- | 'http_request_transform'
- | 'http_response_compression'
- | 'http_response_firewall_managed'
- | 'http_response_headers_transform'
- | 'magic_transit'
- | 'magic_transit_ids_managed'
- | 'magic_transit_managed'
- >;
-
- /**
- * A list of legacy security products to skip the execution of.
- */
- products?: Array<'bic' | 'hot' | 'rateLimit' | 'securityLevel' | 'uaBlock' | 'waf' | 'zoneLockdown'>;
-
- /**
- * A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- * execution of. This option is incompatible with the ruleset option.
- */
- rules?: Record>;
-
- /**
- * A ruleset to skip the execution of. This option is incompatible with the
- * rulesets, rules and phases options.
- */
- ruleset?: 'current';
-
- /**
- * A list of ruleset IDs to skip the execution of. This option is incompatible with
- * the ruleset and phases options.
- */
- rulesets?: Array;
- }
- }
-}
-
export interface PhaseGetParams {
/**
* The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
diff --git a/src/resources/rulesets/phases/versions.ts b/src/resources/rulesets/phases/versions.ts
index cb0fa7dd06..057a5aca40 100644
--- a/src/resources/rulesets/phases/versions.ts
+++ b/src/resources/rulesets/phases/versions.ts
@@ -5,7 +5,6 @@ import { APIResource } from 'cloudflare/resource';
import { isRequestOptions } from 'cloudflare/core';
import { CloudflareError } from 'cloudflare/error';
import * as VersionsAPI from 'cloudflare/resources/rulesets/phases/versions';
-import * as Shared from 'cloudflare/resources/shared';
import * as RulesetsAPI from 'cloudflare/resources/rulesets/rulesets';
import { RulesetsSinglePage } from 'cloudflare/resources/rulesets/rulesets';
@@ -296,12 +295,7 @@ export interface VersionGetResponse {
/**
* The list of rules in the ruleset.
*/
- rules: Array<
- | VersionGetResponse.RulesetsBlockRule
- | VersionGetResponse.RulesetsExecuteRule
- | VersionGetResponse.RulesetsLogRule
- | VersionGetResponse.RulesetsSkipRule
- >;
+ rules: Array;
/**
* The version of the ruleset.
@@ -314,455 +308,6 @@ export interface VersionGetResponse {
description?: string;
}
-export namespace VersionGetResponse {
- export interface RulesetsBlockRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'block';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsBlockRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsBlockRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- response?: ActionParameters.Response;
- }
-
- export namespace ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- export interface Response {
- /**
- * The content to return.
- */
- content: string;
-
- /**
- * The type of the content to return.
- */
- content_type: string;
-
- /**
- * The status code to return.
- */
- status_code: number;
- }
- }
- }
-
- export interface RulesetsExecuteRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'execute';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsExecuteRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsExecuteRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The ID of the ruleset to execute.
- */
- id: string;
-
- /**
- * The configuration to use for matched data logging.
- */
- matched_data?: ActionParameters.MatchedData;
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- overrides?: ActionParameters.Overrides;
- }
-
- export namespace ActionParameters {
- /**
- * The configuration to use for matched data logging.
- */
- export interface MatchedData {
- /**
- * The public key to encrypt matched data logs with.
- */
- public_key: string;
- }
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- export interface Overrides {
- /**
- * An action to override all rules with. This option has lower precedence than rule
- * and category overrides.
- */
- action?: string;
-
- /**
- * A list of category-level overrides. This option has the second-highest
- * precedence after rule-level overrides.
- */
- categories?: Array;
-
- /**
- * Whether to enable execution of all rules. This option has lower precedence than
- * rule and category overrides.
- */
- enabled?: boolean;
-
- /**
- * A list of rule-level overrides. This option has the highest precedence.
- */
- rules?: Array;
-
- /**
- * A sensitivity level to set for all rules. This option has lower precedence than
- * rule and category overrides and is only applicable for DDoS phases.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- export namespace Overrides {
- /**
- * A category-level override
- */
- export interface Category {
- /**
- * The name of the category to override.
- */
- category: string;
-
- /**
- * The action to override rules in the category with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of rules in the category.
- */
- enabled?: boolean;
-
- /**
- * The sensitivity level to use for rules in the category.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- /**
- * A rule-level override
- */
- export interface Rule {
- /**
- * The ID of the rule to override.
- */
- id: string;
-
- /**
- * The action to override the rule with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of the rule.
- */
- enabled?: boolean;
-
- /**
- * The score threshold to use for the rule.
- */
- score_threshold?: number;
-
- /**
- * The sensitivity level to use for the rule.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
- }
- }
- }
-
- export interface RulesetsLogRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'log';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: unknown;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export interface RulesetsSkipRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'skip';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsSkipRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsSkipRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * A list of phases to skip the execution of. This option is incompatible with the
- * ruleset and rulesets options.
- */
- phases?: Array<
- | 'ddos_l4'
- | 'ddos_l7'
- | 'http_config_settings'
- | 'http_custom_errors'
- | 'http_log_custom_fields'
- | 'http_ratelimit'
- | 'http_request_cache_settings'
- | 'http_request_dynamic_redirect'
- | 'http_request_firewall_custom'
- | 'http_request_firewall_managed'
- | 'http_request_late_transform'
- | 'http_request_origin'
- | 'http_request_redirect'
- | 'http_request_sanitize'
- | 'http_request_sbfm'
- | 'http_request_select_configuration'
- | 'http_request_transform'
- | 'http_response_compression'
- | 'http_response_firewall_managed'
- | 'http_response_headers_transform'
- | 'magic_transit'
- | 'magic_transit_ids_managed'
- | 'magic_transit_managed'
- >;
-
- /**
- * A list of legacy security products to skip the execution of.
- */
- products?: Array<'bic' | 'hot' | 'rateLimit' | 'securityLevel' | 'uaBlock' | 'waf' | 'zoneLockdown'>;
-
- /**
- * A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- * execution of. This option is incompatible with the ruleset option.
- */
- rules?: Record>;
-
- /**
- * A ruleset to skip the execution of. This option is incompatible with the
- * rulesets, rules and phases options.
- */
- ruleset?: 'current';
-
- /**
- * A list of ruleset IDs to skip the execution of. This option is incompatible with
- * the ruleset and phases options.
- */
- rulesets?: Array;
- }
- }
-}
-
export interface VersionListParams {
/**
* The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
diff --git a/src/resources/rulesets/rules.ts b/src/resources/rulesets/rules.ts
index ced9bb7006..d3f7be73b5 100644
--- a/src/resources/rulesets/rules.ts
+++ b/src/resources/rulesets/rules.ts
@@ -6,6 +6,7 @@ import { isRequestOptions } from 'cloudflare/core';
import { CloudflareError } from 'cloudflare/error';
import * as RulesAPI from 'cloudflare/resources/rulesets/rules';
import * as Shared from 'cloudflare/resources/shared';
+import * as RulesetsAPI from 'cloudflare/resources/rulesets/rulesets';
export class Rules extends APIResource {
/**
@@ -180,12 +181,7 @@ export interface RuleCreateResponse {
/**
* The list of rules in the ruleset.
*/
- rules: Array<
- | RuleCreateResponse.RulesetsBlockRule
- | RuleCreateResponse.RulesetsExecuteRule
- | RuleCreateResponse.RulesetsLogRule
- | RuleCreateResponse.RulesetsSkipRule
- >;
+ rules: Array;
/**
* The version of the ruleset.
@@ -198,1507 +194,150 @@ export interface RuleCreateResponse {
description?: string;
}
-export namespace RuleCreateResponse {
- export interface RulesetsBlockRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'block';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsBlockRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsBlockRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- response?: ActionParameters.Response;
- }
-
- export namespace ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- export interface Response {
- /**
- * The content to return.
- */
- content: string;
-
- /**
- * The type of the content to return.
- */
- content_type: string;
-
- /**
- * The status code to return.
- */
- status_code: number;
- }
- }
- }
-
- export interface RulesetsExecuteRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'execute';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsExecuteRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsExecuteRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The ID of the ruleset to execute.
- */
- id: string;
-
- /**
- * The configuration to use for matched data logging.
- */
- matched_data?: ActionParameters.MatchedData;
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- overrides?: ActionParameters.Overrides;
- }
-
- export namespace ActionParameters {
- /**
- * The configuration to use for matched data logging.
- */
- export interface MatchedData {
- /**
- * The public key to encrypt matched data logs with.
- */
- public_key: string;
- }
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- export interface Overrides {
- /**
- * An action to override all rules with. This option has lower precedence than rule
- * and category overrides.
- */
- action?: string;
-
- /**
- * A list of category-level overrides. This option has the second-highest
- * precedence after rule-level overrides.
- */
- categories?: Array;
-
- /**
- * Whether to enable execution of all rules. This option has lower precedence than
- * rule and category overrides.
- */
- enabled?: boolean;
-
- /**
- * A list of rule-level overrides. This option has the highest precedence.
- */
- rules?: Array;
-
- /**
- * A sensitivity level to set for all rules. This option has lower precedence than
- * rule and category overrides and is only applicable for DDoS phases.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- export namespace Overrides {
- /**
- * A category-level override
- */
- export interface Category {
- /**
- * The name of the category to override.
- */
- category: string;
-
- /**
- * The action to override rules in the category with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of rules in the category.
- */
- enabled?: boolean;
-
- /**
- * The sensitivity level to use for rules in the category.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- /**
- * A rule-level override
- */
- export interface Rule {
- /**
- * The ID of the rule to override.
- */
- id: string;
-
- /**
- * The action to override the rule with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of the rule.
- */
- enabled?: boolean;
-
- /**
- * The score threshold to use for the rule.
- */
- score_threshold?: number;
-
- /**
- * The sensitivity level to use for the rule.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
- }
- }
- }
-
- export interface RulesetsLogRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'log';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: unknown;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export interface RulesetsSkipRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'skip';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsSkipRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsSkipRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * A list of phases to skip the execution of. This option is incompatible with the
- * ruleset and rulesets options.
- */
- phases?: Array<
- | 'ddos_l4'
- | 'ddos_l7'
- | 'http_config_settings'
- | 'http_custom_errors'
- | 'http_log_custom_fields'
- | 'http_ratelimit'
- | 'http_request_cache_settings'
- | 'http_request_dynamic_redirect'
- | 'http_request_firewall_custom'
- | 'http_request_firewall_managed'
- | 'http_request_late_transform'
- | 'http_request_origin'
- | 'http_request_redirect'
- | 'http_request_sanitize'
- | 'http_request_sbfm'
- | 'http_request_select_configuration'
- | 'http_request_transform'
- | 'http_response_compression'
- | 'http_response_firewall_managed'
- | 'http_response_headers_transform'
- | 'magic_transit'
- | 'magic_transit_ids_managed'
- | 'magic_transit_managed'
- >;
-
- /**
- * A list of legacy security products to skip the execution of.
- */
- products?: Array<'bic' | 'hot' | 'rateLimit' | 'securityLevel' | 'uaBlock' | 'waf' | 'zoneLockdown'>;
-
- /**
- * A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- * execution of. This option is incompatible with the ruleset option.
- */
- rules?: Record>;
-
- /**
- * A ruleset to skip the execution of. This option is incompatible with the
- * rulesets, rules and phases options.
- */
- ruleset?: 'current';
-
- /**
- * A list of ruleset IDs to skip the execution of. This option is incompatible with
- * the ruleset and phases options.
- */
- rulesets?: Array;
- }
- }
-}
-
-/**
- * A ruleset object.
- */
-export interface RuleDeleteResponse {
- /**
- * The unique ID of the ruleset.
- */
- id: string;
-
- /**
- * The kind of the ruleset.
- */
- kind: 'managed' | 'custom' | 'root' | 'zone';
-
- /**
- * The timestamp of when the ruleset was last modified.
- */
- last_updated: string;
-
- /**
- * The human-readable name of the ruleset.
- */
- name: string;
-
- /**
- * The phase of the ruleset.
- */
- phase:
- | 'ddos_l4'
- | 'ddos_l7'
- | 'http_config_settings'
- | 'http_custom_errors'
- | 'http_log_custom_fields'
- | 'http_ratelimit'
- | 'http_request_cache_settings'
- | 'http_request_dynamic_redirect'
- | 'http_request_firewall_custom'
- | 'http_request_firewall_managed'
- | 'http_request_late_transform'
- | 'http_request_origin'
- | 'http_request_redirect'
- | 'http_request_sanitize'
- | 'http_request_sbfm'
- | 'http_request_select_configuration'
- | 'http_request_transform'
- | 'http_response_compression'
- | 'http_response_firewall_managed'
- | 'http_response_headers_transform'
- | 'magic_transit'
- | 'magic_transit_ids_managed'
- | 'magic_transit_managed';
-
- /**
- * The list of rules in the ruleset.
- */
- rules: Array<
- | RuleDeleteResponse.RulesetsBlockRule
- | RuleDeleteResponse.RulesetsExecuteRule
- | RuleDeleteResponse.RulesetsLogRule
- | RuleDeleteResponse.RulesetsSkipRule
- >;
-
- /**
- * The version of the ruleset.
- */
- version: string;
-
- /**
- * An informative description of the ruleset.
- */
- description?: string;
-}
-
-export namespace RuleDeleteResponse {
- export interface RulesetsBlockRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'block';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsBlockRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsBlockRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- response?: ActionParameters.Response;
- }
-
- export namespace ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- export interface Response {
- /**
- * The content to return.
- */
- content: string;
-
- /**
- * The type of the content to return.
- */
- content_type: string;
-
- /**
- * The status code to return.
- */
- status_code: number;
- }
- }
- }
-
- export interface RulesetsExecuteRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'execute';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsExecuteRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsExecuteRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The ID of the ruleset to execute.
- */
- id: string;
-
- /**
- * The configuration to use for matched data logging.
- */
- matched_data?: ActionParameters.MatchedData;
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- overrides?: ActionParameters.Overrides;
- }
-
- export namespace ActionParameters {
- /**
- * The configuration to use for matched data logging.
- */
- export interface MatchedData {
- /**
- * The public key to encrypt matched data logs with.
- */
- public_key: string;
- }
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- export interface Overrides {
- /**
- * An action to override all rules with. This option has lower precedence than rule
- * and category overrides.
- */
- action?: string;
-
- /**
- * A list of category-level overrides. This option has the second-highest
- * precedence after rule-level overrides.
- */
- categories?: Array;
-
- /**
- * Whether to enable execution of all rules. This option has lower precedence than
- * rule and category overrides.
- */
- enabled?: boolean;
-
- /**
- * A list of rule-level overrides. This option has the highest precedence.
- */
- rules?: Array;
-
- /**
- * A sensitivity level to set for all rules. This option has lower precedence than
- * rule and category overrides and is only applicable for DDoS phases.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- export namespace Overrides {
- /**
- * A category-level override
- */
- export interface Category {
- /**
- * The name of the category to override.
- */
- category: string;
-
- /**
- * The action to override rules in the category with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of rules in the category.
- */
- enabled?: boolean;
-
- /**
- * The sensitivity level to use for rules in the category.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- /**
- * A rule-level override
- */
- export interface Rule {
- /**
- * The ID of the rule to override.
- */
- id: string;
-
- /**
- * The action to override the rule with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of the rule.
- */
- enabled?: boolean;
-
- /**
- * The score threshold to use for the rule.
- */
- score_threshold?: number;
-
- /**
- * The sensitivity level to use for the rule.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
- }
- }
- }
-
- export interface RulesetsLogRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'log';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: unknown;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export interface RulesetsSkipRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'skip';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsSkipRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsSkipRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * A list of phases to skip the execution of. This option is incompatible with the
- * ruleset and rulesets options.
- */
- phases?: Array<
- | 'ddos_l4'
- | 'ddos_l7'
- | 'http_config_settings'
- | 'http_custom_errors'
- | 'http_log_custom_fields'
- | 'http_ratelimit'
- | 'http_request_cache_settings'
- | 'http_request_dynamic_redirect'
- | 'http_request_firewall_custom'
- | 'http_request_firewall_managed'
- | 'http_request_late_transform'
- | 'http_request_origin'
- | 'http_request_redirect'
- | 'http_request_sanitize'
- | 'http_request_sbfm'
- | 'http_request_select_configuration'
- | 'http_request_transform'
- | 'http_response_compression'
- | 'http_response_firewall_managed'
- | 'http_response_headers_transform'
- | 'magic_transit'
- | 'magic_transit_ids_managed'
- | 'magic_transit_managed'
- >;
-
- /**
- * A list of legacy security products to skip the execution of.
- */
- products?: Array<'bic' | 'hot' | 'rateLimit' | 'securityLevel' | 'uaBlock' | 'waf' | 'zoneLockdown'>;
-
- /**
- * A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- * execution of. This option is incompatible with the ruleset option.
- */
- rules?: Record>;
-
- /**
- * A ruleset to skip the execution of. This option is incompatible with the
- * rulesets, rules and phases options.
- */
- ruleset?: 'current';
-
- /**
- * A list of ruleset IDs to skip the execution of. This option is incompatible with
- * the ruleset and phases options.
- */
- rulesets?: Array;
- }
- }
-}
-
-/**
- * A ruleset object.
- */
-export interface RuleEditResponse {
- /**
- * The unique ID of the ruleset.
- */
- id: string;
-
- /**
- * The kind of the ruleset.
- */
- kind: 'managed' | 'custom' | 'root' | 'zone';
-
- /**
- * The timestamp of when the ruleset was last modified.
- */
- last_updated: string;
-
- /**
- * The human-readable name of the ruleset.
- */
- name: string;
-
- /**
- * The phase of the ruleset.
- */
- phase:
- | 'ddos_l4'
- | 'ddos_l7'
- | 'http_config_settings'
- | 'http_custom_errors'
- | 'http_log_custom_fields'
- | 'http_ratelimit'
- | 'http_request_cache_settings'
- | 'http_request_dynamic_redirect'
- | 'http_request_firewall_custom'
- | 'http_request_firewall_managed'
- | 'http_request_late_transform'
- | 'http_request_origin'
- | 'http_request_redirect'
- | 'http_request_sanitize'
- | 'http_request_sbfm'
- | 'http_request_select_configuration'
- | 'http_request_transform'
- | 'http_response_compression'
- | 'http_response_firewall_managed'
- | 'http_response_headers_transform'
- | 'magic_transit'
- | 'magic_transit_ids_managed'
- | 'magic_transit_managed';
-
- /**
- * The list of rules in the ruleset.
- */
- rules: Array<
- | RuleEditResponse.RulesetsBlockRule
- | RuleEditResponse.RulesetsExecuteRule
- | RuleEditResponse.RulesetsLogRule
- | RuleEditResponse.RulesetsSkipRule
- >;
-
- /**
- * The version of the ruleset.
- */
- version: string;
-
- /**
- * An informative description of the ruleset.
- */
- description?: string;
-}
-
-export namespace RuleEditResponse {
- export interface RulesetsBlockRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'block';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsBlockRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsBlockRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- response?: ActionParameters.Response;
- }
-
- export namespace ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- export interface Response {
- /**
- * The content to return.
- */
- content: string;
-
- /**
- * The type of the content to return.
- */
- content_type: string;
-
- /**
- * The status code to return.
- */
- status_code: number;
- }
- }
- }
-
- export interface RulesetsExecuteRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'execute';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsExecuteRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsExecuteRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The ID of the ruleset to execute.
- */
- id: string;
-
- /**
- * The configuration to use for matched data logging.
- */
- matched_data?: ActionParameters.MatchedData;
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- overrides?: ActionParameters.Overrides;
- }
-
- export namespace ActionParameters {
- /**
- * The configuration to use for matched data logging.
- */
- export interface MatchedData {
- /**
- * The public key to encrypt matched data logs with.
- */
- public_key: string;
- }
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- export interface Overrides {
- /**
- * An action to override all rules with. This option has lower precedence than rule
- * and category overrides.
- */
- action?: string;
-
- /**
- * A list of category-level overrides. This option has the second-highest
- * precedence after rule-level overrides.
- */
- categories?: Array;
-
- /**
- * Whether to enable execution of all rules. This option has lower precedence than
- * rule and category overrides.
- */
- enabled?: boolean;
-
- /**
- * A list of rule-level overrides. This option has the highest precedence.
- */
- rules?: Array;
-
- /**
- * A sensitivity level to set for all rules. This option has lower precedence than
- * rule and category overrides and is only applicable for DDoS phases.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- export namespace Overrides {
- /**
- * A category-level override
- */
- export interface Category {
- /**
- * The name of the category to override.
- */
- category: string;
-
- /**
- * The action to override rules in the category with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of rules in the category.
- */
- enabled?: boolean;
-
- /**
- * The sensitivity level to use for rules in the category.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- /**
- * A rule-level override
- */
- export interface Rule {
- /**
- * The ID of the rule to override.
- */
- id: string;
-
- /**
- * The action to override the rule with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of the rule.
- */
- enabled?: boolean;
-
- /**
- * The score threshold to use for the rule.
- */
- score_threshold?: number;
-
- /**
- * The sensitivity level to use for the rule.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
- }
- }
- }
-
- export interface RulesetsLogRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'log';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: unknown;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export interface RulesetsSkipRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
+/**
+ * A ruleset object.
+ */
+export interface RuleDeleteResponse {
+ /**
+ * The unique ID of the ruleset.
+ */
+ id: string;
- /**
- * The version of the rule.
- */
- version: string;
+ /**
+ * The kind of the ruleset.
+ */
+ kind: 'managed' | 'custom' | 'root' | 'zone';
- /**
- * The unique ID of the rule.
- */
- id?: string;
+ /**
+ * The timestamp of when the ruleset was last modified.
+ */
+ last_updated: string;
- /**
- * The action to perform when the rule matches.
- */
- action?: 'skip';
+ /**
+ * The human-readable name of the ruleset.
+ */
+ name: string;
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsSkipRule.ActionParameters;
+ /**
+ * The phase of the ruleset.
+ */
+ phase:
+ | 'ddos_l4'
+ | 'ddos_l7'
+ | 'http_config_settings'
+ | 'http_custom_errors'
+ | 'http_log_custom_fields'
+ | 'http_ratelimit'
+ | 'http_request_cache_settings'
+ | 'http_request_dynamic_redirect'
+ | 'http_request_firewall_custom'
+ | 'http_request_firewall_managed'
+ | 'http_request_late_transform'
+ | 'http_request_origin'
+ | 'http_request_redirect'
+ | 'http_request_sanitize'
+ | 'http_request_sbfm'
+ | 'http_request_select_configuration'
+ | 'http_request_transform'
+ | 'http_response_compression'
+ | 'http_response_firewall_managed'
+ | 'http_response_headers_transform'
+ | 'magic_transit'
+ | 'magic_transit_ids_managed'
+ | 'magic_transit_managed';
- /**
- * The categories of the rule.
- */
- categories?: Array;
+ /**
+ * The list of rules in the ruleset.
+ */
+ rules: Array;
- /**
- * An informative description of the rule.
- */
- description?: string;
+ /**
+ * The version of the ruleset.
+ */
+ version: string;
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
+ /**
+ * An informative description of the ruleset.
+ */
+ description?: string;
+}
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
+/**
+ * A ruleset object.
+ */
+export interface RuleEditResponse {
+ /**
+ * The unique ID of the ruleset.
+ */
+ id: string;
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
+ /**
+ * The kind of the ruleset.
+ */
+ kind: 'managed' | 'custom' | 'root' | 'zone';
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
+ /**
+ * The timestamp of when the ruleset was last modified.
+ */
+ last_updated: string;
- export namespace RulesetsSkipRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * A list of phases to skip the execution of. This option is incompatible with the
- * ruleset and rulesets options.
- */
- phases?: Array<
- | 'ddos_l4'
- | 'ddos_l7'
- | 'http_config_settings'
- | 'http_custom_errors'
- | 'http_log_custom_fields'
- | 'http_ratelimit'
- | 'http_request_cache_settings'
- | 'http_request_dynamic_redirect'
- | 'http_request_firewall_custom'
- | 'http_request_firewall_managed'
- | 'http_request_late_transform'
- | 'http_request_origin'
- | 'http_request_redirect'
- | 'http_request_sanitize'
- | 'http_request_sbfm'
- | 'http_request_select_configuration'
- | 'http_request_transform'
- | 'http_response_compression'
- | 'http_response_firewall_managed'
- | 'http_response_headers_transform'
- | 'magic_transit'
- | 'magic_transit_ids_managed'
- | 'magic_transit_managed'
- >;
+ /**
+ * The human-readable name of the ruleset.
+ */
+ name: string;
- /**
- * A list of legacy security products to skip the execution of.
- */
- products?: Array<'bic' | 'hot' | 'rateLimit' | 'securityLevel' | 'uaBlock' | 'waf' | 'zoneLockdown'>;
+ /**
+ * The phase of the ruleset.
+ */
+ phase:
+ | 'ddos_l4'
+ | 'ddos_l7'
+ | 'http_config_settings'
+ | 'http_custom_errors'
+ | 'http_log_custom_fields'
+ | 'http_ratelimit'
+ | 'http_request_cache_settings'
+ | 'http_request_dynamic_redirect'
+ | 'http_request_firewall_custom'
+ | 'http_request_firewall_managed'
+ | 'http_request_late_transform'
+ | 'http_request_origin'
+ | 'http_request_redirect'
+ | 'http_request_sanitize'
+ | 'http_request_sbfm'
+ | 'http_request_select_configuration'
+ | 'http_request_transform'
+ | 'http_response_compression'
+ | 'http_response_firewall_managed'
+ | 'http_response_headers_transform'
+ | 'magic_transit'
+ | 'magic_transit_ids_managed'
+ | 'magic_transit_managed';
- /**
- * A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- * execution of. This option is incompatible with the ruleset option.
- */
- rules?: Record>;
+ /**
+ * The list of rules in the ruleset.
+ */
+ rules: Array;
- /**
- * A ruleset to skip the execution of. This option is incompatible with the
- * rulesets, rules and phases options.
- */
- ruleset?: 'current';
+ /**
+ * The version of the ruleset.
+ */
+ version: string;
- /**
- * A list of ruleset IDs to skip the execution of. This option is incompatible with
- * the ruleset and phases options.
- */
- rulesets?: Array;
- }
- }
+ /**
+ * An informative description of the ruleset.
+ */
+ description?: string;
}
export type RuleCreateParams =
- | RuleCreateParams.RulesetsBlockRule
- | RuleCreateParams.RulesetsExecuteRule
- | RuleCreateParams.RulesetsLogRule
- | RuleCreateParams.RulesetsSkipRule;
+ | RuleCreateParams.BlockRule
+ | RuleCreateParams.ExecuteRule
+ | RuleCreateParams.LogRule
+ | RuleCreateParams.SkipRule;
export namespace RuleCreateParams {
- export interface RulesetsBlockRule {
+ export interface BlockRule {
/**
* Path param: The Account ID to use for this endpoint. Mutually exclusive with the
* Zone ID.
@@ -1724,7 +363,7 @@ export namespace RuleCreateParams {
/**
* Body param: The parameters configuring the rule's action.
*/
- action_parameters?: RuleCreateParams.RulesetsBlockRule.ActionParameters;
+ action_parameters?: RuleCreateParams.BlockRule.ActionParameters;
/**
* Body param: An informative description of the rule.
@@ -1752,7 +391,7 @@ export namespace RuleCreateParams {
ref?: string;
}
- export namespace RulesetsBlockRule {
+ export namespace BlockRule {
/**
* The parameters configuring the rule's action.
*/
@@ -1786,7 +425,7 @@ export namespace RuleCreateParams {
}
}
- export interface RulesetsExecuteRule {
+ export interface ExecuteRule {
/**
* Path param: The Account ID to use for this endpoint. Mutually exclusive with the
* Zone ID.
@@ -1812,7 +451,7 @@ export namespace RuleCreateParams {
/**
* Body param: The parameters configuring the rule's action.
*/
- action_parameters?: RuleCreateParams.RulesetsExecuteRule.ActionParameters;
+ action_parameters?: RuleCreateParams.ExecuteRule.ActionParameters;
/**
* Body param: An informative description of the rule.
@@ -1840,7 +479,7 @@ export namespace RuleCreateParams {
ref?: string;
}
- export namespace RulesetsExecuteRule {
+ export namespace ExecuteRule {
/**
* The parameters configuring the rule's action.
*/
@@ -1965,7 +604,7 @@ export namespace RuleCreateParams {
}
}
- export interface RulesetsLogRule {
+ export interface LogRule {
/**
* Path param: The Account ID to use for this endpoint. Mutually exclusive with the
* Zone ID.
@@ -2019,7 +658,7 @@ export namespace RuleCreateParams {
ref?: string;
}
- export interface RulesetsSkipRule {
+ export interface SkipRule {
/**
* Path param: The Account ID to use for this endpoint. Mutually exclusive with the
* Zone ID.
@@ -2045,7 +684,7 @@ export namespace RuleCreateParams {
/**
* Body param: The parameters configuring the rule's action.
*/
- action_parameters?: RuleCreateParams.RulesetsSkipRule.ActionParameters;
+ action_parameters?: RuleCreateParams.SkipRule.ActionParameters;
/**
* Body param: An informative description of the rule.
@@ -2073,7 +712,7 @@ export namespace RuleCreateParams {
ref?: string;
}
- export namespace RulesetsSkipRule {
+ export namespace SkipRule {
/**
* The parameters configuring the rule's action.
*/
@@ -2147,13 +786,13 @@ export interface RuleDeleteParams {
}
export type RuleEditParams =
- | RuleEditParams.RulesetsBlockRule
- | RuleEditParams.RulesetsExecuteRule
- | RuleEditParams.RulesetsLogRule
- | RuleEditParams.RulesetsSkipRule;
+ | RuleEditParams.BlockRule
+ | RuleEditParams.ExecuteRule
+ | RuleEditParams.LogRule
+ | RuleEditParams.SkipRule;
export namespace RuleEditParams {
- export interface RulesetsBlockRule {
+ export interface BlockRule {
/**
* Path param: The Account ID to use for this endpoint. Mutually exclusive with the
* Zone ID.
@@ -2179,7 +818,7 @@ export namespace RuleEditParams {
/**
* Body param: The parameters configuring the rule's action.
*/
- action_parameters?: RuleEditParams.RulesetsBlockRule.ActionParameters;
+ action_parameters?: RuleEditParams.BlockRule.ActionParameters;
/**
* Body param: An informative description of the rule.
@@ -2207,7 +846,7 @@ export namespace RuleEditParams {
ref?: string;
}
- export namespace RulesetsBlockRule {
+ export namespace BlockRule {
/**
* The parameters configuring the rule's action.
*/
@@ -2241,7 +880,7 @@ export namespace RuleEditParams {
}
}
- export interface RulesetsExecuteRule {
+ export interface ExecuteRule {
/**
* Path param: The Account ID to use for this endpoint. Mutually exclusive with the
* Zone ID.
@@ -2267,7 +906,7 @@ export namespace RuleEditParams {
/**
* Body param: The parameters configuring the rule's action.
*/
- action_parameters?: RuleEditParams.RulesetsExecuteRule.ActionParameters;
+ action_parameters?: RuleEditParams.ExecuteRule.ActionParameters;
/**
* Body param: An informative description of the rule.
@@ -2295,7 +934,7 @@ export namespace RuleEditParams {
ref?: string;
}
- export namespace RulesetsExecuteRule {
+ export namespace ExecuteRule {
/**
* The parameters configuring the rule's action.
*/
@@ -2420,7 +1059,7 @@ export namespace RuleEditParams {
}
}
- export interface RulesetsLogRule {
+ export interface LogRule {
/**
* Path param: The Account ID to use for this endpoint. Mutually exclusive with the
* Zone ID.
@@ -2474,7 +1113,7 @@ export namespace RuleEditParams {
ref?: string;
}
- export interface RulesetsSkipRule {
+ export interface SkipRule {
/**
* Path param: The Account ID to use for this endpoint. Mutually exclusive with the
* Zone ID.
@@ -2500,7 +1139,7 @@ export namespace RuleEditParams {
/**
* Body param: The parameters configuring the rule's action.
*/
- action_parameters?: RuleEditParams.RulesetsSkipRule.ActionParameters;
+ action_parameters?: RuleEditParams.SkipRule.ActionParameters;
/**
* Body param: An informative description of the rule.
@@ -2528,7 +1167,7 @@ export namespace RuleEditParams {
ref?: string;
}
- export namespace RulesetsSkipRule {
+ export namespace SkipRule {
/**
* The parameters configuring the rule's action.
*/
diff --git a/src/resources/rulesets/rulesets.ts b/src/resources/rulesets/rulesets.ts
index c2ce96dffd..73550bf582 100644
--- a/src/resources/rulesets/rulesets.ts
+++ b/src/resources/rulesets/rulesets.ts
@@ -201,595 +201,520 @@ export class Rulesets extends APIResource {
export class RulesetsSinglePage extends SinglePage {}
-/**
- * A ruleset object.
- */
-export interface Ruleset {
+export interface BlockRule {
/**
- * The unique ID of the ruleset.
+ * The timestamp of when the rule was last modified.
*/
- id: string;
+ last_updated: string;
/**
- * The timestamp of when the ruleset was last modified.
+ * The version of the rule.
*/
- last_updated: string;
+ version: string;
/**
- * The version of the ruleset.
+ * The unique ID of the rule.
*/
- version: string;
+ id?: string;
/**
- * An informative description of the ruleset.
+ * The action to perform when the rule matches.
*/
- description?: string;
+ action?: 'block';
/**
- * The kind of the ruleset.
+ * The parameters configuring the rule's action.
*/
- kind?: 'managed' | 'custom' | 'root' | 'zone';
+ action_parameters?: BlockRule.ActionParameters;
/**
- * The human-readable name of the ruleset.
+ * The categories of the rule.
*/
- name?: string;
+ categories?: Array;
/**
- * The phase of the ruleset.
+ * An informative description of the rule.
*/
- phase?:
- | 'ddos_l4'
- | 'ddos_l7'
- | 'http_config_settings'
- | 'http_custom_errors'
- | 'http_log_custom_fields'
- | 'http_ratelimit'
- | 'http_request_cache_settings'
- | 'http_request_dynamic_redirect'
- | 'http_request_firewall_custom'
- | 'http_request_firewall_managed'
- | 'http_request_late_transform'
- | 'http_request_origin'
- | 'http_request_redirect'
- | 'http_request_sanitize'
- | 'http_request_sbfm'
- | 'http_request_select_configuration'
- | 'http_request_transform'
- | 'http_response_compression'
- | 'http_response_firewall_managed'
- | 'http_response_headers_transform'
- | 'magic_transit'
- | 'magic_transit_ids_managed'
- | 'magic_transit_managed';
-}
+ description?: string;
-/**
- * A ruleset object.
- */
-export interface RulesetCreateResponse {
/**
- * The unique ID of the ruleset.
+ * Whether the rule should be executed.
*/
- id: string;
+ enabled?: boolean;
/**
- * The kind of the ruleset.
+ * The expression defining which traffic will match the rule.
*/
- kind: 'managed' | 'custom' | 'root' | 'zone';
+ expression?: string;
/**
- * The timestamp of when the ruleset was last modified.
+ * An object configuring the rule's logging behavior.
*/
- last_updated: string;
+ logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
/**
- * The human-readable name of the ruleset.
+ * The reference of the rule (the rule ID by default).
*/
- name: string;
+ ref?: string;
+}
+export namespace BlockRule {
/**
- * The phase of the ruleset.
+ * The parameters configuring the rule's action.
*/
- phase:
- | 'ddos_l4'
- | 'ddos_l7'
- | 'http_config_settings'
- | 'http_custom_errors'
- | 'http_log_custom_fields'
- | 'http_ratelimit'
- | 'http_request_cache_settings'
- | 'http_request_dynamic_redirect'
- | 'http_request_firewall_custom'
- | 'http_request_firewall_managed'
- | 'http_request_late_transform'
- | 'http_request_origin'
- | 'http_request_redirect'
- | 'http_request_sanitize'
- | 'http_request_sbfm'
- | 'http_request_select_configuration'
- | 'http_request_transform'
- | 'http_response_compression'
- | 'http_response_firewall_managed'
- | 'http_response_headers_transform'
- | 'magic_transit'
- | 'magic_transit_ids_managed'
- | 'magic_transit_managed';
+ export interface ActionParameters {
+ /**
+ * The response to show when the block is applied.
+ */
+ response?: ActionParameters.Response;
+ }
+
+ export namespace ActionParameters {
+ /**
+ * The response to show when the block is applied.
+ */
+ export interface Response {
+ /**
+ * The content to return.
+ */
+ content: string;
+
+ /**
+ * The type of the content to return.
+ */
+ content_type: string;
+
+ /**
+ * The status code to return.
+ */
+ status_code: number;
+ }
+ }
+}
+export interface ExecuteRule {
/**
- * The list of rules in the ruleset.
+ * The timestamp of when the rule was last modified.
*/
- rules: Array<
- | RulesetCreateResponse.RulesetsBlockRule
- | RulesetCreateResponse.RulesetsExecuteRule
- | RulesetCreateResponse.RulesetsLogRule
- | RulesetCreateResponse.RulesetsSkipRule
- >;
+ last_updated: string;
/**
- * The version of the ruleset.
+ * The version of the rule.
*/
version: string;
/**
- * An informative description of the ruleset.
+ * The unique ID of the rule.
*/
- description?: string;
-}
+ id?: string;
-export namespace RulesetCreateResponse {
- export interface RulesetsBlockRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
+ /**
+ * The action to perform when the rule matches.
+ */
+ action?: 'execute';
- /**
- * The version of the rule.
- */
- version: string;
+ /**
+ * The parameters configuring the rule's action.
+ */
+ action_parameters?: ExecuteRule.ActionParameters;
- /**
- * The unique ID of the rule.
- */
- id?: string;
+ /**
+ * The categories of the rule.
+ */
+ categories?: Array;
- /**
- * The action to perform when the rule matches.
- */
- action?: 'block';
+ /**
+ * An informative description of the rule.
+ */
+ description?: string;
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsBlockRule.ActionParameters;
+ /**
+ * Whether the rule should be executed.
+ */
+ enabled?: boolean;
- /**
- * The categories of the rule.
- */
- categories?: Array;
+ /**
+ * The expression defining which traffic will match the rule.
+ */
+ expression?: string;
- /**
- * An informative description of the rule.
- */
- description?: string;
+ /**
+ * An object configuring the rule's logging behavior.
+ */
+ logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
+ /**
+ * The reference of the rule (the rule ID by default).
+ */
+ ref?: string;
+}
+export namespace ExecuteRule {
+ /**
+ * The parameters configuring the rule's action.
+ */
+ export interface ActionParameters {
/**
- * The expression defining which traffic will match the rule.
+ * The ID of the ruleset to execute.
*/
- expression?: string;
+ id: string;
/**
- * An object configuring the rule's logging behavior.
+ * The configuration to use for matched data logging.
*/
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
+ matched_data?: ActionParameters.MatchedData;
/**
- * The reference of the rule (the rule ID by default).
+ * A set of overrides to apply to the target ruleset.
*/
- ref?: string;
+ overrides?: ActionParameters.Overrides;
}
- export namespace RulesetsBlockRule {
+ export namespace ActionParameters {
/**
- * The parameters configuring the rule's action.
+ * The configuration to use for matched data logging.
*/
- export interface ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- response?: ActionParameters.Response;
- }
-
- export namespace ActionParameters {
+ export interface MatchedData {
/**
- * The response to show when the block is applied.
+ * The public key to encrypt matched data logs with.
*/
- export interface Response {
- /**
- * The content to return.
- */
- content: string;
-
- /**
- * The type of the content to return.
- */
- content_type: string;
-
- /**
- * The status code to return.
- */
- status_code: number;
- }
+ public_key: string;
}
- }
-
- export interface RulesetsExecuteRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'execute';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsExecuteRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
/**
- * The expression defining which traffic will match the rule.
+ * A set of overrides to apply to the target ruleset.
*/
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
+ export interface Overrides {
+ /**
+ * An action to override all rules with. This option has lower precedence than rule
+ * and category overrides.
+ */
+ action?: string;
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
+ /**
+ * A list of category-level overrides. This option has the second-highest
+ * precedence after rule-level overrides.
+ */
+ categories?: Array;
- export namespace RulesetsExecuteRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
/**
- * The ID of the ruleset to execute.
+ * Whether to enable execution of all rules. This option has lower precedence than
+ * rule and category overrides.
*/
- id: string;
+ enabled?: boolean;
/**
- * The configuration to use for matched data logging.
+ * A list of rule-level overrides. This option has the highest precedence.
*/
- matched_data?: ActionParameters.MatchedData;
+ rules?: Array;
/**
- * A set of overrides to apply to the target ruleset.
+ * A sensitivity level to set for all rules. This option has lower precedence than
+ * rule and category overrides and is only applicable for DDoS phases.
*/
- overrides?: ActionParameters.Overrides;
+ sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
}
- export namespace ActionParameters {
+ export namespace Overrides {
/**
- * The configuration to use for matched data logging.
+ * A category-level override
*/
- export interface MatchedData {
+ export interface Category {
/**
- * The public key to encrypt matched data logs with.
+ * The name of the category to override.
*/
- public_key: string;
- }
+ category: string;
- /**
- * A set of overrides to apply to the target ruleset.
- */
- export interface Overrides {
/**
- * An action to override all rules with. This option has lower precedence than rule
- * and category overrides.
+ * The action to override rules in the category with.
*/
action?: string;
/**
- * A list of category-level overrides. This option has the second-highest
- * precedence after rule-level overrides.
+ * Whether to enable execution of rules in the category.
*/
- categories?: Array;
+ enabled?: boolean;
/**
- * Whether to enable execution of all rules. This option has lower precedence than
- * rule and category overrides.
+ * The sensitivity level to use for rules in the category.
*/
- enabled?: boolean;
+ sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
+ }
+ /**
+ * A rule-level override
+ */
+ export interface Rule {
/**
- * A list of rule-level overrides. This option has the highest precedence.
+ * The ID of the rule to override.
*/
- rules?: Array;
+ id: string;
/**
- * A sensitivity level to set for all rules. This option has lower precedence than
- * rule and category overrides and is only applicable for DDoS phases.
+ * The action to override the rule with.
*/
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
+ action?: string;
- export namespace Overrides {
/**
- * A category-level override
+ * Whether to enable execution of the rule.
*/
- export interface Category {
- /**
- * The name of the category to override.
- */
- category: string;
-
- /**
- * The action to override rules in the category with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of rules in the category.
- */
- enabled?: boolean;
-
- /**
- * The sensitivity level to use for rules in the category.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
+ enabled?: boolean;
/**
- * A rule-level override
+ * The score threshold to use for the rule.
*/
- export interface Rule {
- /**
- * The ID of the rule to override.
- */
- id: string;
-
- /**
- * The action to override the rule with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of the rule.
- */
- enabled?: boolean;
-
- /**
- * The score threshold to use for the rule.
- */
- score_threshold?: number;
-
- /**
- * The sensitivity level to use for the rule.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
+ score_threshold?: number;
+
+ /**
+ * The sensitivity level to use for the rule.
+ */
+ sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
}
}
}
+}
- export interface RulesetsLogRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
+export interface LogRule {
+ /**
+ * The timestamp of when the rule was last modified.
+ */
+ last_updated: string;
- /**
- * The version of the rule.
- */
- version: string;
+ /**
+ * The version of the rule.
+ */
+ version: string;
- /**
- * The unique ID of the rule.
- */
- id?: string;
+ /**
+ * The unique ID of the rule.
+ */
+ id?: string;
- /**
- * The action to perform when the rule matches.
- */
- action?: 'log';
+ /**
+ * The action to perform when the rule matches.
+ */
+ action?: 'log';
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: unknown;
+ /**
+ * The parameters configuring the rule's action.
+ */
+ action_parameters?: unknown;
- /**
- * The categories of the rule.
- */
- categories?: Array;
+ /**
+ * The categories of the rule.
+ */
+ categories?: Array;
- /**
- * An informative description of the rule.
- */
- description?: string;
+ /**
+ * An informative description of the rule.
+ */
+ description?: string;
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
+ /**
+ * Whether the rule should be executed.
+ */
+ enabled?: boolean;
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
+ /**
+ * The expression defining which traffic will match the rule.
+ */
+ expression?: string;
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
+ /**
+ * An object configuring the rule's logging behavior.
+ */
+ logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
+ /**
+ * The reference of the rule (the rule ID by default).
+ */
+ ref?: string;
+}
- export interface RulesetsSkipRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
+/**
+ * A ruleset object.
+ */
+export interface Ruleset {
+ /**
+ * The unique ID of the ruleset.
+ */
+ id: string;
- /**
- * The version of the rule.
- */
- version: string;
+ /**
+ * The timestamp of when the ruleset was last modified.
+ */
+ last_updated: string;
- /**
- * The unique ID of the rule.
- */
- id?: string;
+ /**
+ * The version of the ruleset.
+ */
+ version: string;
- /**
- * The action to perform when the rule matches.
- */
- action?: 'skip';
+ /**
+ * An informative description of the ruleset.
+ */
+ description?: string;
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsSkipRule.ActionParameters;
+ /**
+ * The kind of the ruleset.
+ */
+ kind?: 'managed' | 'custom' | 'root' | 'zone';
- /**
- * The categories of the rule.
- */
- categories?: Array;
+ /**
+ * The human-readable name of the ruleset.
+ */
+ name?: string;
- /**
- * An informative description of the rule.
- */
- description?: string;
+ /**
+ * The phase of the ruleset.
+ */
+ phase?:
+ | 'ddos_l4'
+ | 'ddos_l7'
+ | 'http_config_settings'
+ | 'http_custom_errors'
+ | 'http_log_custom_fields'
+ | 'http_ratelimit'
+ | 'http_request_cache_settings'
+ | 'http_request_dynamic_redirect'
+ | 'http_request_firewall_custom'
+ | 'http_request_firewall_managed'
+ | 'http_request_late_transform'
+ | 'http_request_origin'
+ | 'http_request_redirect'
+ | 'http_request_sanitize'
+ | 'http_request_sbfm'
+ | 'http_request_select_configuration'
+ | 'http_request_transform'
+ | 'http_response_compression'
+ | 'http_response_firewall_managed'
+ | 'http_response_headers_transform'
+ | 'magic_transit'
+ | 'magic_transit_ids_managed'
+ | 'magic_transit_managed';
+}
+
+export interface SkipRule {
+ /**
+ * The timestamp of when the rule was last modified.
+ */
+ last_updated: string;
+
+ /**
+ * The version of the rule.
+ */
+ version: string;
+
+ /**
+ * The unique ID of the rule.
+ */
+ id?: string;
+
+ /**
+ * The action to perform when the rule matches.
+ */
+ action?: 'skip';
+
+ /**
+ * The parameters configuring the rule's action.
+ */
+ action_parameters?: SkipRule.ActionParameters;
+
+ /**
+ * The categories of the rule.
+ */
+ categories?: Array;
+
+ /**
+ * An informative description of the rule.
+ */
+ description?: string;
+
+ /**
+ * Whether the rule should be executed.
+ */
+ enabled?: boolean;
+
+ /**
+ * The expression defining which traffic will match the rule.
+ */
+ expression?: string;
+
+ /**
+ * An object configuring the rule's logging behavior.
+ */
+ logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
+
+ /**
+ * The reference of the rule (the rule ID by default).
+ */
+ ref?: string;
+}
+export namespace SkipRule {
+ /**
+ * The parameters configuring the rule's action.
+ */
+ export interface ActionParameters {
/**
- * Whether the rule should be executed.
+ * A list of phases to skip the execution of. This option is incompatible with the
+ * ruleset and rulesets options.
*/
- enabled?: boolean;
+ phases?: Array<
+ | 'ddos_l4'
+ | 'ddos_l7'
+ | 'http_config_settings'
+ | 'http_custom_errors'
+ | 'http_log_custom_fields'
+ | 'http_ratelimit'
+ | 'http_request_cache_settings'
+ | 'http_request_dynamic_redirect'
+ | 'http_request_firewall_custom'
+ | 'http_request_firewall_managed'
+ | 'http_request_late_transform'
+ | 'http_request_origin'
+ | 'http_request_redirect'
+ | 'http_request_sanitize'
+ | 'http_request_sbfm'
+ | 'http_request_select_configuration'
+ | 'http_request_transform'
+ | 'http_response_compression'
+ | 'http_response_firewall_managed'
+ | 'http_response_headers_transform'
+ | 'magic_transit'
+ | 'magic_transit_ids_managed'
+ | 'magic_transit_managed'
+ >;
/**
- * The expression defining which traffic will match the rule.
+ * A list of legacy security products to skip the execution of.
*/
- expression?: string;
+ products?: Array<'bic' | 'hot' | 'rateLimit' | 'securityLevel' | 'uaBlock' | 'waf' | 'zoneLockdown'>;
/**
- * An object configuring the rule's logging behavior.
+ * A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
+ * execution of. This option is incompatible with the ruleset option.
*/
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
+ rules?: Record>;
/**
- * The reference of the rule (the rule ID by default).
+ * A ruleset to skip the execution of. This option is incompatible with the
+ * rulesets, rules and phases options.
*/
- ref?: string;
- }
+ ruleset?: 'current';
- export namespace RulesetsSkipRule {
/**
- * The parameters configuring the rule's action.
+ * A list of ruleset IDs to skip the execution of. This option is incompatible with
+ * the ruleset and phases options.
*/
- export interface ActionParameters {
- /**
- * A list of phases to skip the execution of. This option is incompatible with the
- * ruleset and rulesets options.
- */
- phases?: Array<
- | 'ddos_l4'
- | 'ddos_l7'
- | 'http_config_settings'
- | 'http_custom_errors'
- | 'http_log_custom_fields'
- | 'http_ratelimit'
- | 'http_request_cache_settings'
- | 'http_request_dynamic_redirect'
- | 'http_request_firewall_custom'
- | 'http_request_firewall_managed'
- | 'http_request_late_transform'
- | 'http_request_origin'
- | 'http_request_redirect'
- | 'http_request_sanitize'
- | 'http_request_sbfm'
- | 'http_request_select_configuration'
- | 'http_request_transform'
- | 'http_response_compression'
- | 'http_response_firewall_managed'
- | 'http_response_headers_transform'
- | 'magic_transit'
- | 'magic_transit_ids_managed'
- | 'magic_transit_managed'
- >;
-
- /**
- * A list of legacy security products to skip the execution of.
- */
- products?: Array<'bic' | 'hot' | 'rateLimit' | 'securityLevel' | 'uaBlock' | 'waf' | 'zoneLockdown'>;
-
- /**
- * A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- * execution of. This option is incompatible with the ruleset option.
- */
- rules?: Record>;
-
- /**
- * A ruleset to skip the execution of. This option is incompatible with the
- * rulesets, rules and phases options.
- */
- ruleset?: 'current';
-
- /**
- * A list of ruleset IDs to skip the execution of. This option is incompatible with
- * the ruleset and phases options.
- */
- rulesets?: Array;
- }
+ rulesets?: Array;
}
}
/**
* A ruleset object.
*/
-export interface RulesetUpdateResponse {
+export interface RulesetCreateResponse {
/**
* The unique ID of the ruleset.
*/
@@ -841,12 +766,7 @@ export interface RulesetUpdateResponse {
/**
* The list of rules in the ruleset.
*/
- rules: Array<
- | RulesetUpdateResponse.RulesetsBlockRule
- | RulesetUpdateResponse.RulesetsExecuteRule
- | RulesetUpdateResponse.RulesetsLogRule
- | RulesetUpdateResponse.RulesetsSkipRule
- >;
+ rules: Array;
/**
* The version of the ruleset.
@@ -859,478 +779,97 @@ export interface RulesetUpdateResponse {
description?: string;
}
-export namespace RulesetUpdateResponse {
- export interface RulesetsBlockRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'block';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsBlockRule.ActionParameters;
+/**
+ * A ruleset object.
+ */
+export interface RulesetUpdateResponse {
+ /**
+ * The unique ID of the ruleset.
+ */
+ id: string;
- /**
- * The categories of the rule.
- */
- categories?: Array;
+ /**
+ * The kind of the ruleset.
+ */
+ kind: 'managed' | 'custom' | 'root' | 'zone';
- /**
- * An informative description of the rule.
- */
- description?: string;
+ /**
+ * The timestamp of when the ruleset was last modified.
+ */
+ last_updated: string;
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
+ /**
+ * The human-readable name of the ruleset.
+ */
+ name: string;
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
+ /**
+ * The phase of the ruleset.
+ */
+ phase:
+ | 'ddos_l4'
+ | 'ddos_l7'
+ | 'http_config_settings'
+ | 'http_custom_errors'
+ | 'http_log_custom_fields'
+ | 'http_ratelimit'
+ | 'http_request_cache_settings'
+ | 'http_request_dynamic_redirect'
+ | 'http_request_firewall_custom'
+ | 'http_request_firewall_managed'
+ | 'http_request_late_transform'
+ | 'http_request_origin'
+ | 'http_request_redirect'
+ | 'http_request_sanitize'
+ | 'http_request_sbfm'
+ | 'http_request_select_configuration'
+ | 'http_request_transform'
+ | 'http_response_compression'
+ | 'http_response_firewall_managed'
+ | 'http_response_headers_transform'
+ | 'magic_transit'
+ | 'magic_transit_ids_managed'
+ | 'magic_transit_managed';
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
+ /**
+ * The list of rules in the ruleset.
+ */
+ rules: Array;
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
+ /**
+ * The version of the ruleset.
+ */
+ version: string;
- export namespace RulesetsBlockRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- response?: ActionParameters.Response;
- }
+ /**
+ * An informative description of the ruleset.
+ */
+ description?: string;
+}
- export namespace ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- export interface Response {
- /**
- * The content to return.
- */
- content: string;
+/**
+ * A ruleset object.
+ */
+export interface RulesetGetResponse {
+ /**
+ * The unique ID of the ruleset.
+ */
+ id: string;
- /**
- * The type of the content to return.
- */
- content_type: string;
+ /**
+ * The kind of the ruleset.
+ */
+ kind: 'managed' | 'custom' | 'root' | 'zone';
- /**
- * The status code to return.
- */
- status_code: number;
- }
- }
- }
+ /**
+ * The timestamp of when the ruleset was last modified.
+ */
+ last_updated: string;
- export interface RulesetsExecuteRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'execute';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsExecuteRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsExecuteRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The ID of the ruleset to execute.
- */
- id: string;
-
- /**
- * The configuration to use for matched data logging.
- */
- matched_data?: ActionParameters.MatchedData;
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- overrides?: ActionParameters.Overrides;
- }
-
- export namespace ActionParameters {
- /**
- * The configuration to use for matched data logging.
- */
- export interface MatchedData {
- /**
- * The public key to encrypt matched data logs with.
- */
- public_key: string;
- }
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- export interface Overrides {
- /**
- * An action to override all rules with. This option has lower precedence than rule
- * and category overrides.
- */
- action?: string;
-
- /**
- * A list of category-level overrides. This option has the second-highest
- * precedence after rule-level overrides.
- */
- categories?: Array;
-
- /**
- * Whether to enable execution of all rules. This option has lower precedence than
- * rule and category overrides.
- */
- enabled?: boolean;
-
- /**
- * A list of rule-level overrides. This option has the highest precedence.
- */
- rules?: Array;
-
- /**
- * A sensitivity level to set for all rules. This option has lower precedence than
- * rule and category overrides and is only applicable for DDoS phases.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- export namespace Overrides {
- /**
- * A category-level override
- */
- export interface Category {
- /**
- * The name of the category to override.
- */
- category: string;
-
- /**
- * The action to override rules in the category with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of rules in the category.
- */
- enabled?: boolean;
-
- /**
- * The sensitivity level to use for rules in the category.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- /**
- * A rule-level override
- */
- export interface Rule {
- /**
- * The ID of the rule to override.
- */
- id: string;
-
- /**
- * The action to override the rule with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of the rule.
- */
- enabled?: boolean;
-
- /**
- * The score threshold to use for the rule.
- */
- score_threshold?: number;
-
- /**
- * The sensitivity level to use for the rule.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
- }
- }
- }
-
- export interface RulesetsLogRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'log';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: unknown;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export interface RulesetsSkipRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'skip';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsSkipRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsSkipRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * A list of phases to skip the execution of. This option is incompatible with the
- * ruleset and rulesets options.
- */
- phases?: Array<
- | 'ddos_l4'
- | 'ddos_l7'
- | 'http_config_settings'
- | 'http_custom_errors'
- | 'http_log_custom_fields'
- | 'http_ratelimit'
- | 'http_request_cache_settings'
- | 'http_request_dynamic_redirect'
- | 'http_request_firewall_custom'
- | 'http_request_firewall_managed'
- | 'http_request_late_transform'
- | 'http_request_origin'
- | 'http_request_redirect'
- | 'http_request_sanitize'
- | 'http_request_sbfm'
- | 'http_request_select_configuration'
- | 'http_request_transform'
- | 'http_response_compression'
- | 'http_response_firewall_managed'
- | 'http_response_headers_transform'
- | 'magic_transit'
- | 'magic_transit_ids_managed'
- | 'magic_transit_managed'
- >;
-
- /**
- * A list of legacy security products to skip the execution of.
- */
- products?: Array<'bic' | 'hot' | 'rateLimit' | 'securityLevel' | 'uaBlock' | 'waf' | 'zoneLockdown'>;
-
- /**
- * A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- * execution of. This option is incompatible with the ruleset option.
- */
- rules?: Record>;
-
- /**
- * A ruleset to skip the execution of. This option is incompatible with the
- * rulesets, rules and phases options.
- */
- ruleset?: 'current';
-
- /**
- * A list of ruleset IDs to skip the execution of. This option is incompatible with
- * the ruleset and phases options.
- */
- rulesets?: Array;
- }
- }
-}
-
-/**
- * A ruleset object.
- */
-export interface RulesetGetResponse {
- /**
- * The unique ID of the ruleset.
- */
- id: string;
-
- /**
- * The kind of the ruleset.
- */
- kind: 'managed' | 'custom' | 'root' | 'zone';
-
- /**
- * The timestamp of when the ruleset was last modified.
- */
- last_updated: string;
-
- /**
- * The human-readable name of the ruleset.
- */
- name: string;
+ /**
+ * The human-readable name of the ruleset.
+ */
+ name: string;
/**
* The phase of the ruleset.
@@ -1363,12 +902,7 @@ export interface RulesetGetResponse {
/**
* The list of rules in the ruleset.
*/
- rules: Array<
- | RulesetGetResponse.RulesetsBlockRule
- | RulesetGetResponse.RulesetsExecuteRule
- | RulesetGetResponse.RulesetsLogRule
- | RulesetGetResponse.RulesetsSkipRule
- >;
+ rules: Array;
/**
* The version of the ruleset.
@@ -1381,921 +915,73 @@ export interface RulesetGetResponse {
description?: string;
}
-export namespace RulesetGetResponse {
- export interface RulesetsBlockRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'block';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsBlockRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsBlockRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- response?: ActionParameters.Response;
- }
-
- export namespace ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- export interface Response {
- /**
- * The content to return.
- */
- content: string;
-
- /**
- * The type of the content to return.
- */
- content_type: string;
-
- /**
- * The status code to return.
- */
- status_code: number;
- }
- }
- }
-
- export interface RulesetsExecuteRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'execute';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsExecuteRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsExecuteRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The ID of the ruleset to execute.
- */
- id: string;
-
- /**
- * The configuration to use for matched data logging.
- */
- matched_data?: ActionParameters.MatchedData;
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- overrides?: ActionParameters.Overrides;
- }
-
- export namespace ActionParameters {
- /**
- * The configuration to use for matched data logging.
- */
- export interface MatchedData {
- /**
- * The public key to encrypt matched data logs with.
- */
- public_key: string;
- }
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- export interface Overrides {
- /**
- * An action to override all rules with. This option has lower precedence than rule
- * and category overrides.
- */
- action?: string;
-
- /**
- * A list of category-level overrides. This option has the second-highest
- * precedence after rule-level overrides.
- */
- categories?: Array;
-
- /**
- * Whether to enable execution of all rules. This option has lower precedence than
- * rule and category overrides.
- */
- enabled?: boolean;
-
- /**
- * A list of rule-level overrides. This option has the highest precedence.
- */
- rules?: Array;
-
- /**
- * A sensitivity level to set for all rules. This option has lower precedence than
- * rule and category overrides and is only applicable for DDoS phases.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- export namespace Overrides {
- /**
- * A category-level override
- */
- export interface Category {
- /**
- * The name of the category to override.
- */
- category: string;
-
- /**
- * The action to override rules in the category with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of rules in the category.
- */
- enabled?: boolean;
-
- /**
- * The sensitivity level to use for rules in the category.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- /**
- * A rule-level override
- */
- export interface Rule {
- /**
- * The ID of the rule to override.
- */
- id: string;
-
- /**
- * The action to override the rule with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of the rule.
- */
- enabled?: boolean;
-
- /**
- * The score threshold to use for the rule.
- */
- score_threshold?: number;
-
- /**
- * The sensitivity level to use for the rule.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
- }
- }
- }
-
- export interface RulesetsLogRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'log';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: unknown;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export interface RulesetsSkipRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'skip';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsSkipRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsSkipRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * A list of phases to skip the execution of. This option is incompatible with the
- * ruleset and rulesets options.
- */
- phases?: Array<
- | 'ddos_l4'
- | 'ddos_l7'
- | 'http_config_settings'
- | 'http_custom_errors'
- | 'http_log_custom_fields'
- | 'http_ratelimit'
- | 'http_request_cache_settings'
- | 'http_request_dynamic_redirect'
- | 'http_request_firewall_custom'
- | 'http_request_firewall_managed'
- | 'http_request_late_transform'
- | 'http_request_origin'
- | 'http_request_redirect'
- | 'http_request_sanitize'
- | 'http_request_sbfm'
- | 'http_request_select_configuration'
- | 'http_request_transform'
- | 'http_response_compression'
- | 'http_response_firewall_managed'
- | 'http_response_headers_transform'
- | 'magic_transit'
- | 'magic_transit_ids_managed'
- | 'magic_transit_managed'
- >;
-
- /**
- * A list of legacy security products to skip the execution of.
- */
- products?: Array<'bic' | 'hot' | 'rateLimit' | 'securityLevel' | 'uaBlock' | 'waf' | 'zoneLockdown'>;
-
- /**
- * A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- * execution of. This option is incompatible with the ruleset option.
- */
- rules?: Record>;
-
- /**
- * A ruleset to skip the execution of. This option is incompatible with the
- * rulesets, rules and phases options.
- */
- ruleset?: 'current';
-
- /**
- * A list of ruleset IDs to skip the execution of. This option is incompatible with
- * the ruleset and phases options.
- */
- rulesets?: Array;
- }
- }
-}
-
export interface RulesetCreateParams {
/**
* Body param: The kind of the ruleset.
*/
- kind: 'managed' | 'custom' | 'root' | 'zone';
-
- /**
- * Body param: The human-readable name of the ruleset.
- */
- name: string;
-
- /**
- * Body param: The phase of the ruleset.
- */
- phase:
- | 'ddos_l4'
- | 'ddos_l7'
- | 'http_config_settings'
- | 'http_custom_errors'
- | 'http_log_custom_fields'
- | 'http_ratelimit'
- | 'http_request_cache_settings'
- | 'http_request_dynamic_redirect'
- | 'http_request_firewall_custom'
- | 'http_request_firewall_managed'
- | 'http_request_late_transform'
- | 'http_request_origin'
- | 'http_request_redirect'
- | 'http_request_sanitize'
- | 'http_request_sbfm'
- | 'http_request_select_configuration'
- | 'http_request_transform'
- | 'http_response_compression'
- | 'http_response_firewall_managed'
- | 'http_response_headers_transform'
- | 'magic_transit'
- | 'magic_transit_ids_managed'
- | 'magic_transit_managed';
-
- /**
- * Body param: The list of rules in the ruleset.
- */
- rules: Array<
- | RulesetCreateParams.RulesetsBlockRule
- | RulesetCreateParams.RulesetsExecuteRule
- | RulesetCreateParams.RulesetsLogRule
- | RulesetCreateParams.RulesetsSkipRule
- >;
-
- /**
- * Path param: The Account ID to use for this endpoint. Mutually exclusive with the
- * Zone ID.
- */
- account_id?: string;
-
- /**
- * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the
- * Account ID.
- */
- zone_id?: string;
-
- /**
- * Body param: An informative description of the ruleset.
- */
- description?: string;
-}
-
-export namespace RulesetCreateParams {
- export interface RulesetsBlockRule {
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'block';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsBlockRule.ActionParameters;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsBlockRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- response?: ActionParameters.Response;
- }
-
- export namespace ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- export interface Response {
- /**
- * The content to return.
- */
- content: string;
-
- /**
- * The type of the content to return.
- */
- content_type: string;
-
- /**
- * The status code to return.
- */
- status_code: number;
- }
- }
- }
-
- export interface RulesetsExecuteRule {
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'execute';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsExecuteRule.ActionParameters;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsExecuteRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The ID of the ruleset to execute.
- */
- id: string;
-
- /**
- * The configuration to use for matched data logging.
- */
- matched_data?: ActionParameters.MatchedData;
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- overrides?: ActionParameters.Overrides;
- }
-
- export namespace ActionParameters {
- /**
- * The configuration to use for matched data logging.
- */
- export interface MatchedData {
- /**
- * The public key to encrypt matched data logs with.
- */
- public_key: string;
- }
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- export interface Overrides {
- /**
- * An action to override all rules with. This option has lower precedence than rule
- * and category overrides.
- */
- action?: string;
-
- /**
- * A list of category-level overrides. This option has the second-highest
- * precedence after rule-level overrides.
- */
- categories?: Array;
-
- /**
- * Whether to enable execution of all rules. This option has lower precedence than
- * rule and category overrides.
- */
- enabled?: boolean;
-
- /**
- * A list of rule-level overrides. This option has the highest precedence.
- */
- rules?: Array;
-
- /**
- * A sensitivity level to set for all rules. This option has lower precedence than
- * rule and category overrides and is only applicable for DDoS phases.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- export namespace Overrides {
- /**
- * A category-level override
- */
- export interface Category {
- /**
- * The name of the category to override.
- */
- category: string;
-
- /**
- * The action to override rules in the category with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of rules in the category.
- */
- enabled?: boolean;
-
- /**
- * The sensitivity level to use for rules in the category.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- /**
- * A rule-level override
- */
- export interface Rule {
- /**
- * The ID of the rule to override.
- */
- id: string;
-
- /**
- * The action to override the rule with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of the rule.
- */
- enabled?: boolean;
-
- /**
- * The score threshold to use for the rule.
- */
- score_threshold?: number;
-
- /**
- * The sensitivity level to use for the rule.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
- }
- }
- }
-
- export interface RulesetsLogRule {
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'log';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: unknown;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export interface RulesetsSkipRule {
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'skip';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsSkipRule.ActionParameters;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
+ kind: 'managed' | 'custom' | 'root' | 'zone';
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
+ /**
+ * Body param: The human-readable name of the ruleset.
+ */
+ name: string;
- export namespace RulesetsSkipRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * A list of phases to skip the execution of. This option is incompatible with the
- * ruleset and rulesets options.
- */
- phases?: Array<
- | 'ddos_l4'
- | 'ddos_l7'
- | 'http_config_settings'
- | 'http_custom_errors'
- | 'http_log_custom_fields'
- | 'http_ratelimit'
- | 'http_request_cache_settings'
- | 'http_request_dynamic_redirect'
- | 'http_request_firewall_custom'
- | 'http_request_firewall_managed'
- | 'http_request_late_transform'
- | 'http_request_origin'
- | 'http_request_redirect'
- | 'http_request_sanitize'
- | 'http_request_sbfm'
- | 'http_request_select_configuration'
- | 'http_request_transform'
- | 'http_response_compression'
- | 'http_response_firewall_managed'
- | 'http_response_headers_transform'
- | 'magic_transit'
- | 'magic_transit_ids_managed'
- | 'magic_transit_managed'
- >;
+ /**
+ * Body param: The phase of the ruleset.
+ */
+ phase:
+ | 'ddos_l4'
+ | 'ddos_l7'
+ | 'http_config_settings'
+ | 'http_custom_errors'
+ | 'http_log_custom_fields'
+ | 'http_ratelimit'
+ | 'http_request_cache_settings'
+ | 'http_request_dynamic_redirect'
+ | 'http_request_firewall_custom'
+ | 'http_request_firewall_managed'
+ | 'http_request_late_transform'
+ | 'http_request_origin'
+ | 'http_request_redirect'
+ | 'http_request_sanitize'
+ | 'http_request_sbfm'
+ | 'http_request_select_configuration'
+ | 'http_request_transform'
+ | 'http_response_compression'
+ | 'http_response_firewall_managed'
+ | 'http_response_headers_transform'
+ | 'magic_transit'
+ | 'magic_transit_ids_managed'
+ | 'magic_transit_managed';
- /**
- * A list of legacy security products to skip the execution of.
- */
- products?: Array<'bic' | 'hot' | 'rateLimit' | 'securityLevel' | 'uaBlock' | 'waf' | 'zoneLockdown'>;
+ /**
+ * Body param: The list of rules in the ruleset.
+ */
+ rules: Array;
- /**
- * A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- * execution of. This option is incompatible with the ruleset option.
- */
- rules?: Record>;
+ /**
+ * Path param: The Account ID to use for this endpoint. Mutually exclusive with the
+ * Zone ID.
+ */
+ account_id?: string;
- /**
- * A ruleset to skip the execution of. This option is incompatible with the
- * rulesets, rules and phases options.
- */
- ruleset?: 'current';
+ /**
+ * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the
+ * Account ID.
+ */
+ zone_id?: string;
- /**
- * A list of ruleset IDs to skip the execution of. This option is incompatible with
- * the ruleset and phases options.
- */
- rulesets?: Array;
- }
- }
+ /**
+ * Body param: An informative description of the ruleset.
+ */
+ description?: string;
}
export interface RulesetUpdateParams {
/**
* Body param: The list of rules in the ruleset.
*/
- rules: Array<
- | RulesetUpdateParams.RulesetsBlockRule
- | RulesetUpdateParams.RulesetsExecuteRule
- | RulesetUpdateParams.RulesetsLogRule
- | RulesetUpdateParams.RulesetsSkipRule
- >;
+ rules: Array;
/**
* Path param: The Account ID to use for this endpoint. Mutually exclusive with the
@@ -2353,395 +1039,6 @@ export interface RulesetUpdateParams {
| 'magic_transit_managed';
}
-export namespace RulesetUpdateParams {
- export interface RulesetsBlockRule {
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'block';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsBlockRule.ActionParameters;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsBlockRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- response?: ActionParameters.Response;
- }
-
- export namespace ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- export interface Response {
- /**
- * The content to return.
- */
- content: string;
-
- /**
- * The type of the content to return.
- */
- content_type: string;
-
- /**
- * The status code to return.
- */
- status_code: number;
- }
- }
- }
-
- export interface RulesetsExecuteRule {
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'execute';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsExecuteRule.ActionParameters;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsExecuteRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The ID of the ruleset to execute.
- */
- id: string;
-
- /**
- * The configuration to use for matched data logging.
- */
- matched_data?: ActionParameters.MatchedData;
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- overrides?: ActionParameters.Overrides;
- }
-
- export namespace ActionParameters {
- /**
- * The configuration to use for matched data logging.
- */
- export interface MatchedData {
- /**
- * The public key to encrypt matched data logs with.
- */
- public_key: string;
- }
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- export interface Overrides {
- /**
- * An action to override all rules with. This option has lower precedence than rule
- * and category overrides.
- */
- action?: string;
-
- /**
- * A list of category-level overrides. This option has the second-highest
- * precedence after rule-level overrides.
- */
- categories?: Array;
-
- /**
- * Whether to enable execution of all rules. This option has lower precedence than
- * rule and category overrides.
- */
- enabled?: boolean;
-
- /**
- * A list of rule-level overrides. This option has the highest precedence.
- */
- rules?: Array;
-
- /**
- * A sensitivity level to set for all rules. This option has lower precedence than
- * rule and category overrides and is only applicable for DDoS phases.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- export namespace Overrides {
- /**
- * A category-level override
- */
- export interface Category {
- /**
- * The name of the category to override.
- */
- category: string;
-
- /**
- * The action to override rules in the category with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of rules in the category.
- */
- enabled?: boolean;
-
- /**
- * The sensitivity level to use for rules in the category.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- /**
- * A rule-level override
- */
- export interface Rule {
- /**
- * The ID of the rule to override.
- */
- id: string;
-
- /**
- * The action to override the rule with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of the rule.
- */
- enabled?: boolean;
-
- /**
- * The score threshold to use for the rule.
- */
- score_threshold?: number;
-
- /**
- * The sensitivity level to use for the rule.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
- }
- }
- }
-
- export interface RulesetsLogRule {
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'log';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: unknown;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export interface RulesetsSkipRule {
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'skip';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsSkipRule.ActionParameters;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsSkipRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * A list of phases to skip the execution of. This option is incompatible with the
- * ruleset and rulesets options.
- */
- phases?: Array<
- | 'ddos_l4'
- | 'ddos_l7'
- | 'http_config_settings'
- | 'http_custom_errors'
- | 'http_log_custom_fields'
- | 'http_ratelimit'
- | 'http_request_cache_settings'
- | 'http_request_dynamic_redirect'
- | 'http_request_firewall_custom'
- | 'http_request_firewall_managed'
- | 'http_request_late_transform'
- | 'http_request_origin'
- | 'http_request_redirect'
- | 'http_request_sanitize'
- | 'http_request_sbfm'
- | 'http_request_select_configuration'
- | 'http_request_transform'
- | 'http_response_compression'
- | 'http_response_firewall_managed'
- | 'http_response_headers_transform'
- | 'magic_transit'
- | 'magic_transit_ids_managed'
- | 'magic_transit_managed'
- >;
-
- /**
- * A list of legacy security products to skip the execution of.
- */
- products?: Array<'bic' | 'hot' | 'rateLimit' | 'securityLevel' | 'uaBlock' | 'waf' | 'zoneLockdown'>;
-
- /**
- * A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- * execution of. This option is incompatible with the ruleset option.
- */
- rules?: Record>;
-
- /**
- * A ruleset to skip the execution of. This option is incompatible with the
- * rulesets, rules and phases options.
- */
- ruleset?: 'current';
-
- /**
- * A list of ruleset IDs to skip the execution of. This option is incompatible with
- * the ruleset and phases options.
- */
- rulesets?: Array;
- }
- }
-}
-
export interface RulesetListParams {
/**
* The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
diff --git a/src/resources/rulesets/versions/by-tag.ts b/src/resources/rulesets/versions/by-tag.ts
index 70e3f7034e..ca0c68d7ef 100644
--- a/src/resources/rulesets/versions/by-tag.ts
+++ b/src/resources/rulesets/versions/by-tag.ts
@@ -3,7 +3,7 @@
import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as ByTagAPI from 'cloudflare/resources/rulesets/versions/by-tag';
-import * as Shared from 'cloudflare/resources/shared';
+import * as RulesetsAPI from 'cloudflare/resources/rulesets/rulesets';
export class ByTag extends APIResource {
/**
@@ -81,12 +81,7 @@ export interface ByTagGetResponse {
/**
* The list of rules in the ruleset.
*/
- rules: Array<
- | ByTagGetResponse.RulesetsBlockRule
- | ByTagGetResponse.RulesetsExecuteRule
- | ByTagGetResponse.RulesetsLogRule
- | ByTagGetResponse.RulesetsSkipRule
- >;
+ rules: Array;
/**
* The version of the ruleset.
@@ -99,455 +94,6 @@ export interface ByTagGetResponse {
description?: string;
}
-export namespace ByTagGetResponse {
- export interface RulesetsBlockRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'block';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsBlockRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsBlockRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- response?: ActionParameters.Response;
- }
-
- export namespace ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- export interface Response {
- /**
- * The content to return.
- */
- content: string;
-
- /**
- * The type of the content to return.
- */
- content_type: string;
-
- /**
- * The status code to return.
- */
- status_code: number;
- }
- }
- }
-
- export interface RulesetsExecuteRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'execute';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsExecuteRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsExecuteRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The ID of the ruleset to execute.
- */
- id: string;
-
- /**
- * The configuration to use for matched data logging.
- */
- matched_data?: ActionParameters.MatchedData;
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- overrides?: ActionParameters.Overrides;
- }
-
- export namespace ActionParameters {
- /**
- * The configuration to use for matched data logging.
- */
- export interface MatchedData {
- /**
- * The public key to encrypt matched data logs with.
- */
- public_key: string;
- }
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- export interface Overrides {
- /**
- * An action to override all rules with. This option has lower precedence than rule
- * and category overrides.
- */
- action?: string;
-
- /**
- * A list of category-level overrides. This option has the second-highest
- * precedence after rule-level overrides.
- */
- categories?: Array;
-
- /**
- * Whether to enable execution of all rules. This option has lower precedence than
- * rule and category overrides.
- */
- enabled?: boolean;
-
- /**
- * A list of rule-level overrides. This option has the highest precedence.
- */
- rules?: Array;
-
- /**
- * A sensitivity level to set for all rules. This option has lower precedence than
- * rule and category overrides and is only applicable for DDoS phases.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- export namespace Overrides {
- /**
- * A category-level override
- */
- export interface Category {
- /**
- * The name of the category to override.
- */
- category: string;
-
- /**
- * The action to override rules in the category with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of rules in the category.
- */
- enabled?: boolean;
-
- /**
- * The sensitivity level to use for rules in the category.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- /**
- * A rule-level override
- */
- export interface Rule {
- /**
- * The ID of the rule to override.
- */
- id: string;
-
- /**
- * The action to override the rule with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of the rule.
- */
- enabled?: boolean;
-
- /**
- * The score threshold to use for the rule.
- */
- score_threshold?: number;
-
- /**
- * The sensitivity level to use for the rule.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
- }
- }
- }
-
- export interface RulesetsLogRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'log';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: unknown;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export interface RulesetsSkipRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'skip';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsSkipRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsSkipRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * A list of phases to skip the execution of. This option is incompatible with the
- * ruleset and rulesets options.
- */
- phases?: Array<
- | 'ddos_l4'
- | 'ddos_l7'
- | 'http_config_settings'
- | 'http_custom_errors'
- | 'http_log_custom_fields'
- | 'http_ratelimit'
- | 'http_request_cache_settings'
- | 'http_request_dynamic_redirect'
- | 'http_request_firewall_custom'
- | 'http_request_firewall_managed'
- | 'http_request_late_transform'
- | 'http_request_origin'
- | 'http_request_redirect'
- | 'http_request_sanitize'
- | 'http_request_sbfm'
- | 'http_request_select_configuration'
- | 'http_request_transform'
- | 'http_response_compression'
- | 'http_response_firewall_managed'
- | 'http_response_headers_transform'
- | 'magic_transit'
- | 'magic_transit_ids_managed'
- | 'magic_transit_managed'
- >;
-
- /**
- * A list of legacy security products to skip the execution of.
- */
- products?: Array<'bic' | 'hot' | 'rateLimit' | 'securityLevel' | 'uaBlock' | 'waf' | 'zoneLockdown'>;
-
- /**
- * A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- * execution of. This option is incompatible with the ruleset option.
- */
- rules?: Record>;
-
- /**
- * A ruleset to skip the execution of. This option is incompatible with the
- * rulesets, rules and phases options.
- */
- ruleset?: 'current';
-
- /**
- * A list of ruleset IDs to skip the execution of. This option is incompatible with
- * the ruleset and phases options.
- */
- rulesets?: Array;
- }
- }
-}
-
export interface ByTagGetParams {
/**
* The unique ID of the account.
diff --git a/src/resources/rulesets/versions/versions.ts b/src/resources/rulesets/versions/versions.ts
index 2f111c87b8..e7aabcd638 100644
--- a/src/resources/rulesets/versions/versions.ts
+++ b/src/resources/rulesets/versions/versions.ts
@@ -5,7 +5,6 @@ import { APIResource } from 'cloudflare/resource';
import { isRequestOptions } from 'cloudflare/core';
import { CloudflareError } from 'cloudflare/error';
import * as VersionsAPI from 'cloudflare/resources/rulesets/versions/versions';
-import * as Shared from 'cloudflare/resources/shared';
import * as RulesetsAPI from 'cloudflare/resources/rulesets/rulesets';
import { RulesetsSinglePage } from 'cloudflare/resources/rulesets/rulesets';
import * as ByTagAPI from 'cloudflare/resources/rulesets/versions/by-tag';
@@ -203,12 +202,7 @@ export interface VersionGetResponse {
/**
* The list of rules in the ruleset.
*/
- rules: Array<
- | VersionGetResponse.RulesetsBlockRule
- | VersionGetResponse.RulesetsExecuteRule
- | VersionGetResponse.RulesetsLogRule
- | VersionGetResponse.RulesetsSkipRule
- >;
+ rules: Array;
/**
* The version of the ruleset.
@@ -221,455 +215,6 @@ export interface VersionGetResponse {
description?: string;
}
-export namespace VersionGetResponse {
- export interface RulesetsBlockRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'block';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsBlockRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsBlockRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- response?: ActionParameters.Response;
- }
-
- export namespace ActionParameters {
- /**
- * The response to show when the block is applied.
- */
- export interface Response {
- /**
- * The content to return.
- */
- content: string;
-
- /**
- * The type of the content to return.
- */
- content_type: string;
-
- /**
- * The status code to return.
- */
- status_code: number;
- }
- }
- }
-
- export interface RulesetsExecuteRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'execute';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsExecuteRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsExecuteRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * The ID of the ruleset to execute.
- */
- id: string;
-
- /**
- * The configuration to use for matched data logging.
- */
- matched_data?: ActionParameters.MatchedData;
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- overrides?: ActionParameters.Overrides;
- }
-
- export namespace ActionParameters {
- /**
- * The configuration to use for matched data logging.
- */
- export interface MatchedData {
- /**
- * The public key to encrypt matched data logs with.
- */
- public_key: string;
- }
-
- /**
- * A set of overrides to apply to the target ruleset.
- */
- export interface Overrides {
- /**
- * An action to override all rules with. This option has lower precedence than rule
- * and category overrides.
- */
- action?: string;
-
- /**
- * A list of category-level overrides. This option has the second-highest
- * precedence after rule-level overrides.
- */
- categories?: Array;
-
- /**
- * Whether to enable execution of all rules. This option has lower precedence than
- * rule and category overrides.
- */
- enabled?: boolean;
-
- /**
- * A list of rule-level overrides. This option has the highest precedence.
- */
- rules?: Array;
-
- /**
- * A sensitivity level to set for all rules. This option has lower precedence than
- * rule and category overrides and is only applicable for DDoS phases.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- export namespace Overrides {
- /**
- * A category-level override
- */
- export interface Category {
- /**
- * The name of the category to override.
- */
- category: string;
-
- /**
- * The action to override rules in the category with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of rules in the category.
- */
- enabled?: boolean;
-
- /**
- * The sensitivity level to use for rules in the category.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
-
- /**
- * A rule-level override
- */
- export interface Rule {
- /**
- * The ID of the rule to override.
- */
- id: string;
-
- /**
- * The action to override the rule with.
- */
- action?: string;
-
- /**
- * Whether to enable execution of the rule.
- */
- enabled?: boolean;
-
- /**
- * The score threshold to use for the rule.
- */
- score_threshold?: number;
-
- /**
- * The sensitivity level to use for the rule.
- */
- sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
- }
- }
- }
- }
-
- export interface RulesetsLogRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'log';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: unknown;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export interface RulesetsSkipRule {
- /**
- * The timestamp of when the rule was last modified.
- */
- last_updated: string;
-
- /**
- * The version of the rule.
- */
- version: string;
-
- /**
- * The unique ID of the rule.
- */
- id?: string;
-
- /**
- * The action to perform when the rule matches.
- */
- action?: 'skip';
-
- /**
- * The parameters configuring the rule's action.
- */
- action_parameters?: RulesetsSkipRule.ActionParameters;
-
- /**
- * The categories of the rule.
- */
- categories?: Array;
-
- /**
- * An informative description of the rule.
- */
- description?: string;
-
- /**
- * Whether the rule should be executed.
- */
- enabled?: boolean;
-
- /**
- * The expression defining which traffic will match the rule.
- */
- expression?: string;
-
- /**
- * An object configuring the rule's logging behavior.
- */
- logging?: Shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c;
-
- /**
- * The reference of the rule (the rule ID by default).
- */
- ref?: string;
- }
-
- export namespace RulesetsSkipRule {
- /**
- * The parameters configuring the rule's action.
- */
- export interface ActionParameters {
- /**
- * A list of phases to skip the execution of. This option is incompatible with the
- * ruleset and rulesets options.
- */
- phases?: Array<
- | 'ddos_l4'
- | 'ddos_l7'
- | 'http_config_settings'
- | 'http_custom_errors'
- | 'http_log_custom_fields'
- | 'http_ratelimit'
- | 'http_request_cache_settings'
- | 'http_request_dynamic_redirect'
- | 'http_request_firewall_custom'
- | 'http_request_firewall_managed'
- | 'http_request_late_transform'
- | 'http_request_origin'
- | 'http_request_redirect'
- | 'http_request_sanitize'
- | 'http_request_sbfm'
- | 'http_request_select_configuration'
- | 'http_request_transform'
- | 'http_response_compression'
- | 'http_response_firewall_managed'
- | 'http_response_headers_transform'
- | 'magic_transit'
- | 'magic_transit_ids_managed'
- | 'magic_transit_managed'
- >;
-
- /**
- * A list of legacy security products to skip the execution of.
- */
- products?: Array<'bic' | 'hot' | 'rateLimit' | 'securityLevel' | 'uaBlock' | 'waf' | 'zoneLockdown'>;
-
- /**
- * A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- * execution of. This option is incompatible with the ruleset option.
- */
- rules?: Record>;
-
- /**
- * A ruleset to skip the execution of. This option is incompatible with the
- * rulesets, rules and phases options.
- */
- ruleset?: 'current';
-
- /**
- * A list of ruleset IDs to skip the execution of. This option is incompatible with
- * the ruleset and phases options.
- */
- rulesets?: Array;
- }
- }
-}
-
export interface VersionListParams {
/**
* The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.