cloudflare
Version:
The official TypeScript library for the Cloudflare API
182 lines • 5.97 kB
TypeScript
import { APIResource } from "../../../../../core/resource.js";
import * as ItemsAPI from "./items.js";
import { BaseItems, ItemDeleteParams, ItemDeleteResponse, ItemEditParams, ItemEditResponse, ItemGetParams, ItemGetResponse, Items } from "./items.js";
import { APIPromise } from "../../../../../core/api-promise.js";
import { PagePromise, V4PagePaginationArray, type V4PagePaginationArrayParams } from "../../../../../core/pagination.js";
import { RequestOptions } from "../../../../../internal/request-options.js";
export declare class BaseFilters extends APIResource {
static readonly _key: readonly [
'DDoSProtection',
'advancedTCPProtection',
'synProtection',
'filters'
];
/**
* Create a SYN Protection filter for an account.
*
* @example
* ```ts
* const filter =
* await client.DDoSProtection.advancedTCPProtection.synProtection.filters.create(
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* expression:
* 'ip.dst in { 192.0.2.0/24 198.51.100.0/24 } and tcp.srcport in { 80 443 10000..65535 }',
* mode: 'mode',
* },
* );
* ```
*/
create(params: FilterCreateParams, options?: RequestOptions): APIPromise<FilterCreateResponse>;
/**
* List all SYN Protection filters for an account.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const filterListResponse of client.DDoSProtection.advancedTCPProtection.synProtection.filters.list(
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* )) {
* // ...
* }
* ```
*/
list(params: FilterListParams, options?: RequestOptions): PagePromise<FilterListResponsesV4PagePaginationArray, FilterListResponse>;
/**
* Delete all SYN Protection filters for an account.
*
* @example
* ```ts
* const response =
* await client.DDoSProtection.advancedTCPProtection.synProtection.filters.bulkDelete(
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
bulkDelete(params: FilterBulkDeleteParams, options?: RequestOptions): APIPromise<FilterBulkDeleteResponse>;
}
export declare class Filters extends BaseFilters {
items: ItemsAPI.Items;
}
export type FilterListResponsesV4PagePaginationArray = V4PagePaginationArray<FilterListResponse>;
export interface FilterCreateResponse {
/**
* The unique ID of the expression filter.
*/
id: string;
/**
* The creation timestamp of the expression filter.
*/
created_on: string;
/**
* The filter expression.
*/
expression: string;
/**
* The filter's mode. Must be one of 'enabled', 'disabled', 'monitoring'.
*/
mode: string;
/**
* The last modification timestamp of the expression filter.
*/
modified_on: string;
}
export interface FilterListResponse {
/**
* The unique ID of the expression filter.
*/
id: string;
/**
* The creation timestamp of the expression filter.
*/
created_on: string;
/**
* The filter expression.
*/
expression: string;
/**
* The filter's mode. Must be one of 'enabled', 'disabled', 'monitoring'.
*/
mode: string;
/**
* The last modification timestamp of the expression filter.
*/
modified_on: string;
}
export interface FilterBulkDeleteResponse {
errors: Array<FilterBulkDeleteResponse.Error>;
messages: Array<FilterBulkDeleteResponse.Message>;
/**
* Whether the API call was successful.
*/
success: true;
}
export declare namespace FilterBulkDeleteResponse {
interface Error {
code: number;
message: string;
documentation_url?: string;
source?: Error.Source;
}
namespace Error {
interface Source {
pointer?: string;
}
}
interface Message {
code: number;
message: string;
documentation_url?: string;
source?: Message.Source;
}
namespace Message {
interface Source {
pointer?: string;
}
}
}
export interface FilterCreateParams {
/**
* Path param: The ID of the account.
*/
account_id: string;
/**
* Body param: The filter expression.
*/
expression: string;
/**
* Body param: The filter's mode. Must be one of 'enabled', 'disabled',
* 'monitoring'.
*/
mode: string;
}
export interface FilterListParams extends V4PagePaginationArrayParams {
/**
* Path param: The ID of the account.
*/
account_id: string;
/**
* Query param: The direction of ordering (ASC or DESC). Defaults to 'ASC'.
*/
direction?: string;
/**
* Query param: The mode of the filters to get. Optional. Valid values: 'enabled',
* 'disabled', 'monitoring'.
*/
mode?: string;
/**
* Query param: The field to order by. Defaults to 'prefix'.
*/
order?: string;
}
export interface FilterBulkDeleteParams {
/**
* The ID of the account.
*/
account_id: string;
}
export declare namespace Filters {
export { type FilterCreateResponse as FilterCreateResponse, type FilterListResponse as FilterListResponse, type FilterBulkDeleteResponse as FilterBulkDeleteResponse, type FilterListResponsesV4PagePaginationArray as FilterListResponsesV4PagePaginationArray, type FilterCreateParams as FilterCreateParams, type FilterListParams as FilterListParams, type FilterBulkDeleteParams as FilterBulkDeleteParams, };
export { Items as Items, BaseItems as BaseItems, type ItemDeleteResponse as ItemDeleteResponse, type ItemEditResponse as ItemEditResponse, type ItemGetResponse as ItemGetResponse, type ItemDeleteParams as ItemDeleteParams, type ItemEditParams as ItemEditParams, type ItemGetParams as ItemGetParams, };
}
//# sourceMappingURL=filters.d.ts.map