UNPKG

@captcha-libs/capguru

Version:

CapGuru NodeJS client, captcha recognition service

767 lines (735 loc) 32.2 kB
import { CaptchaClient } from '@captcha-libs/captcha-client'; type CaptchaClientParams = { "baseUrl"?: string; "clientKey": string; "pollingInterval"?: number; "timeout"?: number; }; type CapGuruResponse<TRequest> = { "request": TRequest; "status": number; }; type CapGuruSolution<TSolution> = CapGuruResponse<string> & { "solution": TSolution | undefined; }; declare const _TaskMethods: readonly ["hcaptcha", "base64", "turnstile", "hcaptcha", "userrecaptcha"]; type TaskMethods = typeof _TaskMethods[keyof typeof _TaskMethods]; type ProxyTypes = "HTTP" | "HTTPS" | "SOCKS4" | "SOCKS5"; interface BaseParams { "method": TaskMethods; } type SolutionTypes = "isGrid" | "isMultipleCoordinates" | "isSingleCoordinate" | "isString"; type TaskSolutionTypes = { [type in SolutionTypes]?: boolean; }; /** * @classdesc BaseTask for CapGuru tasks * @class */ declare abstract class BaseTask { /** * @type {TaskMethods} method - task type/method */ protected method: TaskMethods; constructor({ method }: BaseParams); } type TClick = "funcap2" | "geetest" | "geetest2" | "hcap" | "hcap2" | "oth" | "recap" | "recap2"; interface RecognitionBaseParams extends Omit<BaseParams, "method"> { "body": string; "click": TClick; "textinstructions": string; } declare class RecognitionBaseTask extends BaseTask implements RecognitionBaseParams { click: TClick; body: string; textinstructions: string; constructor({ click, body, textinstructions }: RecognitionBaseParams); } type AmazonCarPathParams = Omit<RecognitionBaseParams, "click" | "textinstructions">; /** * @classdesc Amazon Car path task * @class * @extends {RecognitionBaseTask} * @see {@link https://docs.cap.guru/en/apiclick/binance.html} */ declare class AmazonCarPathTask extends RecognitionBaseTask implements AmazonCarPathParams, TaskSolutionTypes { /** * Create Amazon car path task * This task uses click='oth' and textinstructions='Amazon,Place a dot at the end of the car's path' * @see {@link https://docs.cap.guru/en/apiclick/aws.html} * @param {AmazonCarPathParams} params - params * @param {string} [params.body] - Image encoded in Base64 format */ constructor(params: AmazonCarPathParams); /** * @type {boolean} isSingleCoordinate - only used for correctly working method overloading intellisense */ isSingleCoordinate: TaskSolutionTypes["isSingleCoordinate"]; } type AmazonPuzzleParams = Omit<RecognitionBaseParams, "click">; /** * @classdesc Amazon Puzzle task * @class * @extends {RecognitionBaseTask} * @see {@link https://docs.cap.guru/en/apiclick/aws.html} */ declare class AmazonPuzzleTask extends RecognitionBaseTask implements AmazonPuzzleParams, TaskSolutionTypes { /** * Create Amazon puzzle task * This task uses click='geetest' and textinstructions='slider' * @see {@link https://docs.cap.guru/en/apiclick/aws.html} * @param {AmazonPuzzleParams} params - params * @param {string} [params.textinstructions] - For example: Slide the image to complete the pyramid. Tasks are supported only in English! * @param {string} [params.body] - Image encoded in Base64 format */ constructor(params: AmazonPuzzleParams); /** * @type {boolean} isSingleCoordinate - only used for correctly working method overloading intellisense */ isSingleCoordinate: TaskSolutionTypes["isSingleCoordinate"]; } type BinanceGridParams = Omit<RecognitionBaseParams, "click"> & { "textinstructions": string; }; /** * @classdesc Binance Grid (3x3) task * @class * @extends {RecognitionBaseTask} * @see {@link https://docs.cap.guru/en/apiclick/binance.html} */ declare class BinanceGridTask extends RecognitionBaseTask implements BinanceGridParams, TaskSolutionTypes { /** * Create binance grid task * This task uses click='geetest' * @see {@link https://docs.cap.guru/en/apiclick/binance.html} * @param {BinanceGridParams} params - params * @param {string} [params.textinstructions] - For example: binance,bear. Only tasks in English are supported! * @param {string} [params.body] - Image encoded in Base64 format */ constructor(params: BinanceGridParams); /** * @type {boolean} isGrid - only used for correctly working method overloading intellisense */ /** * @type {boolean} isGrid - only used for correctly working method overloading intellisense */ isGrid: TaskSolutionTypes["isGrid"]; } type BinancePuzzleParams = Omit<RecognitionBaseParams, "click" | "textinstructions"> & { "body": string; }; /** * @classdesc Binance Puzzle task * @class * @extends {RecognitionBaseTask} * @see {@link https://docs.cap.guru/en/apiclick/binance.html} */ declare class BinancePuzzleTask extends RecognitionBaseTask implements BinancePuzzleParams, TaskSolutionTypes { /** * Create binance grid task * This task uses click='geetest' and textinstructions='binance,slider' * @see {@link https://docs.cap.guru/en/apiclick/binance.html} * @param {BinanceGridParams} params - params * @param {string} [params.body] - Image encoded in Base64 format */ constructor(params: BinancePuzzleParams); /** * @type {boolean} isSingleCoordinate - only used for correctly working method overloading intellisense */ isSingleCoordinate: TaskSolutionTypes["isSingleCoordinate"]; } type BuxMoneyCoordinatesParams = Omit<RecognitionBaseParams, "click" | "textinstructions">; /** * @classdesc BuxMoney coordinates task * This method allows you to solve bux.money and payup.video, with image clicks. We detect objects on the captcha and send you the coordinates for clicking. * @class * @extends {RecognitionBaseTask} * @see {@link https://docs.cap.guru/en/apiclick/other/seofast.html} */ declare class BuxMoneyCoordinatesTask extends RecognitionBaseTask implements BuxMoneyCoordinatesParams, TaskSolutionTypes { /** * Create BuxMoney coordinates task. This method allows you to solve bux.money and payup.video, with image clicks. We detect objects on the captcha and send you the coordinates for clicking. * This task uses click='oth' and textinstructions='custom1223' * @see {@link https://docs.cap.guru/en/apiclick/other/seofast.html} * @param {BuxMoneyCoordinatesParams} params - params * @param {string} [params.body] - Image encoded in Base64 format */ constructor(params: BuxMoneyCoordinatesParams); /** * @type {boolean} isMultipleCoordinates - only used for correctly working method overloading intellisense */ "isMultipleCoordinates": TaskSolutionTypes["isMultipleCoordinates"]; } type FunCaptchaGridParams = Omit<RecognitionBaseParams, "click"> & { "textinstructions": string; }; /** * @classdesc FunCaptcha Grid (3x3) task * @class * @extends {RecognitionBaseTask} * @see {@link https://docs.cap.guru/en/apiclick/funcap.html} */ declare class FunCaptchaGridTask extends RecognitionBaseTask implements FunCaptchaGridParams, TaskSolutionTypes { /** * Create FunCaptcha grid task * This task uses click='funcap2' * @see {@link https://docs.cap.guru/en/apiclick/funcap.html} * @param {FunCaptchaGridParams} params - params * @param {string} [params.textinstructions] - For example: Pick the spiral galaxy * @param {string} [params.body] - Image encoded in Base64 format */ constructor(params: FunCaptchaGridParams); /** * @type {boolean} isGrid - only used for correctly working method overloading intellisense */ isGrid: TaskSolutionTypes["isGrid"]; } type GenericPuzzleTaskParams = Omit<RecognitionBaseParams, "click" | "textinstructions">; /** * @classdesc Generic Puzzle task * This task uses click=geetest and textinstructions=slider * @class * @extends {RecognitionBaseTask} * @see {@link https://docs.cap.guru/en/api/slider.html} */ declare class GenericPuzzleTask extends RecognitionBaseTask implements GenericPuzzleTaskParams, TaskSolutionTypes { /** * Create Puzzle task * This task uses click='geetest' and textinstructions='slider' * @see {@link https://docs.cap.guru/en/api/slider.html} * @param {GenericPuzzleTaskParams} params - params * @param {string} [params.body] - Image encoded in Base64 format */ constructor(params: GenericPuzzleTaskParams); /** * @type {boolean} isSingleCoordinate - only used for correctly working method overloading intellisense */ isSingleCoordinate: TaskSolutionTypes["isSingleCoordinate"]; } type GeeTestPuzzleParams = GenericPuzzleTaskParams; /** * @classdesc GeeTest Puzzle task * @class * @extends {GenericPuzzleTask} * @see {@link https://docs.cap.guru/en/apiclick/geetest.html} */ declare class GeeTestPuzzleTask extends GenericPuzzleTask implements GeeTestPuzzleParams { /** * Create GeeTest Puzzle task * This task uses click='geetest' and textinstructions='slider' * @see {@link https://docs.cap.guru/en/apiclick/geetest.html} * @param {GeeTestGridParams} params - params * @param {string} [params.body] - Image encoded in Base64 format */ constructor(params: GeeTestPuzzleParams); } type HCaptchaCoordinatesParams = Omit<RecognitionBaseParams, "click"> & { "textinstructions": string; }; /** * @classdesc HCaptcha Coordinates * @class * @extends {RecognitionBaseTask} * @see {@link https://docs.cap.guru/en/apiclick/hcap.html} */ declare class HCaptchaCoordinatesTask extends RecognitionBaseTask implements HCaptchaCoordinatesParams, TaskSolutionTypes { /** * Create HCaptcha coordinates task * This task uses click='hcap' * @see {@link https://docs.cap.guru/en/apiclick/hcap.html} * @param {HCaptchaCoordinatesParams} params - params * @param {string} [params.textinstructions] - For example: bear. Tasks are supported only in English! * @param {string} [params.body] - Image encoded in Base64 format */ constructor(params: HCaptchaCoordinatesParams); /** * @type {boolean} isMultipleCoordinates - only used for correctly working method overloading intellisense */ "isMultipleCoordinates": TaskSolutionTypes["isMultipleCoordinates"]; } type HCaptchaGridParams = Omit<RecognitionBaseParams, "click"> & { "textinstructions": string; }; /** * @classdesc HCaptcha Grid (3x3) task * @class * @extends {RecognitionBaseTask} * @see {@link https://docs.cap.guru/en/apiclick/hcap.html} */ declare class HCaptchaGridTask extends RecognitionBaseTask implements HCaptchaGridParams, TaskSolutionTypes { /** * Create HCaptcha grid task * This task uses click='hcap2' * @see {@link https://docs.cap.guru/en/apiclick/hcap.html} * @param {HCaptchaGridParams} params - params * @param {string} [params.textinstructions] - For example: Please click each image containing a ladybug * @param {string} [params.body] - Image encoded in Base64 format */ constructor(params: HCaptchaGridParams); /** * @type {boolean} isGrid - only used for correctly working method overloading intellisense */ isGrid: TaskSolutionTypes["isGrid"]; } declare enum ImageToTextVernet { "GeneralV1" = 1, "GeneralV2" = 6, "Arithmetic" = 22, "Rambler" = 12, "GeneralYandex" = 18, "Yandex6ch" = 20, "VKontakte" = 16, "SolveMedia" = 14, "Gibdd" = 13, "OkRu" = 9, "WorldOfTanks" = 17, "MicrosoftHotmail" = 5, "GeneralCyrillic" = 7 } type ImageToTextParams = Omit<BaseParams, "method"> & { "body": string; "vernet"?: ImageToTextVernet; }; /** * @classdesc ImageToText task * @class * @extends {BaseTask} * @see {@link https://docs.cap.guru/en/apiclick/text.html} */ declare class ImageToTextTask extends BaseTask implements ImageToTextParams, TaskSolutionTypes { /** * Create Image to text task * @see {@link https://docs.cap.guru/en/apiclick/text.html} * @param {ImageToTextParams} params - params * @param {string} [params.body] - Image encoded in Base64 format * @param {ImageToTextVernet} [params.vernet] - vernet for image recognition */ constructor({ body, vernet }: ImageToTextParams); /** * @type {boolean} isString - only used for correctly working method overloading intellisense */ isString: TaskSolutionTypes["isString"]; /** * @param {ImageToTextVernet} vernet - vernet for image recognition */ vernet?: ImageToTextVernet; /** * @type {string} body - Image encoded in Base64 format */ body: string; } type LinkvertiseCoordinatesParams = Omit<RecognitionBaseParams, "click"> & { "textinstructions": string; }; /** * @classdesc Linkvertise coordinates task * This method solves Linkvertise, with image clicks. We detect objects on the captcha and send you the coordinates for clicking. * @class * @extends {RecognitionBaseTask} * @see {@link https://docs.cap.guru/en/apiclick/other/linkvertise.html} */ declare class LinkvertiseCoordinatesTask extends RecognitionBaseTask implements LinkvertiseCoordinatesParams, TaskSolutionTypes { /** * Create Linkvertise coordinates task. This method solves Linkvertise, with image clicks. We detect objects on the captcha and send you the coordinates for clicking. * This task uses click='oth' * @see {@link https://docs.cap.guru/en/apiclick/other/linkvertise.html} * @param {LinkvertiseCoordinatesParams} params - params * @param {string} [params.textinstructions] - For example: custom1221,Please click on the globe * @param {string} [params.body] - Image encoded in Base64 format */ constructor(params: LinkvertiseCoordinatesParams); /** * @type {boolean} isMultipleCoordinates - only used for correctly working method overloading intellisense */ "isMultipleCoordinates": TaskSolutionTypes["isMultipleCoordinates"]; } type ReCaptchaGridParams = Omit<RecognitionBaseParams, "click"> & { "textinstructions": string; }; /** * @classdesc ReCaptcha Grid (3x3) task * @class * @extends {RecognitionBaseTask} * @see {@link https://docs.cap.guru/en/apiclick/recap.html} */ declare class ReCaptchaGridTask extends RecognitionBaseTask implements ReCaptchaGridParams, TaskSolutionTypes { /** * Create ReCaptcha grid task * This task uses click='recap2' * @see {@link https://docs.cap.guru/en/apiclick/recap.html} * @param {ReCaptchaGridParams} params - params * @param {string} [params.textinstructions] - For example: Select all images with traffic light * @param {string} [params.body] - Image encoded in Base64 format */ constructor(params: ReCaptchaGridParams); /** * @type {boolean} isGrid - only used for correctly working method overloading intellisense */ isGrid: TaskSolutionTypes["isGrid"]; } type SeoFastCoordinatesParams = Omit<RecognitionBaseParams, "click">; /** * @classdesc SeoFast coordinates task * This method solves Seo-fast/Profitcentr/Seotime, with image clicks. We detect objects on the captcha and send you the coordinates for clicking. * @class * @extends {RecognitionBaseTask} * @see {@link https://docs.cap.guru/en/apiclick/other/seofast.html} */ declare class SeoFastCoordinatesTask extends RecognitionBaseTask implements SeoFastCoordinatesParams, TaskSolutionTypes { /** * Create SeoFast coordinates task. This method solves Seo-fast/Profitcentr/Seotime, with image clicks. We detect objects on the captcha and send you the coordinates for clicking. * This task uses click='oth' * @see {@link https://docs.cap.guru/en/apiclick/other/seofast.html} * @param {SeoFastCoordinatesParams} params - params * @param {string} [params.textinstructions] - For example: custom1222,Отметьте изображения со бантиками * @param {string} [params.body] - Image encoded in Base64 format */ constructor(params: SeoFastCoordinatesParams); /** * @type {boolean} isMultipleCoordinates - only used for correctly working method overloading intellisense */ "isMultipleCoordinates": TaskSolutionTypes["isMultipleCoordinates"]; } type TikTokABCParams = Omit<RecognitionBaseParams, "click" | "textinstructions">; /** * @classdesc TikTok ABC task * @class * @extends {RecognitionBaseTask} * @see {@link https://docs.cap.guru/en/apiclick/tiktok.html} */ declare class TikTokABCTask extends RecognitionBaseTask implements TikTokABCParams, TaskSolutionTypes { /** * Create TikTok ABC task * This task uses click='geetest' and textinstructions='abc' * @see {@link https://docs.cap.guru/en/apiclick/tiktok.html} * @param {TikTokGridParams} params - params * @param {string} [params.body] - Image encoded in Base64 format */ constructor(params: TikTokABCParams); /** * @type {boolean} isMultipleCoordinates - only used for correctly working method overloading intellisense */ "isMultipleCoordinates": TaskSolutionTypes["isMultipleCoordinates"]; } type TikTokKolesoParams = Omit<RecognitionBaseParams, "click" | "textinstructions"> & { "body0"?: string; "body1"?: string; }; /** * @classdesc TikTok Koleso task * @class * @extends {RecognitionBaseTask} * @see {@link https://docs.cap.guru/en/apiclick/tiktok.html} */ declare class TikTokKolesoTask extends RecognitionBaseTask implements TikTokKolesoParams, TaskSolutionTypes { /** * Create TikTok Koleso task * This task uses click='geetest' and textinstructions='koleso' * You can use only one image (body), or body0 and body1 images for outer and inner pieces of TikTok puzzle * @see {@link https://docs.cap.guru/en/apiclick/tiktok.html} * @param {TikTokGridParams} params - params * @param {string} [params.body] - Image encoded in Base64 format * @param {string} [params.body0] - Image encoded in Base64 format * @param {string} [params.body1] - Image encoded in Base64 format */ constructor({ body1, body0, ...params }: TikTokKolesoParams); /** * @type {boolean} isSingleCoordinate - only used for correctly working method overloading intellisense */ isSingleCoordinate: TaskSolutionTypes["isSingleCoordinate"]; /** * @type {string} body0 */ body0?: string; /** * @type {string} body1 */ body1?: string; } type TikTokPuzzleParams = GenericPuzzleTaskParams; /** * @classdesc TikTok Puzzle task * @class * @extends {GenericPuzzleTask} * @see {@link https://docs.cap.guru/en/apiclick/tiktok.html} */ declare class TikTokPuzzleTask extends GenericPuzzleTask implements TikTokPuzzleParams, TaskSolutionTypes { /** * Create TikTok Puzzle task * This task uses click='geetest' and textinstructions='slider' * @see {@link https://docs.cap.guru/en/apiclick/tiktok.html} * @param {TikTokGridParams} params - params * @param {string} [params.body] - Image encoded in Base64 format */ constructor(params: TikTokPuzzleParams); } type WorldCashCoordinatesParams = Omit<RecognitionBaseParams, "click" | "textinstructions">; /** * @classdesc WorldCash coordinates task * This method solves World.cash, with image clicks. We detect objects on the captcha and send you the coordinates for clicking. * @class * @extends {RecognitionBaseTask} * @see {@link https://docs.cap.guru/en/apiclick/other/worldcash.html} */ declare class WorldCashCoordinatesTask extends RecognitionBaseTask implements WorldCashCoordinatesParams, TaskSolutionTypes { /** * Create WorldCash coordinates task. This method solves World.cash, with image clicks. We detect objects on the captcha and send you the coordinates for clicking. * This task uses click='oth' and textinstructions='custom1224' * @see {@link https://docs.cap.guru/en/apiclick/other/worldcash.html} * @param {WorldCashCoordinatesParams} params - params * @param {string} [params.body] - Image encoded in Base64 format */ constructor(params: WorldCashCoordinatesParams); /** * @type {boolean} isMultipleCoordinates - only used for correctly working method overloading intellisense */ "isMultipleCoordinates": TaskSolutionTypes["isMultipleCoordinates"]; } type HCaptchaParams = Omit<BaseParams, "method"> & { "cookies"?: string; "pageurl": string; "proxy"?: string; "proxyType"?: ProxyTypes; "sitekey": string; "userAgent"?: string; }; /** * @classdesc HCaptcha Task * @class * @extends {Task} * @see {@link https://docs.cap.guru/en/apitoken/hcap.html} */ declare class HCaptchaTask extends BaseTask implements HCaptchaParams, TaskSolutionTypes { constructor({ sitekey, pageurl, proxy, proxyType, userAgent, cookies }: HCaptchaParams); sitekey: string; pageurl: string; /** * @type {string} cookies - Your cookies that will be used by the employee to solve the captcha. */ cookies?: string; /** * @type {string} userAgent - We substitute your userAgent for the employee. */ userAgent?: string; proxy?: string; /** * @type {string} proxyType - Your proxy type: : HTTP, HTTPS, SOCKS4, SOCKS5. */ proxyType?: ProxyTypes; /** * @type {boolean} isString - only used for correctly working method overloading intellisense */ isString: TaskSolutionTypes["isString"]; } type ReCaptchaVersions = "v2" | "v3"; type ReCaptchaBaseParams = Omit<BaseParams, "method"> & { "cookies"?: string; "data-s"?: string; "googlekey": string; "pageurl": string; "proxy"?: string; "proxyType"?: ProxyTypes; "userAgent"?: string; "version"?: ReCaptchaVersions; }; /** * @classdesc ReCaptchaBase task * @class * @extends {BaseTask} */ declare abstract class ReCaptchaBaseTask extends BaseTask implements ReCaptchaBaseParams, TaskSolutionTypes { /** * Create ReCaptchaBaseTask * @param {ReCaptchaBaseParams} params - params * @param {string} [params.googlekey] - The value of the parameter k or data-sitekey that you found in the page code. For example 6le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ- * @param {string} [params.pageurl] - Full URL of the page where you are solving reCAPTCHA * @param {string} [params.data-s] - The value of the data-s parameter found on the page. Relevant for Google search * @param {string} [params.cookies] - Your cookies that will be used by the employee to solve the captcha. * @param {string} [params.userAgent] - We substitute your userAgent for the employee. * @param {string} [params.proxy] - Format: login:password@151.142.23.32:3128 * @param {string} [params.proxyType] - Your proxy type: : HTTP, HTTPS, SOCKS4, SOCKS5. */ constructor({ googlekey, pageurl, proxy, proxyType, userAgent, cookies, "data-s": dataS, version }: ReCaptchaBaseParams); googlekey: string; pageurl: string; /** * @type {string} data-s - The value of the data-s parameter found on the page. Relevant for Google search and other Google services. */ "data-s"?: string; /** * @type {string} cookies - Your cookies that will be used by the employee to solve the captcha. */ cookies?: string; /** * @type {string} userAgent - We substitute your userAgent for the employee. */ userAgent?: string; proxy?: string; /** * @type {string} proxyType - Your proxy type: : HTTP, HTTPS, SOCKS4, SOCKS5. */ proxyType?: ProxyTypes; /** * @type {number} version - Recaptcha version */ version?: ReCaptchaVersions; /** * @type {boolean} isString - only used for correctly working method overloading intellisense */ isString: TaskSolutionTypes["isString"]; } type ReCaptchaV2Params = Omit<ReCaptchaBaseParams, "version">; /** * @classdesc ReCaptchaV2 & ReCaptchaV2 Invisible Solution * @class * @extends {ReCaptchaBaseTask} * @see {@link https://docs.cap.guru/en/apitoken/recap2.html} */ declare class ReCaptchaV2Task extends ReCaptchaBaseTask implements ReCaptchaV2Params { /** * Create ReCaptchaV2Task * @see {@link https://docs.cap.guru/en/apitoken/recap2.html} * @param {ReCaptchaV2Params} params - params * @param {string} [params.googlekey] - The value of the parameter k or data-sitekey that you found in the page code. For example 6le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ- * @param {string} [params.pageurl] - Full URL of the page where you are solving reCAPTCHA V2 * @param {string} [params.data-s] - The value of the data-s parameter found on the page. Relevant for Google search * @param {string} [params.cookies] - Your cookies that will be used by the employee to solve the captcha. * @param {string} [params.userAgent] - We substitute your userAgent for the employee. * @param {string} [params.proxy] - Format: login:password@151.142.23.32:3128 * @param {string} [params.proxyType] - Your proxy type: : HTTP, HTTPS, SOCKS4, SOCKS5. */ constructor(params: ReCaptchaV2Params); } type ReCaptchaV3Params = Omit<ReCaptchaBaseParams, "version"> & { "min_score"?: number; }; /** * @classdesc ReCaptchaV3 Solution * @class * @extends {ReCaptchaBaseTask} * @see {@link https://docs.cap.guru/en/apitoken/recap3.html} */ declare class ReCaptchaV3Task extends ReCaptchaBaseTask implements ReCaptchaV3Params { /** * Create ReCaptchaV3Task * @see {@link https://docs.cap.guru/en/apitoken/recap3.html} * @param {ReCaptchaV3Params} params - params * @param {string} [params.googlekey] - The value of the parameter k or data-sitekey that you found in the page code. For example 6le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ- * @param {string} [params.pageurl] - Full URL of the page where you are solving reCAPTCHA V3 * @param {string} [params.min_score] - Required rating value (score). At the moment, it is difficult to get a token with a score higher than 0.1 * @param {string} [params.cookies] - Your cookies that will be used by the employee to solve the captcha. * @param {string} [params.userAgent] - We substitute your userAgent for the employee. * @param {string} [params.proxy] - Format: login:password@151.142.23.32:3128 * @param {string} [params.proxyType] - Your proxy type: : HTTP, HTTPS, SOCKS4, SOCKS5. */ constructor(params: ReCaptchaV3Params); /** * @type {number} min_score - Required rating value (score). At the moment, it is difficult to get a token with a score higher than 0.1 */ min_score?: number; } type TurnstileTaskParams = { "pageurl": string; "sitekey": string; }; /** * @classdesc TurnstileTask Solution * @class * @extends {BaseTask} * @see {@link https://docs.cap.guru/en/apitoken/turnstile.html} */ declare class TurnstileTask extends BaseTask implements TurnstileTaskParams, TaskSolutionTypes { constructor({ pageurl, sitekey }: TurnstileTaskParams); pageurl: string; sitekey: string; /** * @type {boolean} isString - only used for correctly working method overloading intellisense */ isString: TaskSolutionTypes["isString"]; } type Requests = AmazonCarPathTask | AmazonPuzzleTask | BinanceGridTask | BinancePuzzleTask | BuxMoneyCoordinatesTask | FunCaptchaGridTask | GeeTestPuzzleTask | GenericPuzzleTask | HCaptchaCoordinatesTask | HCaptchaGridTask | HCaptchaTask | ImageToTextTask | LinkvertiseCoordinatesTask | ReCaptchaGridTask | ReCaptchaV2Task | ReCaptchaV3Task | SeoFastCoordinatesTask | TikTokABCTask | TikTokKolesoTask | TikTokPuzzleTask | TurnstileTask | WorldCashCoordinatesTask; type CoordinatesSolution = { "w"?: number; "x": number; "y": number; }; /** * @classdesc CapGuru client * @class * @see {@link https://docs.cap.guru/en/} */ declare class CapGuru extends CaptchaClient<string, Requests> { /** * @type {string} clientKey - YOUR_API_KEY from dashboard */ protected clientKey: string; /** * @type {number} pollingInterval - polling interval to getTaskResult in ms. Default to 5000 */ protected pollingInterval: number; /** * @type {number} timeout - max timeout to getTaskResult in ms. Default to 120_000 */ protected timeout: number; /** * @type {string} baseUrl - base api url */ protected baseUrl: string; private softguru; /** * @param {object} [params] - CaptchaClientParams * @param {string} [params.clientKey] - YOUR_API_KEY from dashboard * @param {number} [params.timeout] - max timeout to getTaskResult, default = 120000 * @param {number} [params.pollingInterval] - polling interval to getTaskResult, default = 5000 * @param {number} [params.baseUrl] - base url for capguru, default = "https://api3.cap.guru/" */ constructor(params: CaptchaClientParams); getBalance(): Promise<number>; private parseSolution; /** * @param {object} request - task payload to create task * @return {Promise<CapGuruCreateTaskResponse<TSolution>>} - response of createTask */ protected createTask(request: Requests): Promise<string>; /** * @param {BinanceGridTask | FunCaptchaGridTask | HCaptchaGridTask | ReCaptchaGridTask} request - task payload to create task * @return {Promise<CapGuruSolution<Array<number>>>} - response of createTask */ solve(request: BinanceGridTask | FunCaptchaGridTask | HCaptchaGridTask | ReCaptchaGridTask): Promise<CapGuruSolution<Array<number>>>; /** * @param {HCaptchaCoordinatesTask | SeoFastCoordinatesTask | TikTokABCTask | WorldCashCoordinatesTask} request - task payload to create task * @return {Promise<CapGuruSolution<Array<CoordinatesSolution>>>} - response of createTask */ solve(request: HCaptchaCoordinatesTask | SeoFastCoordinatesTask | TikTokABCTask | WorldCashCoordinatesTask): Promise<CapGuruSolution<Array<CoordinatesSolution>>>; /** * @param {AmazonCarPathTask | AmazonPuzzleTask | BinancePuzzleTask | BuxMoneyCoordinatesTask | GeeTestPuzzleTask | GenericPuzzleTask | LinkvertiseCoordinatesTask | TikTokKolesoTask | TikTokPuzzleTask} request - task payload to create task * @return {Promise<CapGuruSolution<Array<number>>>} - response of createTask */ solve(request: AmazonCarPathTask | AmazonPuzzleTask | BinancePuzzleTask | BuxMoneyCoordinatesTask | GeeTestPuzzleTask | GenericPuzzleTask | LinkvertiseCoordinatesTask | TikTokKolesoTask | TikTokPuzzleTask): Promise<CapGuruSolution<CoordinatesSolution>>; /** * @param {ImageToTextTask} request - task payload to create ImageToTextTask * @return {Promise<CapGuruSolution<string>>} - response of createTask */ solve(request: ImageToTextTask): Promise<CapGuruSolution<string>>; /** * @param {HCaptchaTask} request - task payload to create HCaptchaTask * @return {Promise<CapGuruSolution<string>>} - response of createTask */ solve(request: HCaptchaTask): Promise<CapGuruSolution<string>>; /** * @param {ReCaptchaV2Task} request - task payload to create ReCaptchaV2Task * @return {Promise<CapGuruSolution<string>>} - response of createTask */ solve(request: ReCaptchaV2Task): Promise<CapGuruSolution<string>>; /** * @param {ReCaptchaV3Task} request - task payload to create ReCaptchaV3Task * @return {Promise<CapGuruSolution<string>>} - response of createTask */ solve(request: ReCaptchaV3Task): Promise<CapGuruSolution<string>>; /** * @param {TurnstileTask} request - task payload to create TurnstileTask * @return {Promise<CapGuruSolution<string>>} - response of createTask */ solve(request: TurnstileTask): Promise<CapGuruSolution<string>>; } export { AmazonCarPathTask, AmazonPuzzleTask, BinanceGridTask, BinancePuzzleTask, BuxMoneyCoordinatesTask, CapGuru, FunCaptchaGridTask, GeeTestPuzzleTask, GenericPuzzleTask, HCaptchaCoordinatesTask, HCaptchaGridTask, HCaptchaTask, ImageToTextTask, LinkvertiseCoordinatesTask, ReCaptchaGridTask, ReCaptchaV2Task, ReCaptchaV3Task, type Requests, SeoFastCoordinatesTask, TikTokABCTask, TikTokKolesoTask, TikTokPuzzleTask, TurnstileTask, WorldCashCoordinatesTask };