Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): api update #2102

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1397
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b2ba1107ac358119a40fb6ff04ef71393204afba24220e4b9f1611dcccd85b00.yml
configured_endpoints: 1361
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bc0b27a6ed686a5f7ea5742498072a682dae635643c49cea95a3e5292868faa3.yml
79 changes: 0 additions & 79 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1189,15 +1189,6 @@ Methods:
Types:

- <code><a href="./src/resources/filters.ts">FirewallFilter</a></code>
- <code><a href="./src/resources/filters.ts">FilterCreateResponse</a></code>

Methods:

- <code title="post /zones/{zone_id}/filters">client.filters.<a href="./src/resources/filters.ts">create</a>({ ...params }) -> FilterCreateResponse | null</code>
- <code title="put /zones/{zone_id}/filters/{filter_id}">client.filters.<a href="./src/resources/filters.ts">update</a>(filterId, { ...params }) -> FirewallFilter</code>
- <code title="get /zones/{zone_id}/filters">client.filters.<a href="./src/resources/filters.ts">list</a>({ ...params }) -> FirewallFiltersV4PagePaginationArray</code>
- <code title="delete /zones/{zone_id}/filters/{filter_id}">client.filters.<a href="./src/resources/filters.ts">delete</a>(filterId, { ...params }) -> FirewallFilter</code>
- <code title="get /zones/{zone_id}/filters/{filter_id}">client.filters.<a href="./src/resources/filters.ts">get</a>(filterId, { ...params }) -> FirewallFilter</code>

# Firewall

Expand All @@ -1210,15 +1201,6 @@ Types:
- <code><a href="./src/resources/firewall/lockdowns.ts">LockdownCIDRConfiguration</a></code>
- <code><a href="./src/resources/firewall/lockdowns.ts">LockdownIPConfiguration</a></code>
- <code><a href="./src/resources/firewall/lockdowns.ts">LockdownURL</a></code>
- <code><a href="./src/resources/firewall/lockdowns.ts">LockdownDeleteResponse</a></code>

Methods:

- <code title="post /zones/{zone_id}/firewall/lockdowns">client.firewall.lockdowns.<a href="./src/resources/firewall/lockdowns.ts">create</a>({ ...params }) -> Lockdown</code>
- <code title="put /zones/{zone_id}/firewall/lockdowns/{lock_downs_id}">client.firewall.lockdowns.<a href="./src/resources/firewall/lockdowns.ts">update</a>(lockDownsId, { ...params }) -> Lockdown</code>
- <code title="get /zones/{zone_id}/firewall/lockdowns">client.firewall.lockdowns.<a href="./src/resources/firewall/lockdowns.ts">list</a>({ ...params }) -> LockdownsV4PagePaginationArray</code>
- <code title="delete /zones/{zone_id}/firewall/lockdowns/{lock_downs_id}">client.firewall.lockdowns.<a href="./src/resources/firewall/lockdowns.ts">delete</a>(lockDownsId, { ...params }) -> LockdownDeleteResponse</code>
- <code title="get /zones/{zone_id}/firewall/lockdowns/{lock_downs_id}">client.firewall.lockdowns.<a href="./src/resources/firewall/lockdowns.ts">get</a>(lockDownsId, { ...params }) -> Lockdown</code>

## Rules

Expand All @@ -1227,17 +1209,6 @@ Types:
- <code><a href="./src/resources/firewall/rules.ts">FirewallRule</a></code>
- <code><a href="./src/resources/firewall/rules.ts">Product</a></code>
- <code><a href="./src/resources/firewall/rules.ts">DeletedFilter</a></code>
- <code><a href="./src/resources/firewall/rules.ts">RuleCreateResponse</a></code>
- <code><a href="./src/resources/firewall/rules.ts">RuleEditResponse</a></code>

Methods:

- <code title="post /zones/{zone_id}/firewall/rules">client.firewall.rules.<a href="./src/resources/firewall/rules.ts">create</a>({ ...params }) -> RuleCreateResponse | null</code>
- <code title="put /zones/{zone_id}/firewall/rules/{rule_id}">client.firewall.rules.<a href="./src/resources/firewall/rules.ts">update</a>(ruleId, { ...params }) -> FirewallRule</code>
- <code title="get /zones/{zone_id}/firewall/rules">client.firewall.rules.<a href="./src/resources/firewall/rules.ts">list</a>({ ...params }) -> FirewallRulesV4PagePaginationArray</code>
- <code title="delete /zones/{zone_id}/firewall/rules/{rule_id}">client.firewall.rules.<a href="./src/resources/firewall/rules.ts">delete</a>(ruleId, { ...params }) -> FirewallRule</code>
- <code title="patch /zones/{zone_id}/firewall/rules/{rule_id}">client.firewall.rules.<a href="./src/resources/firewall/rules.ts">edit</a>(ruleId, { ...params }) -> RuleEditResponse | null</code>
- <code title="get /zones/{zone_id}/firewall/rules/{rule_id}">client.firewall.rules.<a href="./src/resources/firewall/rules.ts">get</a>(ruleId, { ...params }) -> FirewallRule</code>

## AccessRules

Expand All @@ -1250,36 +1221,14 @@ Types:
- <code><a href="./src/resources/firewall/access-rules.ts">IPV6Configuration</a></code>
- <code><a href="./src/resources/firewall/access-rules.ts">AccessRuleCreateResponse</a></code>
- <code><a href="./src/resources/firewall/access-rules.ts">AccessRuleListResponse</a></code>
- <code><a href="./src/resources/firewall/access-rules.ts">AccessRuleDeleteResponse</a></code>
- <code><a href="./src/resources/firewall/access-rules.ts">AccessRuleEditResponse</a></code>
- <code><a href="./src/resources/firewall/access-rules.ts">AccessRuleGetResponse</a></code>

Methods:

- <code title="post /{account_or_zone}/{account_or_zone_id}/firewall/access_rules/rules">client.firewall.accessRules.<a href="./src/resources/firewall/access-rules.ts">create</a>({ ...params }) -> AccessRuleCreateResponse</code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/firewall/access_rules/rules">client.firewall.accessRules.<a href="./src/resources/firewall/access-rules.ts">list</a>({ ...params }) -> AccessRuleListResponsesV4PagePaginationArray</code>
- <code title="delete /{account_or_zone}/{account_or_zone_id}/firewall/access_rules/rules/{rule_id}">client.firewall.accessRules.<a href="./src/resources/firewall/access-rules.ts">delete</a>(ruleId, { ...params }) -> AccessRuleDeleteResponse | null</code>
- <code title="patch /{account_or_zone}/{account_or_zone_id}/firewall/access_rules/rules/{rule_id}">client.firewall.accessRules.<a href="./src/resources/firewall/access-rules.ts">edit</a>(ruleId, { ...params }) -> AccessRuleEditResponse</code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/firewall/access_rules/rules/{rule_id}">client.firewall.accessRules.<a href="./src/resources/firewall/access-rules.ts">get</a>(ruleId, { ...params }) -> AccessRuleGetResponse</code>

## UARules

Types:

- <code><a href="./src/resources/firewall/ua-rules.ts">UARuleCreateResponse</a></code>
- <code><a href="./src/resources/firewall/ua-rules.ts">UARuleUpdateResponse</a></code>
- <code><a href="./src/resources/firewall/ua-rules.ts">UARuleListResponse</a></code>
- <code><a href="./src/resources/firewall/ua-rules.ts">UARuleDeleteResponse</a></code>
- <code><a href="./src/resources/firewall/ua-rules.ts">UARuleGetResponse</a></code>

Methods:

- <code title="post /zones/{zone_id}/firewall/ua_rules">client.firewall.uaRules.<a href="./src/resources/firewall/ua-rules.ts">create</a>({ ...params }) -> UARuleCreateResponse</code>
- <code title="put /zones/{zone_id}/firewall/ua_rules/{ua_rule_id}">client.firewall.uaRules.<a href="./src/resources/firewall/ua-rules.ts">update</a>(uaRuleId, { ...params }) -> UARuleUpdateResponse</code>
- <code title="get /zones/{zone_id}/firewall/ua_rules">client.firewall.uaRules.<a href="./src/resources/firewall/ua-rules.ts">list</a>({ ...params }) -> UARuleListResponsesV4PagePaginationArray</code>
- <code title="delete /zones/{zone_id}/firewall/ua_rules/{ua_rule_id}">client.firewall.uaRules.<a href="./src/resources/firewall/ua-rules.ts">delete</a>(uaRuleId, { ...params }) -> UARuleDeleteResponse</code>
- <code title="get /zones/{zone_id}/firewall/ua_rules/{ua_rule_id}">client.firewall.uaRules.<a href="./src/resources/firewall/ua-rules.ts">get</a>(uaRuleId, { ...params }) -> UARuleGetResponse</code>

## WAF

### Overrides
Expand All @@ -1290,28 +1239,9 @@ Types:
- <code><a href="./src/resources/firewall/waf/overrides.ts">OverrideURL</a></code>
- <code><a href="./src/resources/firewall/waf/overrides.ts">RewriteAction</a></code>
- <code><a href="./src/resources/firewall/waf/overrides.ts">WAFRule</a></code>
- <code><a href="./src/resources/firewall/waf/overrides.ts">OverrideDeleteResponse</a></code>

Methods:

- <code title="post /zones/{zone_id}/firewall/waf/overrides">client.firewall.waf.overrides.<a href="./src/resources/firewall/waf/overrides.ts">create</a>({ ...params }) -> Override</code>
- <code title="put /zones/{zone_id}/firewall/waf/overrides/{overrides_id}">client.firewall.waf.overrides.<a href="./src/resources/firewall/waf/overrides.ts">update</a>(overridesId, { ...params }) -> Override</code>
- <code title="get /zones/{zone_id}/firewall/waf/overrides">client.firewall.waf.overrides.<a href="./src/resources/firewall/waf/overrides.ts">list</a>({ ...params }) -> OverridesV4PagePaginationArray</code>
- <code title="delete /zones/{zone_id}/firewall/waf/overrides/{overrides_id}">client.firewall.waf.overrides.<a href="./src/resources/firewall/waf/overrides.ts">delete</a>(overridesId, { ...params }) -> OverrideDeleteResponse</code>
- <code title="get /zones/{zone_id}/firewall/waf/overrides/{overrides_id}">client.firewall.waf.overrides.<a href="./src/resources/firewall/waf/overrides.ts">get</a>(overridesId, { ...params }) -> Override</code>

### Packages

Types:

- <code><a href="./src/resources/firewall/waf/packages/packages.ts">PackageListResponse</a></code>
- <code><a href="./src/resources/firewall/waf/packages/packages.ts">PackageGetResponse</a></code>

Methods:

- <code title="get /zones/{zone_id}/firewall/waf/packages">client.firewall.waf.packages.<a href="./src/resources/firewall/waf/packages/packages.ts">list</a>({ ...params }) -> PackageListResponsesV4PagePaginationArray</code>
- <code title="get /zones/{zone_id}/firewall/waf/packages/{package_id}">client.firewall.waf.packages.<a href="./src/resources/firewall/waf/packages/packages.ts">get</a>(packageId, { ...params }) -> PackageGetResponse</code>

#### Groups

Types:
Expand Down Expand Up @@ -1620,15 +1550,6 @@ Types:
- <code><a href="./src/resources/rate-limits.ts">Action</a></code>
- <code><a href="./src/resources/rate-limits.ts">Methods</a></code>
- <code><a href="./src/resources/rate-limits.ts">RateLimit</a></code>
- <code><a href="./src/resources/rate-limits.ts">RateLimitDeleteResponse</a></code>

Methods:

- <code title="post /zones/{zone_id}/rate_limits">client.rateLimits.<a href="./src/resources/rate-limits.ts">create</a>({ ...params }) -> RateLimit</code>
- <code title="get /zones/{zone_id}/rate_limits">client.rateLimits.<a href="./src/resources/rate-limits.ts">list</a>({ ...params }) -> RateLimitsV4PagePaginationArray</code>
- <code title="delete /zones/{zone_id}/rate_limits/{rate_limit_id}">client.rateLimits.<a href="./src/resources/rate-limits.ts">delete</a>(rateLimitId, { ...params }) -> RateLimitDeleteResponse</code>
- <code title="put /zones/{zone_id}/rate_limits/{rate_limit_id}">client.rateLimits.<a href="./src/resources/rate-limits.ts">edit</a>(rateLimitId, { ...params }) -> RateLimit</code>
- <code title="get /zones/{zone_id}/rate_limits/{rate_limit_id}">client.rateLimits.<a href="./src/resources/rate-limits.ts">get</a>(rateLimitId, { ...params }) -> RateLimit</code>

# SecondaryDNS

Expand Down
192 changes: 1 addition & 191 deletions src/resources/filters.ts
Original file line number Diff line number Diff line change
@@ -1,101 +1,8 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../resource';
import * as Core from '../core';
import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../pagination';

export class Filters extends APIResource {
/**
* Creates one or more filters.
*
* @deprecated The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details.
*/
create(
params: FilterCreateParams,
options?: Core.RequestOptions,
): Core.APIPromise<FilterCreateResponse | null> {
const { zone_id, ...body } = params;
return (
this._client.post(`/zones/${zone_id}/filters`, { body, ...options }) as Core.APIPromise<{
result: FilterCreateResponse | null;
}>
)._thenUnwrap((obj) => obj.result);
}

/**
* Updates an existing filter.
*
* @deprecated The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details.
*/
update(
filterId: string,
params: FilterUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<FirewallFilter> {
const { zone_id, body } = params;
return (
this._client.put(`/zones/${zone_id}/filters/${filterId}`, {
body: body,
...options,
}) as Core.APIPromise<{ result: FirewallFilter }>
)._thenUnwrap((obj) => obj.result);
}

/**
* Fetches filters in a zone. You can filter the results using several optional
* parameters.
*
* @deprecated The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details.
*/
list(
params: FilterListParams,
options?: Core.RequestOptions,
): Core.PagePromise<FirewallFiltersV4PagePaginationArray, FirewallFilter> {
const { zone_id, ...query } = params;
return this._client.getAPIList(`/zones/${zone_id}/filters`, FirewallFiltersV4PagePaginationArray, {
query,
...options,
});
}

/**
* Deletes an existing filter.
*
* @deprecated The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details.
*/
delete(
filterId: string,
params: FilterDeleteParams,
options?: Core.RequestOptions,
): Core.APIPromise<FirewallFilter> {
const { zone_id } = params;
return (
this._client.delete(`/zones/${zone_id}/filters/${filterId}`, options) as Core.APIPromise<{
result: FirewallFilter;
}>
)._thenUnwrap((obj) => obj.result);
}

/**
* Fetches the details of a filter.
*
* @deprecated The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details.
*/
get(
filterId: string,
params: FilterGetParams,
options?: Core.RequestOptions,
): Core.APIPromise<FirewallFilter> {
const { zone_id } = params;
return (
this._client.get(`/zones/${zone_id}/filters/${filterId}`, options) as Core.APIPromise<{
result: FirewallFilter;
}>
)._thenUnwrap((obj) => obj.result);
}
}

export class FirewallFiltersV4PagePaginationArray extends V4PagePaginationArray<FirewallFilter> {}
export class Filters extends APIResource {}

export interface FirewallFilter {
/**
Expand Down Expand Up @@ -124,100 +31,3 @@ export interface FirewallFilter {
*/
ref?: string;
}

export interface FirewallFilterParam {
/**
* An informative summary of the filter.
*/
description?: string;

/**
* The filter expression. For more information, refer to
* [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).
*/
expression?: string;

/**
* When true, indicates that the filter is currently paused.
*/
paused?: boolean;

/**
* A short reference tag. Allows you to select related filters.
*/
ref?: string;
}

export type FilterCreateResponse = Array<FirewallFilter>;

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

/**
* Body param: The filter expression. For more information, refer to
* [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).
*/
expression: string;
}

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

/**
* Body param:
*/
body: unknown;
}

export interface FilterListParams extends V4PagePaginationArrayParams {
/**
* Path param: Identifier
*/
zone_id: string;

/**
* Query param: The unique identifier of the filter.
*/
id?: string;

/**
* Query param: A case-insensitive string to find in the description.
*/
description?: string;

/**
* Query param: A case-insensitive string to find in the expression.
*/
expression?: string;

/**
* Query param: When true, indicates that the filter is currently paused.
*/
paused?: boolean;

/**
* Query param: The filter ref (a short reference tag) to search for. Must be an
* exact match.
*/
ref?: string;
}

export interface FilterDeleteParams {
/**
* Identifier
*/
zone_id: string;
}

export interface FilterGetParams {
/**
* Identifier
*/
zone_id: string;
}
Loading