Skip to content

Commit

Permalink
feat: generate more types that are used as request bodies (#2236)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and meorphis committed Jan 13, 2025
1 parent bc092f6 commit 2ec75e4
Show file tree
Hide file tree
Showing 4 changed files with 1,468 additions and 6 deletions.
119 changes: 119 additions & 0 deletions src/resources/bot-management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,24 @@ export namespace BotFightModeConfiguration {
}
}

export interface BotFightModeConfigurationParam {
/**
* Enable rule to block AI Scrapers and Crawlers.
*/
ai_bots_protection?: 'block' | 'disabled';

/**
* Use lightweight, invisible JavaScript detections to improve Bot Management.
* [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).
*/
enable_js?: boolean;

/**
* Whether to enable Bot Fight Mode.
*/
fight_mode?: boolean;
}

export interface SubscriptionConfiguration {
/**
* Enable rule to block AI Scrapers and Crawlers.
Expand Down Expand Up @@ -243,6 +261,32 @@ export namespace SubscriptionConfiguration {
}
}

export interface SubscriptionConfigurationParam {
/**
* Enable rule to block AI Scrapers and Crawlers.
*/
ai_bots_protection?: 'block' | 'disabled';

/**
* Automatically update to the newest bot detection models created by Cloudflare as
* they are released.
* [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes)
*/
auto_update_model?: boolean;

/**
* Use lightweight, invisible JavaScript detections to improve Bot Management.
* [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).
*/
enable_js?: boolean;

/**
* Whether to disable tracking the highest bot score for a session in the Bot
* Management cookie.
*/
suppress_session_score?: boolean;
}

export interface SuperBotFightModeDefinitelyConfiguration {
/**
* Enable rule to block AI Scrapers and Crawlers.
Expand Down Expand Up @@ -309,6 +353,41 @@ export namespace SuperBotFightModeDefinitelyConfiguration {
}
}

export interface SuperBotFightModeDefinitelyConfigurationParam {
/**
* Enable rule to block AI Scrapers and Crawlers.
*/
ai_bots_protection?: 'block' | 'disabled';

/**
* Use lightweight, invisible JavaScript detections to improve Bot Management.
* [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).
*/
enable_js?: boolean;

/**
* Whether to optimize Super Bot Fight Mode protections for Wordpress.
*/
optimize_wordpress?: boolean;

/**
* Super Bot Fight Mode (SBFM) action to take on definitely automated requests.
*/
sbfm_definitely_automated?: 'allow' | 'block' | 'managed_challenge';

/**
* Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if
* static resources on your application need bot protection. Note: Static resource
* protection can also result in legitimate traffic being blocked.
*/
sbfm_static_resource_protection?: boolean;

/**
* Super Bot Fight Mode (SBFM) action to take on verified bots requests.
*/
sbfm_verified_bots?: 'allow' | 'block';
}

export interface SuperBotFightModeLikelyConfiguration {
/**
* Enable rule to block AI Scrapers and Crawlers.
Expand Down Expand Up @@ -374,6 +453,46 @@ export namespace SuperBotFightModeLikelyConfiguration {
}
}

export interface SuperBotFightModeLikelyConfigurationParam {
/**
* Enable rule to block AI Scrapers and Crawlers.
*/
ai_bots_protection?: 'block' | 'disabled';

/**
* Use lightweight, invisible JavaScript detections to improve Bot Management.
* [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).
*/
enable_js?: boolean;

/**
* Whether to optimize Super Bot Fight Mode protections for Wordpress.
*/
optimize_wordpress?: boolean;

/**
* Super Bot Fight Mode (SBFM) action to take on definitely automated requests.
*/
sbfm_definitely_automated?: 'allow' | 'block' | 'managed_challenge';

/**
* Super Bot Fight Mode (SBFM) action to take on likely automated requests.
*/
sbfm_likely_automated?: 'allow' | 'block' | 'managed_challenge';

/**
* Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if
* static resources on your application need bot protection. Note: Static resource
* protection can also result in legitimate traffic being blocked.
*/
sbfm_static_resource_protection?: boolean;

/**
* Super Bot Fight Mode (SBFM) action to take on verified bots requests.
*/
sbfm_verified_bots?: 'allow' | 'block';
}

export type BotManagementUpdateResponse =
| BotFightModeConfiguration
| SuperBotFightModeDefinitelyConfiguration
Expand Down
13 changes: 13 additions & 0 deletions src/resources/dns/records.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,12 @@ export interface RecordProcessTiming {
*/
export type RecordTags = string;

/**
* Individual tag of the form name:value (the name must consist of only letters,
* numbers, underscores and hyphens)
*/
export type RecordTagsParam = string;

export interface SMIMEARecord {
/**
* Formatted SMIMEA content. See 'data' to set SMIMEA properties.
Expand Down Expand Up @@ -1548,6 +1554,13 @@ export namespace TLSARecordParam {
*/
export type TTL = number | 1;

/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
export type TTLParam = number | 1;

export interface TXTRecord {
/**
* Text content for the record. The content must consist of quoted "character
Expand Down
Loading

0 comments on commit 2ec75e4

Please sign in to comment.