UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

128 lines • 3.8 kB
import { APIResource } from "../../core/resource.js"; import { APIPromise } from "../../core/api-promise.js"; import { RequestOptions } from "../../internal/request-options.js"; export declare class BaseFieldExtractors extends APIResource { static readonly _key: readonly ['fieldExtractors']; /** * Replaces all custom extraction rules for an extractor type. Omitted rules are * deleted. */ update(extractor: string, params: FieldExtractorUpdateParams, options?: RequestOptions): APIPromise<FieldExtractorUpdateResponse>; /** * Deletes all custom extraction rules for an extractor type. */ delete(extractor: string, params: FieldExtractorDeleteParams, options?: RequestOptions): APIPromise<FieldExtractorDeleteResponse | null>; /** * Retrieves the custom extraction rules configured for a given extractor type. */ get(extractor: string, params: FieldExtractorGetParams, options?: RequestOptions): APIPromise<FieldExtractorGetResponse>; } export declare class FieldExtractors extends BaseFieldExtractors { } export interface FieldExtractorUpdateResponse { /** * Extractor type. */ extractor: string; rules: Array<FieldExtractorUpdateResponse.Rule>; } export declare namespace FieldExtractorUpdateResponse { interface Rule { fields: Array<Rule.Field>; /** * Stable rule identifier. */ ref: string; /** * Human-readable rule description. */ description?: string; } namespace Rule { interface Field { /** * Wirefilter value expression. */ expression: string; /** * Field name. */ name: string; } } } /** * Result is null. */ export type FieldExtractorDeleteResponse = unknown; export interface FieldExtractorGetResponse { /** * Extractor type. */ extractor: string; rules: Array<FieldExtractorGetResponse.Rule>; } export declare namespace FieldExtractorGetResponse { interface Rule { fields: Array<Rule.Field>; /** * Stable rule identifier. */ ref: string; /** * Human-readable rule description. */ description?: string; } namespace Rule { interface Field { /** * Wirefilter value expression. */ expression: string; /** * Field name. */ name: string; } } } export interface FieldExtractorUpdateParams { /** * Path param: Cloudflare account ID. */ account_id: string; /** * Body param */ rules: Array<FieldExtractorUpdateParams.Rule>; } export declare namespace FieldExtractorUpdateParams { interface Rule { fields: Array<Rule.Field>; ref: string; description?: string; } namespace Rule { interface Field { expression: string; name: string; } } } export interface FieldExtractorDeleteParams { /** * Cloudflare account ID. */ account_id: string; } export interface FieldExtractorGetParams { /** * Cloudflare account ID. */ account_id: string; } export declare namespace FieldExtractors { export { type FieldExtractorUpdateResponse as FieldExtractorUpdateResponse, type FieldExtractorDeleteResponse as FieldExtractorDeleteResponse, type FieldExtractorGetResponse as FieldExtractorGetResponse, type FieldExtractorUpdateParams as FieldExtractorUpdateParams, type FieldExtractorDeleteParams as FieldExtractorDeleteParams, type FieldExtractorGetParams as FieldExtractorGetParams, }; } //# sourceMappingURL=field-extractors.d.ts.map