import type { RiskIntelligenceRetrieveErrorResponseErrorData, RiskIntelligenceRetrieveResponse, SiteverifyErrorResponseErrorData, SiteverifyResponse } from "../api/index.js"; import { ClientErrorCode } from "./errors.js"; /** * The result of a captcha siteverify request. * * @public */ export declare class VerifyResult { private strict; /** * The HTTP status code of the response. * `-1` if there was no response. */ status: number; /** * The response from the Friendly Captcha API, or null if the request was not made at all. */ response: SiteverifyResponse | null; clientErrorType: ClientErrorCode | null; constructor(strict: boolean); /** * @returns Whether strict mode was enabled for this verification. */ isStrict(): boolean; /** * @returns Whether the captcha should be accepted. * Note that this does not necessarily mean it was verified. */ shouldAccept(): boolean; /** * @returns The reverse of `shouldAccept()`. */ shouldReject(): boolean; /** * Was unable to encode the captcha response. This means the captcha response was invalid and should never be accepted. */ isEncodeError(): boolean; /** * Something went wrong making the request to the Friendly Captcha API, perhaps there is a network connection issue? */ isRequestOrTimeoutError(): boolean; /** * Something went wrong decoding the response from the Friendly Captcha API. */ isDecodeError(): boolean; /** * Something went wrong on the client side, this generally means your configuration is wrong. * Check your secrets (API key) and sitekey. * * See `getResponseError()` for more information. */ isClientError(): boolean; /** * @returns The response from the Friendly Captcha API, or null if the request was not made at all. */ getResponse(): SiteverifyResponse | null; /** * @returns The `error` field form the response, or null if it is not present. */ getResponseError(): SiteverifyErrorResponseErrorData | null; getErrorCode(): ClientErrorCode | null; /** * Whether the request to verify the captcha was completed. In other words: the API responded with status 200.' * If this is false, you should notify yourself and use `getErrorCode()` and `getResponseError()` to see what is wrong. */ wasAbleToVerify(): boolean; } /** * The result of a risk intelligence retrieve request. * * @public */ export declare class RiskIntelligenceRetrieveResult { /** * The HTTP status code of the response. * `-1` if there was no response. */ status: number; /** * The response from the Friendly Captcha API, or null if the request was not made at all. */ response: RiskIntelligenceRetrieveResponse | null; clientErrorType: ClientErrorCode | null; /** * @returns The response from the Friendly Captcha API, or null if the request was not made at all. */ getResponse(): RiskIntelligenceRetrieveResponse | null; /** * @returns The `error` field from the response, or null if it is not present. */ getResponseError(): RiskIntelligenceRetrieveErrorResponseErrorData | null; /** * Something went wrong on the client side, this generally means your configuration is wrong. * Check your secrets (API key) and sitekey. * * See `getResponseError()` for more information. */ isClientError(): boolean; /** * Whether the request to retrieve risk intelligence was completed. In other words: the API responded with status 200. * If this is false, you should notify yourself and use `getErrorCode()` and `getResponseError()` to see what is wrong. */ wasAbleToRetrieve(): boolean; /** * @returns Whether the risk intelligence data is valid and was successfully retrieved. */ isValid(): boolean; }