@friendlycaptcha/server-sdk 0.1.2 → 0.2.0
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/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/dist/api/types.d.ts +13 -1
- package/dist/api/typesRiskIntelligence.d.ts +778 -0
- package/dist/api/typesRiskIntelligence.js +25 -0
- package/dist/api/typesRiskIntelligence.js.map +1 -0
- package/dist/client/client.d.ts +15 -0
- package/dist/client/client.js +28 -8
- package/dist/client/client.js.map +1 -1
- package/dist/client/version.gen.d.ts +1 -1
- package/dist/client/version.gen.js +1 -1
- package/dist/index.d.ts +829 -0
- package/package.json +16 -2
- package/.github/workflows/ci.yml +0 -50
- package/.github/workflows/publish.yml +0 -18
- package/.prettierrc +0 -3
- package/docs/index.md +0 -12
- package/docs/server-sdk.failed_due_to_client_error_code.md +0 -15
- package/docs/server-sdk.failed_to_decode_response_error_code.md +0 -13
- package/docs/server-sdk.failed_to_encode_error_code.md +0 -13
- package/docs/server-sdk.friendlycaptchaclient._constructor_.md +0 -20
- package/docs/server-sdk.friendlycaptchaclient.md +0 -26
- package/docs/server-sdk.friendlycaptchaclient.verifycaptcharesponse.md +0 -30
- package/docs/server-sdk.friendlycaptchaoptions.apikey.md +0 -13
- package/docs/server-sdk.friendlycaptchaoptions.fetch.md +0 -13
- package/docs/server-sdk.friendlycaptchaoptions.md +0 -24
- package/docs/server-sdk.friendlycaptchaoptions.sitekey.md +0 -11
- package/docs/server-sdk.friendlycaptchaoptions.siteverifyendpoint.md +0 -15
- package/docs/server-sdk.friendlycaptchaoptions.strict.md +0 -15
- package/docs/server-sdk.md +0 -41
- package/docs/server-sdk.request_failed_error_code.md +0 -13
- package/docs/server-sdk.request_failed_timeout_error_code.md +0 -13
- package/docs/server-sdk.siteverifyerrorresponse.error.md +0 -11
- package/docs/server-sdk.siteverifyerrorresponse.md +0 -20
- package/docs/server-sdk.siteverifyerrorresponse.success.md +0 -11
- package/docs/server-sdk.siteverifyerrorresponseerrordata.detail.md +0 -11
- package/docs/server-sdk.siteverifyerrorresponseerrordata.error_code.md +0 -11
- package/docs/server-sdk.siteverifyerrorresponseerrordata.md +0 -20
- package/docs/server-sdk.siteverifyresponse.md +0 -14
- package/docs/server-sdk.siteverifyresponsechallengedata.md +0 -20
- package/docs/server-sdk.siteverifyresponsechallengedata.origin.md +0 -13
- package/docs/server-sdk.siteverifyresponsechallengedata.timestamp.md +0 -13
- package/docs/server-sdk.siteverifyresponsedata.challenge.md +0 -11
- package/docs/server-sdk.siteverifyresponsedata.md +0 -19
- package/docs/server-sdk.siteverifysuccessresponse.data.md +0 -11
- package/docs/server-sdk.siteverifysuccessresponse.md +0 -20
- package/docs/server-sdk.siteverifysuccessresponse.success.md +0 -11
- package/docs/server-sdk.verifyclienterrorcode.md +0 -14
- package/docs/server-sdk.verifyresult._constructor_.md +0 -20
- package/docs/server-sdk.verifyresult.clienterrortype.md +0 -11
- package/docs/server-sdk.verifyresult.geterrorcode.md +0 -15
- package/docs/server-sdk.verifyresult.getresponse.md +0 -17
- package/docs/server-sdk.verifyresult.getresponseerror.md +0 -17
- package/docs/server-sdk.verifyresult.isclienterror.md +0 -19
- package/docs/server-sdk.verifyresult.isdecodeerror.md +0 -17
- package/docs/server-sdk.verifyresult.isencodeerror.md +0 -17
- package/docs/server-sdk.verifyresult.isrequestortimeouterror.md +0 -17
- package/docs/server-sdk.verifyresult.isstrict.md +0 -17
- package/docs/server-sdk.verifyresult.md +0 -44
- package/docs/server-sdk.verifyresult.response.md +0 -13
- package/docs/server-sdk.verifyresult.shouldaccept.md +0 -17
- package/docs/server-sdk.verifyresult.shouldreject.md +0 -17
- package/docs/server-sdk.verifyresult.status.md +0 -13
- package/docs/server-sdk.verifyresult.wasabletoverify.md +0 -17
- package/example/README.md +0 -29
- package/example/package-lock.json +0 -1404
- package/example/package.json +0 -24
- package/example/src/index.ts +0 -84
- package/example/tsconfig.json +0 -13
- package/example/views/index.ejs +0 -86
- package/src/api/errors.ts +0 -77
- package/src/api/index.ts +0 -1
- package/src/api/types.ts +0 -66
- package/src/client/client.ts +0 -157
- package/src/client/errors.ts +0 -42
- package/src/client/index.ts +0 -3
- package/src/client/result.ts +0 -152
- package/src/client/version.gen.ts +0 -3
- package/src/index.ts +0 -2
- package/test/client/client.test.ts +0 -47
- package/test/client/mock.test.ts +0 -44
- package/tsconfig.json +0 -20
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@friendlycaptcha/server-sdk](./server-sdk.md) > [SiteverifySuccessResponse](./server-sdk.siteverifysuccessresponse.md) > [success](./server-sdk.siteverifysuccessresponse.success.md)
|
|
4
|
-
|
|
5
|
-
## SiteverifySuccessResponse.success property
|
|
6
|
-
|
|
7
|
-
**Signature:**
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
success: true;
|
|
11
|
-
```
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@friendlycaptcha/server-sdk](./server-sdk.md) > [VerifyClientErrorCode](./server-sdk.verifyclienterrorcode.md)
|
|
4
|
-
|
|
5
|
-
## VerifyClientErrorCode type
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
**Signature:**
|
|
9
|
-
|
|
10
|
-
```typescript
|
|
11
|
-
export type VerifyClientErrorCode = typeof FAILED_TO_ENCODE_ERROR_CODE | typeof REQUEST_FAILED_ERROR_CODE | typeof REQUEST_FAILED_TIMEOUT_ERROR_CODE | typeof FAILED_DUE_TO_CLIENT_ERROR_CODE | typeof FAILED_TO_DECODE_RESPONSE_ERROR_CODE;
|
|
12
|
-
```
|
|
13
|
-
**References:** [FAILED\_TO\_ENCODE\_ERROR\_CODE](./server-sdk.failed_to_encode_error_code.md)<!-- -->, [REQUEST\_FAILED\_ERROR\_CODE](./server-sdk.request_failed_error_code.md)<!-- -->, [REQUEST\_FAILED\_TIMEOUT\_ERROR\_CODE](./server-sdk.request_failed_timeout_error_code.md)<!-- -->, [FAILED\_DUE\_TO\_CLIENT\_ERROR\_CODE](./server-sdk.failed_due_to_client_error_code.md)<!-- -->, [FAILED\_TO\_DECODE\_RESPONSE\_ERROR\_CODE](./server-sdk.failed_to_decode_response_error_code.md)
|
|
14
|
-
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@friendlycaptcha/server-sdk](./server-sdk.md) > [VerifyResult](./server-sdk.verifyresult.md) > [(constructor)](./server-sdk.verifyresult._constructor_.md)
|
|
4
|
-
|
|
5
|
-
## VerifyResult.(constructor)
|
|
6
|
-
|
|
7
|
-
Constructs a new instance of the `VerifyResult` class
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
constructor(strict: boolean);
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
| Parameter | Type | Description |
|
|
18
|
-
| --- | --- | --- |
|
|
19
|
-
| strict | boolean | |
|
|
20
|
-
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@friendlycaptcha/server-sdk](./server-sdk.md) > [VerifyResult](./server-sdk.verifyresult.md) > [clientErrorType](./server-sdk.verifyresult.clienterrortype.md)
|
|
4
|
-
|
|
5
|
-
## VerifyResult.clientErrorType property
|
|
6
|
-
|
|
7
|
-
**Signature:**
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
clientErrorType: VerifyClientErrorCode | null;
|
|
11
|
-
```
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@friendlycaptcha/server-sdk](./server-sdk.md) > [VerifyResult](./server-sdk.verifyresult.md) > [getErrorCode](./server-sdk.verifyresult.geterrorcode.md)
|
|
4
|
-
|
|
5
|
-
## VerifyResult.getErrorCode() method
|
|
6
|
-
|
|
7
|
-
**Signature:**
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
getErrorCode(): VerifyClientErrorCode | null;
|
|
11
|
-
```
|
|
12
|
-
**Returns:**
|
|
13
|
-
|
|
14
|
-
[VerifyClientErrorCode](./server-sdk.verifyclienterrorcode.md) \| null
|
|
15
|
-
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@friendlycaptcha/server-sdk](./server-sdk.md) > [VerifyResult](./server-sdk.verifyresult.md) > [getResponse](./server-sdk.verifyresult.getresponse.md)
|
|
4
|
-
|
|
5
|
-
## VerifyResult.getResponse() method
|
|
6
|
-
|
|
7
|
-
**Signature:**
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
getResponse(): SiteverifyResponse | null;
|
|
11
|
-
```
|
|
12
|
-
**Returns:**
|
|
13
|
-
|
|
14
|
-
[SiteverifyResponse](./server-sdk.siteverifyresponse.md) \| null
|
|
15
|
-
|
|
16
|
-
The response from the Friendly Captcha API, or null if the request was not made at all.
|
|
17
|
-
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@friendlycaptcha/server-sdk](./server-sdk.md) > [VerifyResult](./server-sdk.verifyresult.md) > [getResponseError](./server-sdk.verifyresult.getresponseerror.md)
|
|
4
|
-
|
|
5
|
-
## VerifyResult.getResponseError() method
|
|
6
|
-
|
|
7
|
-
**Signature:**
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
getResponseError(): SiteverifyErrorResponseErrorData | null;
|
|
11
|
-
```
|
|
12
|
-
**Returns:**
|
|
13
|
-
|
|
14
|
-
[SiteverifyErrorResponseErrorData](./server-sdk.siteverifyerrorresponseerrordata.md) \| null
|
|
15
|
-
|
|
16
|
-
The `error` field form the response, or null if it is not present.
|
|
17
|
-
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@friendlycaptcha/server-sdk](./server-sdk.md) > [VerifyResult](./server-sdk.verifyresult.md) > [isClientError](./server-sdk.verifyresult.isclienterror.md)
|
|
4
|
-
|
|
5
|
-
## VerifyResult.isClientError() method
|
|
6
|
-
|
|
7
|
-
Something went wrong on the client side, this generally means your configuration is wrong. Check your secrets (API key) and sitekey.
|
|
8
|
-
|
|
9
|
-
See `getResponseError()` for more information.
|
|
10
|
-
|
|
11
|
-
**Signature:**
|
|
12
|
-
|
|
13
|
-
```typescript
|
|
14
|
-
isClientError(): boolean;
|
|
15
|
-
```
|
|
16
|
-
**Returns:**
|
|
17
|
-
|
|
18
|
-
boolean
|
|
19
|
-
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@friendlycaptcha/server-sdk](./server-sdk.md) > [VerifyResult](./server-sdk.verifyresult.md) > [isDecodeError](./server-sdk.verifyresult.isdecodeerror.md)
|
|
4
|
-
|
|
5
|
-
## VerifyResult.isDecodeError() method
|
|
6
|
-
|
|
7
|
-
Something went wrong decoding the response from the Friendly Captcha API.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
isDecodeError(): boolean;
|
|
13
|
-
```
|
|
14
|
-
**Returns:**
|
|
15
|
-
|
|
16
|
-
boolean
|
|
17
|
-
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@friendlycaptcha/server-sdk](./server-sdk.md) > [VerifyResult](./server-sdk.verifyresult.md) > [isEncodeError](./server-sdk.verifyresult.isencodeerror.md)
|
|
4
|
-
|
|
5
|
-
## VerifyResult.isEncodeError() method
|
|
6
|
-
|
|
7
|
-
Was unable to encode the captcha response. This means the captcha response was invalid and should never be accepted.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
isEncodeError(): boolean;
|
|
13
|
-
```
|
|
14
|
-
**Returns:**
|
|
15
|
-
|
|
16
|
-
boolean
|
|
17
|
-
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@friendlycaptcha/server-sdk](./server-sdk.md) > [VerifyResult](./server-sdk.verifyresult.md) > [isRequestOrTimeoutError](./server-sdk.verifyresult.isrequestortimeouterror.md)
|
|
4
|
-
|
|
5
|
-
## VerifyResult.isRequestOrTimeoutError() method
|
|
6
|
-
|
|
7
|
-
Something went wrong making the request to the Friendly Captcha API, perhaps there is a network connection issue?
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
isRequestOrTimeoutError(): boolean;
|
|
13
|
-
```
|
|
14
|
-
**Returns:**
|
|
15
|
-
|
|
16
|
-
boolean
|
|
17
|
-
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@friendlycaptcha/server-sdk](./server-sdk.md) > [VerifyResult](./server-sdk.verifyresult.md) > [isStrict](./server-sdk.verifyresult.isstrict.md)
|
|
4
|
-
|
|
5
|
-
## VerifyResult.isStrict() method
|
|
6
|
-
|
|
7
|
-
**Signature:**
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
isStrict(): boolean;
|
|
11
|
-
```
|
|
12
|
-
**Returns:**
|
|
13
|
-
|
|
14
|
-
boolean
|
|
15
|
-
|
|
16
|
-
Whether strict mode was enabled for this verification.
|
|
17
|
-
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@friendlycaptcha/server-sdk](./server-sdk.md) > [VerifyResult](./server-sdk.verifyresult.md)
|
|
4
|
-
|
|
5
|
-
## VerifyResult class
|
|
6
|
-
|
|
7
|
-
The result of a captcha siteverify request.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export declare class VerifyResult
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Constructors
|
|
16
|
-
|
|
17
|
-
| Constructor | Modifiers | Description |
|
|
18
|
-
| --- | --- | --- |
|
|
19
|
-
| [(constructor)(strict)](./server-sdk.verifyresult._constructor_.md) | | Constructs a new instance of the <code>VerifyResult</code> class |
|
|
20
|
-
|
|
21
|
-
## Properties
|
|
22
|
-
|
|
23
|
-
| Property | Modifiers | Type | Description |
|
|
24
|
-
| --- | --- | --- | --- |
|
|
25
|
-
| [clientErrorType](./server-sdk.verifyresult.clienterrortype.md) | | [VerifyClientErrorCode](./server-sdk.verifyclienterrorcode.md) \| null | |
|
|
26
|
-
| [response](./server-sdk.verifyresult.response.md) | | [SiteverifyResponse](./server-sdk.siteverifyresponse.md) \| null | The response from the Friendly Captcha API, or null if the request was not made at all. |
|
|
27
|
-
| [status](./server-sdk.verifyresult.status.md) | | number | The HTTP status code of the response. <code>-1</code> if there was no response. |
|
|
28
|
-
|
|
29
|
-
## Methods
|
|
30
|
-
|
|
31
|
-
| Method | Modifiers | Description |
|
|
32
|
-
| --- | --- | --- |
|
|
33
|
-
| [getErrorCode()](./server-sdk.verifyresult.geterrorcode.md) | | |
|
|
34
|
-
| [getResponse()](./server-sdk.verifyresult.getresponse.md) | | |
|
|
35
|
-
| [getResponseError()](./server-sdk.verifyresult.getresponseerror.md) | | |
|
|
36
|
-
| [isClientError()](./server-sdk.verifyresult.isclienterror.md) | | <p>Something went wrong on the client side, this generally means your configuration is wrong. Check your secrets (API key) and sitekey.</p><p>See <code>getResponseError()</code> for more information.</p> |
|
|
37
|
-
| [isDecodeError()](./server-sdk.verifyresult.isdecodeerror.md) | | Something went wrong decoding the response from the Friendly Captcha API. |
|
|
38
|
-
| [isEncodeError()](./server-sdk.verifyresult.isencodeerror.md) | | Was unable to encode the captcha response. This means the captcha response was invalid and should never be accepted. |
|
|
39
|
-
| [isRequestOrTimeoutError()](./server-sdk.verifyresult.isrequestortimeouterror.md) | | Something went wrong making the request to the Friendly Captcha API, perhaps there is a network connection issue? |
|
|
40
|
-
| [isStrict()](./server-sdk.verifyresult.isstrict.md) | | |
|
|
41
|
-
| [shouldAccept()](./server-sdk.verifyresult.shouldaccept.md) | | |
|
|
42
|
-
| [shouldReject()](./server-sdk.verifyresult.shouldreject.md) | | |
|
|
43
|
-
| [wasAbleToVerify()](./server-sdk.verifyresult.wasabletoverify.md) | | 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 <code>getErrorCode()</code> and <code>getResponseError()</code> to see what is wrong. |
|
|
44
|
-
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@friendlycaptcha/server-sdk](./server-sdk.md) > [VerifyResult](./server-sdk.verifyresult.md) > [response](./server-sdk.verifyresult.response.md)
|
|
4
|
-
|
|
5
|
-
## VerifyResult.response property
|
|
6
|
-
|
|
7
|
-
The response from the Friendly Captcha API, or null if the request was not made at all.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
response: SiteverifyResponse | null;
|
|
13
|
-
```
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@friendlycaptcha/server-sdk](./server-sdk.md) > [VerifyResult](./server-sdk.verifyresult.md) > [shouldAccept](./server-sdk.verifyresult.shouldaccept.md)
|
|
4
|
-
|
|
5
|
-
## VerifyResult.shouldAccept() method
|
|
6
|
-
|
|
7
|
-
**Signature:**
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
shouldAccept(): boolean;
|
|
11
|
-
```
|
|
12
|
-
**Returns:**
|
|
13
|
-
|
|
14
|
-
boolean
|
|
15
|
-
|
|
16
|
-
Whether the captcha should be accepted. Note that this does not necessarily mean it was verified.
|
|
17
|
-
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@friendlycaptcha/server-sdk](./server-sdk.md) > [VerifyResult](./server-sdk.verifyresult.md) > [shouldReject](./server-sdk.verifyresult.shouldreject.md)
|
|
4
|
-
|
|
5
|
-
## VerifyResult.shouldReject() method
|
|
6
|
-
|
|
7
|
-
**Signature:**
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
shouldReject(): boolean;
|
|
11
|
-
```
|
|
12
|
-
**Returns:**
|
|
13
|
-
|
|
14
|
-
boolean
|
|
15
|
-
|
|
16
|
-
The reverse of `shouldAccept()`<!-- -->.
|
|
17
|
-
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@friendlycaptcha/server-sdk](./server-sdk.md) > [VerifyResult](./server-sdk.verifyresult.md) > [status](./server-sdk.verifyresult.status.md)
|
|
4
|
-
|
|
5
|
-
## VerifyResult.status property
|
|
6
|
-
|
|
7
|
-
The HTTP status code of the response. `-1` if there was no response.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
status: number;
|
|
13
|
-
```
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@friendlycaptcha/server-sdk](./server-sdk.md) > [VerifyResult](./server-sdk.verifyresult.md) > [wasAbleToVerify](./server-sdk.verifyresult.wasabletoverify.md)
|
|
4
|
-
|
|
5
|
-
## VerifyResult.wasAbleToVerify() method
|
|
6
|
-
|
|
7
|
-
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.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
wasAbleToVerify(): boolean;
|
|
13
|
-
```
|
|
14
|
-
**Returns:**
|
|
15
|
-
|
|
16
|
-
boolean
|
|
17
|
-
|
package/example/README.md
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Friendly Captcha Express Example
|
|
2
|
-
|
|
3
|
-
This application integrates Friendly Captcha for form submissions using Express.
|
|
4
|
-
|
|
5
|
-
### Requirements
|
|
6
|
-
|
|
7
|
-
- NPM
|
|
8
|
-
- Your Friendly Captcha API key and sitekey.
|
|
9
|
-
|
|
10
|
-
### Start the application
|
|
11
|
-
|
|
12
|
-
- Install dependencies
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
npm install
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
- Setup env variables and start the application
|
|
19
|
-
|
|
20
|
-
> NOTE: `FRC_SITEVERIFY_ENDPOINT` and `FRC_WIDGET_ENDPOINT` are optional. If not set, the default values will be used. You can also use `global` or `eu` as shorthands for both.
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
FRC_APIKEY=<your API key> FRC_SITEKEY=<your sitekey> FRC_SITEVERIFY_ENDPOINT=<siteverify endpoint> FRC_WIDGET_ENDPOINT=<widget endpoint> npm run start
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
# Usage
|
|
27
|
-
|
|
28
|
-
Navigate to http://localhost:3000/ in your browser.
|
|
29
|
-
Fill out the form and submit. The Friendly Captcha verification will protect the form from bots.
|