@captchafox/node 1.0.1 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +30 -0
- package/package.json +21 -10
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The response returned from the /siteverify
|
|
3
|
+
* endpoint used for verifying the challenge token.
|
|
4
|
+
*/
|
|
5
|
+
type VerifyResponse = {
|
|
6
|
+
/** Whether verification succeeded or not */
|
|
7
|
+
success: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* ISO timestamp of the challenge (yyyy-MM-dd'T'HH:mm:ssZZ).
|
|
10
|
+
* Only included on success.
|
|
11
|
+
*/
|
|
12
|
+
challenge_ts?: string;
|
|
13
|
+
/** Hostname of the site where the challenge was solved. Optional */
|
|
14
|
+
hostname?: string;
|
|
15
|
+
/** List of error codes. Only included if success is false */
|
|
16
|
+
'error-codes'?: string[];
|
|
17
|
+
};
|
|
18
|
+
type VerifyPayload = NodeJS.Dict<string> & {
|
|
19
|
+
/** The organization secret */
|
|
20
|
+
secret: string;
|
|
21
|
+
/** The response token from the widget */
|
|
22
|
+
response: string;
|
|
23
|
+
/** (Optional) the sitekey that was use to issue the token */
|
|
24
|
+
sitekey?: string;
|
|
25
|
+
};
|
|
26
|
+
declare function verify(secret: string, token: string, sitekey?: string): Promise<VerifyResponse>;
|
|
27
|
+
|
|
28
|
+
declare const CAPTCHA_RESPONSE_KEY = "cf-captcha-response";
|
|
29
|
+
|
|
30
|
+
export { CAPTCHA_RESPONSE_KEY, VerifyPayload, VerifyResponse, verify };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@captchafox/node",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -11,9 +11,14 @@
|
|
|
11
11
|
],
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
"import":
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
"import": {
|
|
15
|
+
"types": "./dist/index.d.mts",
|
|
16
|
+
"default": "./dist/index.mjs"
|
|
17
|
+
},
|
|
18
|
+
"require": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"default": "./dist/index.js"
|
|
21
|
+
}
|
|
17
22
|
}
|
|
18
23
|
},
|
|
19
24
|
"scripts": {
|
|
@@ -25,14 +30,20 @@
|
|
|
25
30
|
"test:watch": "jest --watch"
|
|
26
31
|
},
|
|
27
32
|
"devDependencies": {
|
|
33
|
+
"@captchafox/tsconfig": "*",
|
|
28
34
|
"@captchafox/internal": "*",
|
|
29
|
-
"@types/jest": "^29.
|
|
35
|
+
"@types/jest": "^29.5.5",
|
|
30
36
|
"@types/node": "^18.13.0",
|
|
31
|
-
"jest": "^29.
|
|
32
|
-
"nock": "^13.3.
|
|
33
|
-
"tsup": "^
|
|
34
|
-
"ts-jest": "^29.
|
|
35
|
-
"typescript": "^
|
|
37
|
+
"jest": "^29.7.0",
|
|
38
|
+
"nock": "^13.3.3",
|
|
39
|
+
"tsup": "^7.2.0",
|
|
40
|
+
"ts-jest": "^29.1.1",
|
|
41
|
+
"typescript": "^5.0.2"
|
|
42
|
+
},
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "https://github.com/CaptchaFox/javascript-integrations.git",
|
|
46
|
+
"directory": "packages/node"
|
|
36
47
|
},
|
|
37
48
|
"bugs": {
|
|
38
49
|
"url": "https://github.com/CaptchaFox/javascript-integrations/issues"
|