@prosopo/server 0.2.17 → 0.2.19
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/README.md +2 -6
- package/package.json +11 -7
package/README.md
CHANGED
|
@@ -15,8 +15,8 @@ npm install @prosopo/server --save
|
|
|
15
15
|
Simply import the `ProsopoServer` class and instantiate it with your Procaptcha API key.
|
|
16
16
|
|
|
17
17
|
```typescript
|
|
18
|
-
import {ApiParams, ProcaptchaResponse} from '@prosopo/types'
|
|
19
|
-
import {ProsopoServer} from '@prosopo/server'
|
|
18
|
+
import { ApiParams, ProcaptchaResponse } from '@prosopo/types'
|
|
19
|
+
import { ProsopoServer } from '@prosopo/server'
|
|
20
20
|
|
|
21
21
|
async function getProsopoServer() {
|
|
22
22
|
const config = getProsopoConfig()
|
|
@@ -27,11 +27,9 @@ async function getProsopoServer() {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
async function protectedFunction(server: ProsopoServer, payload: ProcaptchaResponse) {
|
|
30
|
-
|
|
31
30
|
if (await server.isVerified(payload[ApiParams.procaptchaResponse])) {
|
|
32
31
|
// perform CAPTCHA protected action
|
|
33
32
|
}
|
|
34
|
-
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
const payload = getPayloadFromRequest() // your request payload
|
|
@@ -40,8 +38,6 @@ getProsopoServer().then((server) => {
|
|
|
40
38
|
// ...
|
|
41
39
|
})
|
|
42
40
|
})
|
|
43
|
-
|
|
44
|
-
|
|
45
41
|
```
|
|
46
42
|
|
|
47
43
|
The full example can be seen [here](https://github.com/prosopo/captcha/blob/main/demos/client-example-server/src/app.ts).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosopo/server",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.19",
|
|
4
4
|
"description": "NodeJS package for server side communication with the prosopo captcha client",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -18,8 +18,12 @@
|
|
|
18
18
|
"clean": "tsc --build --clean",
|
|
19
19
|
"build": "tsc --build --verbose tsconfig.json",
|
|
20
20
|
"build:cjs": "npx vite --config vite.cjs.config.ts build",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
21
|
+
"eslint": "npx eslint . --no-error-on-unmatched-pattern --ignore-path ../../.eslintignore",
|
|
22
|
+
"eslint:fix": "npm run eslint -- --fix",
|
|
23
|
+
"prettier": "npx prettier . --check --no-error-on-unmatched-pattern --ignore-path ../../.eslintignore",
|
|
24
|
+
"prettier:fix": "npm run prettier -- --write",
|
|
25
|
+
"lint": "npm run eslint && npm run prettier",
|
|
26
|
+
"lint:fix": "npm run eslint:fix && npm run prettier:fix"
|
|
23
27
|
},
|
|
24
28
|
"repository": {
|
|
25
29
|
"type": "git",
|
|
@@ -37,10 +41,10 @@
|
|
|
37
41
|
"@polkadot/keyring": "12.6.1",
|
|
38
42
|
"@polkadot/rpc-provider": "10.11.1",
|
|
39
43
|
"@polkadot/types": "10.11.1",
|
|
40
|
-
"@prosopo/api": "0.2.
|
|
41
|
-
"@prosopo/contract": "0.2.
|
|
42
|
-
"@prosopo/captcha-contract": "0.2.
|
|
43
|
-
"@prosopo/types": "0.2.
|
|
44
|
+
"@prosopo/api": "0.2.19",
|
|
45
|
+
"@prosopo/contract": "0.2.19",
|
|
46
|
+
"@prosopo/captcha-contract": "0.2.19",
|
|
47
|
+
"@prosopo/types": "0.2.19"
|
|
44
48
|
},
|
|
45
49
|
"devDependencies": {
|
|
46
50
|
"tslib": "2.6.2",
|