/** * This file was auto-generated by Fern from our API Definition. */ import * as environments from "../../../../environments"; import * as core from "../../../../core"; import * as XCaptchaApi from "../../../index"; export declare namespace Challenge { interface Options { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; apiKey: core.Supplier; /** Override the X-Secret-Key header */ secretKey: core.Supplier; } interface RequestOptions { /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the X-Secret-Key header */ secretKey?: string; /** Additional headers to include in the request. */ headers?: Record; } } export declare class Challenge { protected readonly _options: Challenge.Options; constructor(_options: Challenge.Options); /** * This method is used for solving `Challenge` * * @param {string} challenge - Challenge identifier * @param {XCaptchaApi.ChallengeSolveRequestBody} request * @param {Challenge.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link XCaptchaApi.BadRequestError} * @throws {@link XCaptchaApi.UnauthorizedError} * @throws {@link XCaptchaApi.NotFoundError} * @throws {@link XCaptchaApi.InternalServerError} * * @example * await client.challenge.solve("2559c4b6-98a3-4f60-a6bc-13e22ccf2908", { * solution: { * type: "click", * data: true * } * }) */ solve(challenge: string, request: XCaptchaApi.ChallengeSolveRequestBody, requestOptions?: Challenge.RequestOptions): Promise; /** * This method is used for verifying `Challenge` * * @param {string} challenge - Challenge identifier * @param {XCaptchaApi.ChallengeVerifyRequestBody} request * @param {Challenge.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link XCaptchaApi.BadRequestError} * @throws {@link XCaptchaApi.UnauthorizedError} * @throws {@link XCaptchaApi.NotFoundError} * @throws {@link XCaptchaApi.InternalServerError} * * @example * await client.challenge.verify("d9c2a6b1-0e75-4a57-8197-82ab105539a2", { * token: "6dd245b7-793d-406a-872a-09811fc65d5d" * }) */ verify(challenge: string, request: XCaptchaApi.ChallengeVerifyRequestBody, requestOptions?: Challenge.RequestOptions): Promise; /** * This method is used for creating `Challenge` * * @param {XCaptchaApi.ChallengeCreateBody} request * @param {Challenge.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link XCaptchaApi.UnauthorizedError} * @throws {@link XCaptchaApi.InternalServerError} * * @example * await client.challenge.create({ * type: "click" * }) */ create(request: XCaptchaApi.ChallengeCreateBody, requestOptions?: Challenge.RequestOptions): Promise; protected _getCustomAuthorizationHeaders(): Promise<{ "X-Public-Key": string; }>; }