Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Mar 21, 2024
1 parent 024ba76 commit 5b84f38
Show file tree
Hide file tree
Showing 23 changed files with 10,655 additions and 2,267 deletions.
176 changes: 125 additions & 51 deletions src/resources/bot-management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,66 +307,140 @@ export namespace BotManagementGetResponse {
}
}

export interface BotManagementUpdateParams {
/**
* Path param: Identifier
*/
zone_id: string;
export type BotManagementUpdateParams =
| BotManagementUpdateParams.BotManagementBotFightModeConfig
| BotManagementUpdateParams.BotManagementSbfmDefinitelyConfig
| BotManagementUpdateParams.BotManagementSbfmLikelyConfig
| BotManagementUpdateParams.BotManagementBmSubscriptionConfig;

/**
* Body param: 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;
export namespace BotManagementUpdateParams {
export interface BotManagementBotFightModeConfig {
/**
* Path param: Identifier
*/
zone_id: string;

/**
* Body param: 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;
/**
* Body param: 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;

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

/**
* Body param: Whether to optimize Super Bot Fight Mode protections for Wordpress.
*/
optimize_wordpress?: boolean;
export interface BotManagementSbfmDefinitelyConfig {
/**
* Path param: Identifier
*/
zone_id: string;

/**
* Body param: Super Bot Fight Mode (SBFM) action to take on definitely automated
* requests.
*/
sbfm_definitely_automated?: 'allow' | 'block' | 'managed_challenge';
/**
* Body param: 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;

/**
* Body param: Super Bot Fight Mode (SBFM) action to take on likely automated
* requests.
*/
sbfm_likely_automated?: 'allow' | 'block' | 'managed_challenge';
/**
* Body param: Whether to optimize Super Bot Fight Mode protections for Wordpress.
*/
optimize_wordpress?: boolean;

/**
* Body param: 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;
/**
* Body param: Super Bot Fight Mode (SBFM) action to take on definitely automated
* requests.
*/
sbfm_definitely_automated?: 'allow' | 'block' | 'managed_challenge';

/**
* Body param: Super Bot Fight Mode (SBFM) action to take on verified bots
* requests.
*/
sbfm_verified_bots?: 'allow' | 'block';
/**
* Body param: 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;

/**
* Body param: Whether to disable tracking the highest bot score for a session in
* the Bot Management cookie.
*/
suppress_session_score?: boolean;
/**
* Body param: Super Bot Fight Mode (SBFM) action to take on verified bots
* requests.
*/
sbfm_verified_bots?: 'allow' | 'block';
}

export interface BotManagementSbfmLikelyConfig {
/**
* Path param: Identifier
*/
zone_id: string;

/**
* Body param: 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;

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

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

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

/**
* Body param: 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;

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

export interface BotManagementBmSubscriptionConfig {
/**
* Path param: Identifier
*/
zone_id: string;

/**
* Body param: 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;

/**
* Body param: 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;

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

export interface BotManagementGetParams {
Expand Down
97 changes: 67 additions & 30 deletions src/resources/cache/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,43 +64,80 @@ export interface CachePurgeResponse {
id: string;
}

export interface CachePurgeParams {
/**
* Path param:
*/
zone_id: string;
export type CachePurgeParams =
| CachePurgeParams.CachePurgeTags
| CachePurgeParams.CachePurgeHosts
| CachePurgeParams.CachePurgePrefixes
| CachePurgeParams.CachePurgeEverything
| CachePurgeParams.CachePurgeFiles;

/**
* Body param:
*/
files?: Array<string | CachePurgeParams.CachePurgeURLAndHeaders>;
export namespace CachePurgeParams {
export interface CachePurgeTags {
/**
* Path param:
*/
zone_id: string;

/**
* Body param:
*/
hosts?: Array<string>;
/**
* Body param:
*/
tags?: Array<string>;
}

/**
* Body param:
*/
prefixes?: Array<string>;
export interface CachePurgeHosts {
/**
* Path param:
*/
zone_id: string;

/**
* Body param:
*/
purge_everything?: boolean;
/**
* Body param:
*/
hosts?: Array<string>;
}

/**
* Body param:
*/
tags?: Array<string>;
}
export interface CachePurgePrefixes {
/**
* Path param:
*/
zone_id: string;

export namespace CachePurgeParams {
export interface CachePurgeURLAndHeaders {
headers?: unknown;
/**
* Body param:
*/
prefixes?: Array<string>;
}

export interface CachePurgeEverything {
/**
* Path param:
*/
zone_id: string;

/**
* Body param:
*/
purge_everything?: boolean;
}

export interface CachePurgeFiles {
/**
* Path param:
*/
zone_id: string;

/**
* Body param:
*/
files?: Array<string | CachePurgeParams.CachePurgeFiles.CachePurgeURLAndHeaders>;
}

export namespace CachePurgeFiles {
export interface CachePurgeURLAndHeaders {
headers?: unknown;

url?: string;
url?: string;
}
}
}

Expand Down
Loading

0 comments on commit 5b84f38

Please sign in to comment.