From df259947d2b1ebec5b0d30f83bc818840676e802 Mon Sep 17 00:00:00 2001 From: HichemTab Date: Fri, 1 Sep 2023 01:43:25 +0100 Subject: [PATCH] some fixes --- README.md | 2 +- dist/easycaptcha.js | 2 +- dist/easycaptcha.min.js | 2 +- package-lock.json | 4 ++-- package.json | 2 +- types/easycaptchajs/easycaptchajs-tests.ts | 2 +- types/easycaptchajs/index.d.ts | 22 +++++++++++++++++++++- webpack.config.js | 2 +- 8 files changed, 29 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a3be42c..12e4fd9 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ You can install EasyCaptchaJS via npm: You can also include EasyCaptchaJS directly from a CDN by adding the following script tag to your HTML file: ```HTML - + ``` ### Local Download diff --git a/dist/easycaptcha.js b/dist/easycaptcha.js index 34e153b..4b66dc5 100644 --- a/dist/easycaptcha.js +++ b/dist/easycaptcha.js @@ -1,5 +1,5 @@ /*! - * EasyCaptchaJS v1.2.0 + * EasyCaptchaJS v1.2.1 * (c) HichemTech * Released under the MIT License. * Github: https://github.com/HichemTab-tech/EasyCaptchaJS diff --git a/dist/easycaptcha.min.js b/dist/easycaptcha.min.js index 5ce68b6..b78f3cb 100644 --- a/dist/easycaptcha.min.js +++ b/dist/easycaptcha.min.js @@ -1,5 +1,5 @@ /*! - * EasyCaptchaJS v1.2.0 + * EasyCaptchaJS v1.2.1 * (c) HichemTech * Released under the MIT License. * Github: https://github.com/HichemTab-tech/EasyCaptchaJS diff --git a/package-lock.json b/package-lock.json index dbd3bff..0f82e7e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "easycaptchajs", - "version": "1.2.0", + "version": "1.2.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "easycaptchajs", - "version": "1.2.0", + "version": "1.2.1", "license": "MIT", "dependencies": { "@types/jquery": "^3.5.17", diff --git a/package.json b/package.json index 5421f64..d36c65d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "easycaptchajs", - "version": "1.2.0", + "version": "1.2.1", "description": "EasyCaptchaJS is a lightweight and user-friendly jQuery/JS library that simplifies the integration of Google reCAPTCHA API into web pages. With EasyCaptchaJS, developers can effortlessly add the security and anti-bot protection of Google reCAPTCHA to their applications. The library dynamically imports the Google reCAPTCHA API script, handles event bindings and listeners, and initiates the reCAPTCHA checkbox within a specified parent container. Developers can take advantage of powerful options, including customizable success/failure listeners, verification checks, and a getter function to access the reCAPTCHA secret code for further processing. Streamline your web application's security with EasyCaptchaJS and ensure a smooth user experience.", "main": "index.js", "types": "types/easycaptchajs/index.d.ts", diff --git a/types/easycaptchajs/easycaptchajs-tests.ts b/types/easycaptchajs/easycaptchajs-tests.ts index 4a16069..a843b52 100644 --- a/types/easycaptchajs/easycaptchajs-tests.ts +++ b/types/easycaptchajs/easycaptchajs-tests.ts @@ -14,4 +14,4 @@ const instance2 = EasyCaptcha('verify', [], data, args); // Calling EasyCaptcha function with 'getTarget' method // $ExpectType EasyCaptchaResults -const instance3 = EasyCaptcha('getTarget', [], data, args); +const instance3 = EasyCaptcha('getTarget', [], data, args); \ No newline at end of file diff --git a/types/easycaptchajs/index.d.ts b/types/easycaptchajs/index.d.ts index fc08a66..04e4870 100644 --- a/types/easycaptchajs/index.d.ts +++ b/types/easycaptchajs/index.d.ts @@ -27,7 +27,27 @@ export interface EasyCaptchaSettings { export type EasyCaptchaMethod = 'getTarget' | 'verify' | 'response' | 'reset' | 'destroy'; -export type EasyCaptchaResults = any[] | any | null; +export type EasyCaptchaElementData = Record; + +export interface EasyCaptchaResultBaseTarget { + parentElement?: JQuery, +} + +export interface EasyCaptchaResultTarget extends EasyCaptchaResultBaseTarget { + data: EasyCaptchaElementData +} + +export interface EasyCaptchaResultVerify extends EasyCaptchaResultBaseTarget { + verified: boolean +} + +export interface EasyCaptchaResultResponse extends EasyCaptchaResultBaseTarget { + token: string +} + +export type EasyCaptchaResult = EasyCaptchaResultTarget | EasyCaptchaResultVerify | EasyCaptchaResultResponse; + +export type EasyCaptchaResults = EasyCaptchaResult[] | EasyCaptchaResult | null; export interface EasyCaptchaInstance { (options?: EasyCaptchaSettings, ...args: string[]): EasyCaptchaResults; diff --git a/webpack.config.js b/webpack.config.js index 2f9388e..bab339f 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -7,7 +7,7 @@ const webpack = require("webpack"); // noinspection JSUnresolvedReference let bannerPlugin = new webpack.BannerPlugin({ banner: `/*! - * EasyCaptchaJS v1.2.0 + * EasyCaptchaJS v1.2.1 * (c) HichemTech * Released under the MIT License. * Github: https://github.com/HichemTab-tech/EasyCaptchaJS