diff --git a/README.md b/README.md index 41449e8..0437d13 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ To start using the NextCaptcha Node.js SDK, you first need to obtain your API ke you can create a NextCaptcha instance: ```typescript -import {NextCaptcha} from 'nextcaptcha'; +import NextCaptcha from 'nextcaptcha-ts'; const apiKey = 'YOUR_API_KEY'; const nextCaptcha = new NextCaptcha(apiKey); @@ -32,48 +32,48 @@ Solving reCAPTCHA v2 To solve reCAPTCHA v2 challenges, use the recaptchaV2 method: ```typescript -const result = await nextCaptcha.recaptchaV2(websiteURL, websiteKey); +const result = await nextCaptcha.recaptchaV2({websiteURL, websiteKey}); ``` Solving reCAPTCHA v3 To solve reCAPTCHA v3 challenges, use the recaptchaV3 method: ```typescript -const result = await nextCaptcha.recaptchaV3(websiteURL, websiteKey, pageAction); +const result = await nextCaptcha.recaptchaV3({websiteURL, websiteKey, pageAction}); ``` Solving reCAPTCHA Mobile To solve reCAPTCHA Mobile challenges, use the recaptchaMobile method: ```typescript -const result = await nextCaptcha.recaptchaMobile(websiteURL, websiteKey); +const result = await nextCaptcha.recaptchaMobile({websiteURL, websiteKey}); ``` Solving hCaptcha To solve hCaptcha challenges, use the hcaptcha method: ```typescript -const result = await nextCaptcha.hcaptcha(websiteURL, websiteKey); +const result = await nextCaptcha.hcaptcha({websiteURL, websiteKey}); ``` Solving hCaptcha Enterprise To solve hCaptcha Enterprise challenges, use the hcaptchaEnterprise method: -``` -const result = await nextCaptcha.hcaptchaEnterprise(websiteURL, websiteKey, enterprisePayload); +```typescript +const result = await nextCaptcha.hcaptchaEnterprise({websiteURL, websiteKey, enterprisePayload}); ``` Solving FunCaptcha To solve FunCaptcha challenges, use the funcaptcha method: -``` -const result = await nextCaptcha.funcaptcha(websitePublicKey); +```typescript +const result = await nextCaptcha.funcaptcha({websitePublicKey, websiteURL}); ``` Checking Account Balance To check your NextCaptcha account balance, use the getBalance method: -``` +```typescript const balance = await nextCaptcha.getBalance(); console.log(`Account balance: ${balance}`); ``` diff --git a/package.json b/package.json index 3b92153..8597131 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nextcaptcha-ts", - "version": "1.0.2", + "version": "1.0.3", "description": "NextCaptcha Captcha Solving Service Api Wrapper for Typescript to solving recaptcha v2, v3,recapthcha moible,hcaptcha,funcaptcha", "main": "dist/src/index.js", "repository": { diff --git a/src/index.ts b/src/index.ts index a82f1f7..fbccf01 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,7 +3,6 @@ import {IFunCaptchaTask, IHCaptchaTask, IRecaptchaMobileTask, IReCaptchaV2Task, // Define constants representing different types of captcha tasks const RECAPTCHAV2_TYPE = "RecaptchaV2TaskProxyless"; -const RECAPTCHAV2_ENTERPRISE_TYPE = "RecaptchaV2EnterpriseTaskProxyless"; const RECAPTCHAV3_PROXYLESS_TYPE = "RecaptchaV3TaskProxyless"; const RECAPTCHAV3_TYPE = "RecaptchaV3Task"; const RECAPTCHA_MOBILE_TYPE = "RecaptchaMobileTaskProxyless"; @@ -17,14 +16,9 @@ const FUNCAPTCHA_PROXYLESS_TYPE = "FunCaptchaTaskProxyless"; const TIMEOUT = 45; // Define constants representing different task statuses -const PENDING_STATUS = "pending"; -const PROCESSING_STATUS = "processing"; const READY_STATUS = "ready"; const FAILED_STATUS = "failed"; -// Define a custom error class -class TaskBadParametersError extends Error { -} // Define the ApiClient class for communicating with the NextCaptcha API class ApiClient { @@ -85,7 +79,7 @@ class ApiClient { } // Define the NextCaptcha class for interacting with the NextCaptcha service -export class NextCaptcha { +export default class NextCaptcha { private api: ApiClient; constructor(apiKey: string) { diff --git a/test/index.test.ts b/test/index.test.ts index 8e454e9..a2442aa 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -1,5 +1,5 @@ import {describe, expect, test} from '@jest/globals'; -import {NextCaptcha} from '../src' +import NextCaptcha from '../src' require('dotenv').config();