UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

193 lines 6.5 kB
import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import * as ItemsAPI from 'cloudflare/resources/rules/lists/items'; import * as ListsAPI from 'cloudflare/resources/rules/lists/lists'; import { CursorPagination, type CursorPaginationParams } from 'cloudflare/pagination'; export declare class Items extends APIResource { /** * Appends new items to the list. * * This operation is asynchronous. To get current the operation status, invoke the * [Get bulk operation status](/operations/lists-get-bulk-operation-status) * endpoint with the returned `operation_id`. */ create(listId: string, params: ItemCreateParams, options?: Core.RequestOptions): Core.APIPromise<ItemCreateResponse | null>; /** * Removes all existing items from the list and adds the provided items to the * list. * * This operation is asynchronous. To get current the operation status, invoke the * [Get bulk operation status](/operations/lists-get-bulk-operation-status) * endpoint with the returned `operation_id`. */ update(listId: string, params: ItemUpdateParams, options?: Core.RequestOptions): Core.APIPromise<ItemUpdateResponse | null>; /** * Fetches all the items in the list. */ list(listId: string, params: ItemListParams, options?: Core.RequestOptions): Core.PagePromise<ItemListResponsesCursorPagination, ItemListResponse>; /** * Removes one or more items from a list. * * This operation is asynchronous. To get current the operation status, invoke the * [Get bulk operation status](/operations/lists-get-bulk-operation-status) * endpoint with the returned `operation_id`. */ delete(listId: string, params: ItemDeleteParams, options?: Core.RequestOptions): Core.APIPromise<ItemDeleteResponse | null>; /** * Fetches a list item in the list. */ get(accountIdentifier: string, listId: string, itemId: string, options?: Core.RequestOptions): Core.APIPromise<ItemGetResponse | null>; } export declare class ItemListResponsesCursorPagination extends CursorPagination<ItemListResponse> { } export interface ListCursor { after?: string; before?: string; } export interface ListItem { /** * The unique operation ID of the asynchronous action. */ operation_id?: string; } export interface ItemCreateResponse { /** * The unique operation ID of the asynchronous action. */ operation_id?: string; } export interface ItemUpdateResponse { /** * The unique operation ID of the asynchronous action. */ operation_id?: string; } export type ItemListResponse = unknown; export interface ItemDeleteResponse { /** * The unique operation ID of the asynchronous action. */ operation_id?: string; } /** * An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a * maximum of /64. */ export type ItemGetResponse = string | ListsAPI.Redirect | ListsAPI.Hostname | number; export interface ItemCreateParams { /** * Path param: Identifier */ account_id: string; /** * Body param: */ body: Array<ItemCreateParams.Body>; } export declare namespace ItemCreateParams { interface Body { /** * A non-negative 32 bit integer */ asn?: number; /** * An informative summary of the list item. */ comment?: string; /** * Valid characters for hostnames are ASCII(7) letters from a to z, the digits from * 0 to 9, wildcards (\*), and the hyphen (-). */ hostname?: ListsAPI.Hostname; /** * An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a * maximum of /64. */ ip?: string; /** * The definition of the redirect. */ redirect?: ListsAPI.Redirect; } } export interface ItemUpdateParams { /** * Path param: Identifier */ account_id: string; /** * Body param: */ body: Array<ItemUpdateParams.Body>; } export declare namespace ItemUpdateParams { interface Body { /** * A non-negative 32 bit integer */ asn?: number; /** * An informative summary of the list item. */ comment?: string; /** * Valid characters for hostnames are ASCII(7) letters from a to z, the digits from * 0 to 9, wildcards (\*), and the hyphen (-). */ hostname?: ListsAPI.Hostname; /** * An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a * maximum of /64. */ ip?: string; /** * The definition of the redirect. */ redirect?: ListsAPI.Redirect; } } export interface ItemListParams extends CursorPaginationParams { /** * Path param: Identifier */ account_id: string; /** * Query param: A search query to filter returned items. Its meaning depends on the * list type: IP addresses must start with the provided string, hostnames and bulk * redirects must contain the string, and ASNs must match the string exactly. */ search?: string; } export interface ItemDeleteParams { /** * Path param: Identifier */ account_id: string; /** * Body param: */ items?: Array<ItemDeleteParams.Item>; } export declare namespace ItemDeleteParams { interface Item { /** * The unique ID of the item in the List. */ id?: string; } } export declare namespace Items { export import ListCursor = ItemsAPI.ListCursor; export import ListItem = ItemsAPI.ListItem; export import ItemCreateResponse = ItemsAPI.ItemCreateResponse; export import ItemUpdateResponse = ItemsAPI.ItemUpdateResponse; export import ItemListResponse = ItemsAPI.ItemListResponse; export import ItemDeleteResponse = ItemsAPI.ItemDeleteResponse; export import ItemGetResponse = ItemsAPI.ItemGetResponse; export import ItemListResponsesCursorPagination = ItemsAPI.ItemListResponsesCursorPagination; export import ItemCreateParams = ItemsAPI.ItemCreateParams; export import ItemUpdateParams = ItemsAPI.ItemUpdateParams; export import ItemListParams = ItemsAPI.ItemListParams; export import ItemDeleteParams = ItemsAPI.ItemDeleteParams; } //# sourceMappingURL=items.d.ts.map