@prosopo/procaptcha-frictionless 2.21.5 → 2.21.7
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/.turbo/turbo-build$colon$cjs.log +9 -9
- package/.turbo/turbo-build$colon$tsc.log +26 -26
- package/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +71 -0
- package/dist/cjs/customDetectBot.cjs +10 -3
- package/dist/cjs/frictionlessResultGuard.cjs +31 -25
- package/dist/cjs/procaptchaFrictionless.cjs +18 -14
- package/dist/customDetectBot.d.ts.map +1 -1
- package/dist/customDetectBot.js +10 -3
- package/dist/customDetectBot.js.map +1 -1
- package/dist/errorSites.d.ts +10 -0
- package/dist/errorSites.d.ts.map +1 -0
- package/dist/errorSites.js +2 -0
- package/dist/errorSites.js.map +1 -0
- package/dist/frictionlessResultGuard.d.ts +3 -5
- package/dist/frictionlessResultGuard.d.ts.map +1 -1
- package/dist/frictionlessResultGuard.js +31 -25
- package/dist/frictionlessResultGuard.js.map +1 -1
- package/dist/procaptchaFrictionless.d.ts.map +1 -1
- package/dist/procaptchaFrictionless.js +19 -15
- package/dist/procaptchaFrictionless.js.map +1 -1
- package/dist/tests/customDetectBot.test.js +5 -5
- package/dist/tests/customDetectBot.test.js.map +1 -1
- package/dist/tests/escalationHandoff.integration.test.js +4 -3
- package/dist/tests/escalationHandoff.integration.test.js.map +1 -1
- package/dist/tests/frictionlessResultGuard.test.js +63 -43
- package/dist/tests/frictionlessResultGuard.test.js.map +1 -1
- package/dist/tests/procaptchaFrictionless.test.js +12 -4
- package/dist/tests/procaptchaFrictionless.test.js.map +1 -1
- package/package.json +17 -17
|
@@ -8,7 +8,6 @@ ViteCommonJSConfig: .
|
|
|
8
8
|
'/home/runner/work/captcha/captcha/packages/util/tsconfig.json',
|
|
9
9
|
'/home/runner/work/captcha/captcha/packages/util-crypto/tsconfig.json',
|
|
10
10
|
'/home/runner/work/captcha/captcha/packages/common/tsconfig.json',
|
|
11
|
-
'/home/runner/work/captcha/captcha/packages/logger/tsconfig.json',
|
|
12
11
|
'/home/runner/work/captcha/captcha/packages/procaptcha-audio/tsconfig.json',
|
|
13
12
|
'/home/runner/work/captcha/captcha/packages/procaptcha-common/tsconfig.json',
|
|
14
13
|
'/home/runner/work/captcha/captcha/packages/load-balancer/tsconfig.json',
|
|
@@ -22,7 +21,8 @@ ViteCommonJSConfig: .
|
|
|
22
21
|
'/home/runner/work/captcha/captcha/packages/procaptcha-puzzle/tsconfig.json',
|
|
23
22
|
'/home/runner/work/captcha/captcha/packages/procaptcha-react/tsconfig.json',
|
|
24
23
|
'/home/runner/work/captcha/captcha/packages/procaptcha/tsconfig.json',
|
|
25
|
-
'/home/runner/work/captcha/captcha/packages/datasets/tsconfig.json'
|
|
24
|
+
'/home/runner/work/captcha/captcha/packages/datasets/tsconfig.json',
|
|
25
|
+
'/home/runner/work/captcha/captcha/packages/logger/tsconfig.json'
|
|
26
26
|
]
|
|
27
27
|
}
|
|
28
28
|
{
|
|
@@ -33,7 +33,6 @@ ViteCommonJSConfig: .
|
|
|
33
33
|
'@prosopo/util',
|
|
34
34
|
'@prosopo/util-crypto',
|
|
35
35
|
'@prosopo/common',
|
|
36
|
-
'@prosopo/logger',
|
|
37
36
|
'@prosopo/procaptcha-audio',
|
|
38
37
|
'@prosopo/procaptcha-common',
|
|
39
38
|
'@prosopo/load-balancer',
|
|
@@ -47,11 +46,12 @@ ViteCommonJSConfig: .
|
|
|
47
46
|
'@prosopo/procaptcha-puzzle',
|
|
48
47
|
'@prosopo/procaptcha-react',
|
|
49
48
|
'@prosopo/procaptcha',
|
|
50
|
-
'@prosopo/datasets'
|
|
49
|
+
'@prosopo/datasets',
|
|
50
|
+
'@prosopo/logger'
|
|
51
51
|
]
|
|
52
52
|
}
|
|
53
53
|
[33mThe plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the [1mresolve.tsconfigPaths[22m option. You can remove the plugin and set [1mresolve.tsconfigPaths: true[22m in your Vite config instead.[39m
|
|
54
|
-
[36mvite v8.1.
|
|
54
|
+
[36mvite v8.1.6 [32mbuilding ssr environment for production...[36m[39m
|
|
55
55
|
Bundle build started
|
|
56
56
|
[2K
|
|
57
57
|
✓ 9 modules transformed.
|
|
@@ -60,10 +60,10 @@ computing gzip size...
|
|
|
60
60
|
dist/cjs/index.cjs 0.55 kB │ gzip: 0.21 kB
|
|
61
61
|
dist/cjs/detectorLoader.cjs 1.65 kB │ gzip: 0.90 kB
|
|
62
62
|
dist/cjs/sessionInvalidatedRecovery.cjs 2.50 kB │ gzip: 1.14 kB
|
|
63
|
-
dist/cjs/frictionlessResultGuard.cjs 2.
|
|
63
|
+
dist/cjs/frictionlessResultGuard.cjs 2.78 kB │ gzip: 1.42 kB
|
|
64
64
|
dist/cjs/detectorPrefetch.cjs 3.12 kB │ gzip: 1.40 kB
|
|
65
65
|
dist/cjs/authenticatedBadge.cjs 3.81 kB │ gzip: 1.45 kB
|
|
66
|
-
dist/cjs/customDetectBot.cjs 6.
|
|
67
|
-
dist/cjs/procaptchaFrictionless.cjs 13.
|
|
66
|
+
dist/cjs/customDetectBot.cjs 6.35 kB │ gzip: 1.91 kB
|
|
67
|
+
dist/cjs/procaptchaFrictionless.cjs 13.84 kB │ gzip: 3.84 kB
|
|
68
68
|
|
|
69
|
-
[32m✓ built in
|
|
69
|
+
[32m✓ built in 35ms[39m
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
$ tsc --build --verbose
|
|
2
|
-
|
|
2
|
+
7:41:14 PM - Projects in this build:
|
|
3
3
|
* ../../dev/config/tsconfig.json
|
|
4
4
|
* ../util/tsconfig.json
|
|
5
5
|
* ../locale/tsconfig.json
|
|
6
6
|
* ../util-crypto/tsconfig.json
|
|
7
7
|
* ../types/tsconfig.json
|
|
8
8
|
* ../api/tsconfig.json
|
|
9
|
-
* ../logger/tsconfig.json
|
|
10
9
|
* ../common/tsconfig.json
|
|
11
10
|
* ../load-balancer/tsconfig.json
|
|
12
11
|
* ../widget-skeleton/tsconfig.json
|
|
@@ -19,56 +18,57 @@ $ tsc --build --verbose
|
|
|
19
18
|
* ../procaptcha-icon-order/tsconfig.json
|
|
20
19
|
* ../procaptcha-pow/tsconfig.json
|
|
21
20
|
* ../procaptcha-puzzle/tsconfig.json
|
|
21
|
+
* ../logger/tsconfig.json
|
|
22
22
|
* ../datasets/tsconfig.json
|
|
23
23
|
* ../procaptcha/tsconfig.json
|
|
24
24
|
* ../procaptcha-react/tsconfig.json
|
|
25
25
|
* tsconfig.json
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
7:41:14 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/webpack.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
7:41:14 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
7:41:14 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/process.ts' is older than output '../locale/tsconfig.tsbuildinfo'
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
7:41:14 PM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/tsconfig.tsbuildinfo'
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
7:41:14 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/types.test-d.ts' is older than output '../types/tsconfig.tsbuildinfo'
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
7:41:14 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
7:41:14 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/tests/utils/objectUtils.unit.test.ts' is older than output '../common/tsconfig.tsbuildinfo'
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
7:41:14 PM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/balancer.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
7:41:14 PM - Project '../widget-skeleton/tsconfig.json' is up to date because newest input '../widget-skeleton/src/webComponent/createWidget.ts' is older than output '../widget-skeleton/tsconfig.tsbuildinfo'
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
7:41:14 PM - Project '../fingerprintjs/tsconfig.json' is up to date because newest input '../fingerprintjs/src/utils/browser.ts' is older than output '../fingerprintjs/tsconfig.tsbuildinfo'
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
7:41:14 PM - Project '../fingerprint/tsconfig.json' is up to date because newest input '../fingerprint/src/index.test.ts' is older than output '../fingerprint/tsconfig.tsbuildinfo'
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
7:41:14 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/keyring/keyring.test.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
7:41:14 PM - Project '../account/tsconfig.json' is up to date because newest input '../account/src/custom.d.ts' is older than output '../account/tsconfig.tsbuildinfo'
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
7:41:14 PM - Project '../procaptcha-common/tsconfig.json' is up to date because newest input '../procaptcha-common/src/extensionLoader.ts' is older than output '../procaptcha-common/tsconfig.tsbuildinfo'
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
7:41:14 PM - Project '../procaptcha-audio/tsconfig.json' is up to date because newest input '../procaptcha-audio/src/errorSites.ts' is older than output '../procaptcha-audio/tsconfig.tsbuildinfo'
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
7:41:14 PM - Project '../procaptcha-icon-order/tsconfig.json' is up to date because newest input '../procaptcha-icon-order/src/tests/iconOrderCanvas.unit.test.ts' is older than output '../procaptcha-icon-order/tsconfig.tsbuildinfo'
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
7:41:14 PM - Project '../procaptcha-pow/tsconfig.json' is up to date because newest input '../procaptcha-pow/src/tests/manager.unit.test.ts' is older than output '../procaptcha-pow/tsconfig.tsbuildinfo'
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
7:41:14 PM - Project '../procaptcha-puzzle/tsconfig.json' is up to date because newest input '../procaptcha-puzzle/src/tests/invisibleCanvasVisibility.unit.test.ts' is older than output '../procaptcha-puzzle/tsconfig.tsbuildinfo'
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
7:41:14 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/tests/loggerBrowser.unit.test.ts' is older than output '../logger/tsconfig.tsbuildinfo'
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
7:41:14 PM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/errorSites.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
7:41:14 PM - Project '../procaptcha/tsconfig.json' is up to date because newest input '../procaptcha/src/errorSites.ts' is older than output '../procaptcha/tsconfig.tsbuildinfo'
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
7:41:14 PM - Project '../procaptcha-react/tsconfig.json' is up to date because newest input '../procaptcha-react/src/errorSites.ts' is older than output '../procaptcha-react/tsconfig.tsbuildinfo'
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
7:41:14 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
7:41:14 PM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-frictionless/tsconfig.json'...
|
|
74
74
|
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -9,7 +9,6 @@ ViteEsmConfig: .
|
|
|
9
9
|
'/home/runner/work/captcha/captcha/packages/util/tsconfig.json',
|
|
10
10
|
'/home/runner/work/captcha/captcha/packages/util-crypto/tsconfig.json',
|
|
11
11
|
'/home/runner/work/captcha/captcha/packages/common/tsconfig.json',
|
|
12
|
-
'/home/runner/work/captcha/captcha/packages/logger/tsconfig.json',
|
|
13
12
|
'/home/runner/work/captcha/captcha/packages/procaptcha-audio/tsconfig.json',
|
|
14
13
|
'/home/runner/work/captcha/captcha/packages/procaptcha-common/tsconfig.json',
|
|
15
14
|
'/home/runner/work/captcha/captcha/packages/load-balancer/tsconfig.json',
|
|
@@ -23,7 +22,8 @@ ViteEsmConfig: .
|
|
|
23
22
|
'/home/runner/work/captcha/captcha/packages/procaptcha-puzzle/tsconfig.json',
|
|
24
23
|
'/home/runner/work/captcha/captcha/packages/procaptcha-react/tsconfig.json',
|
|
25
24
|
'/home/runner/work/captcha/captcha/packages/procaptcha/tsconfig.json',
|
|
26
|
-
'/home/runner/work/captcha/captcha/packages/datasets/tsconfig.json'
|
|
25
|
+
'/home/runner/work/captcha/captcha/packages/datasets/tsconfig.json',
|
|
26
|
+
'/home/runner/work/captcha/captcha/packages/logger/tsconfig.json'
|
|
27
27
|
]
|
|
28
28
|
}
|
|
29
29
|
{
|
|
@@ -34,7 +34,6 @@ ViteEsmConfig: .
|
|
|
34
34
|
'@prosopo/util',
|
|
35
35
|
'@prosopo/util-crypto',
|
|
36
36
|
'@prosopo/common',
|
|
37
|
-
'@prosopo/logger',
|
|
38
37
|
'@prosopo/procaptcha-audio',
|
|
39
38
|
'@prosopo/procaptcha-common',
|
|
40
39
|
'@prosopo/load-balancer',
|
|
@@ -48,11 +47,12 @@ ViteEsmConfig: .
|
|
|
48
47
|
'@prosopo/procaptcha-puzzle',
|
|
49
48
|
'@prosopo/procaptcha-react',
|
|
50
49
|
'@prosopo/procaptcha',
|
|
51
|
-
'@prosopo/datasets'
|
|
50
|
+
'@prosopo/datasets',
|
|
51
|
+
'@prosopo/logger'
|
|
52
52
|
]
|
|
53
53
|
}
|
|
54
54
|
[33mThe plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the [1mresolve.tsconfigPaths[22m option. You can remove the plugin and set [1mresolve.tsconfigPaths: true[22m in your Vite config instead.[39m
|
|
55
|
-
[36mvite v8.1.
|
|
55
|
+
[36mvite v8.1.6 [32mbuilding ssr environment for production...[36m[39m
|
|
56
56
|
Bundle build started
|
|
57
57
|
[2K
|
|
58
58
|
✓ 9 modules transformed.
|
|
@@ -62,10 +62,10 @@ dist/_virtual/_rolldown/runtime.js 0.04 kB │ gzip: 0.06 kB
|
|
|
62
62
|
dist/index.js 0.33 kB │ gzip: 0.15 kB
|
|
63
63
|
dist/detectorLoader.js 1.63 kB │ gzip: 0.90 kB
|
|
64
64
|
dist/sessionInvalidatedRecovery.js 2.41 kB │ gzip: 1.13 kB
|
|
65
|
-
dist/frictionlessResultGuard.js 2.
|
|
65
|
+
dist/frictionlessResultGuard.js 2.71 kB │ gzip: 1.41 kB
|
|
66
66
|
dist/detectorPrefetch.js 2.98 kB │ gzip: 1.37 kB
|
|
67
67
|
dist/authenticatedBadge.js 3.30 kB │ gzip: 1.42 kB
|
|
68
|
-
dist/customDetectBot.js 6.
|
|
69
|
-
dist/procaptchaFrictionless.js 13.
|
|
68
|
+
dist/customDetectBot.js 6.15 kB │ gzip: 1.88 kB
|
|
69
|
+
dist/procaptchaFrictionless.js 13.15 kB │ gzip: 3.81 kB
|
|
70
70
|
|
|
71
|
-
[32m✓ built in
|
|
71
|
+
[32m✓ built in 40ms[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,76 @@
|
|
|
1
1
|
# @prosopo/procaptcha-frictionless
|
|
2
2
|
|
|
3
|
+
## 2.21.7
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- Updated dependencies [49892fc]
|
|
7
|
+
- @prosopo/locale@3.12.1
|
|
8
|
+
- @prosopo/procaptcha-audio@0.2.8
|
|
9
|
+
- @prosopo/procaptcha-icon-order@0.2.8
|
|
10
|
+
- @prosopo/procaptcha-pow@2.13.17
|
|
11
|
+
- @prosopo/procaptcha-puzzle@2.17.7
|
|
12
|
+
- @prosopo/procaptcha-react@2.14.8
|
|
13
|
+
- @prosopo/types@5.17.1
|
|
14
|
+
- @prosopo/api@4.7.5
|
|
15
|
+
- @prosopo/common@3.3.0
|
|
16
|
+
- @prosopo/procaptcha-common@2.21.7
|
|
17
|
+
|
|
18
|
+
## 2.21.6
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- 46b97b7: Roll up the open Dependabot updates: express 5 (with `@types/express` 5), dotenv 18, undici 8, geolib 4, vitest 5, vite 8.1.6 everywhere, 17 minor and patch bumps (Babel, mongoose, i18next, ip-address, turbo and others), `@angular/router` in the Angular demo, and a GitHub Actions bump.
|
|
22
|
+
|
|
23
|
+
The whole vitest family moves to 5.0.4, including `@vitest/coverage-v8`, because `@vitest/browser-playwright` 5 only works with vitest 5. The `@types/express-serve-static-core` override moves to 5.1.3 to match `@types/express` 5.
|
|
24
|
+
|
|
25
|
+
`@prosopo/dotenv` now loads env files with `quiet: true`. Since dotenv 17, every load prints an "injected env" line to stderr unless told not to.
|
|
26
|
+
- d2148c8: Errors now carry a fixed code and a site instead of a translation key.
|
|
27
|
+
|
|
28
|
+
Every error is a `ProsopoError` with a `code` from one list in
|
|
29
|
+
`@prosopo/common` (`ERROR_CODES`) and an `errorSite` such as `PROV-12`, which
|
|
30
|
+
names the one place it was thrown. Together they make the `errorId`, e.g.
|
|
31
|
+
`SITE_KEY_INVALID:PROV-31`, which the widget shows after the message so a
|
|
32
|
+
screenshot is enough to find the throw.
|
|
33
|
+
|
|
34
|
+
What a client sees:
|
|
35
|
+
|
|
36
|
+
- A public error (bad site key, blocked network, and so on) sends its code,
|
|
37
|
+
English message, data and errorId.
|
|
38
|
+
- Anything else sends only `BACKEND_ERROR:<site>` (or `FRONTEND_ERROR:<site>`
|
|
39
|
+
from the widget) and a status. Internal details never leave the server.
|
|
40
|
+
|
|
41
|
+
The provider no longer translates errors. The widget looks up
|
|
42
|
+
`ERRORS.<CODE>` in its catalogue and falls back to the English message. The
|
|
43
|
+
old error classes (`ProsopoApiError`, `ProsopoEnvError` and the rest), the
|
|
44
|
+
`key`/`messageEn` fields and `localiseErrorMessage` are gone.
|
|
45
|
+
|
|
46
|
+
Other changes in behaviour:
|
|
47
|
+
|
|
48
|
+
- An error with no specific code is a hidden 500.
|
|
49
|
+
- Errors no longer log themselves when they are created. The server logs each
|
|
50
|
+
unhandled one once: 5xx as errors, 4xx at debug.
|
|
51
|
+
- An invalid PoW signature is a 401 instead of a 500.
|
|
52
|
+
- `stringifyBigInts` returns a copy instead of changing its input, so frozen
|
|
53
|
+
error context can be logged.
|
|
54
|
+
- The provider's last hand-written error replies now use the same error body.
|
|
55
|
+
These were the missing-header 401s, the access-policy block, autoBan, the
|
|
56
|
+
metrics 401/403 and the rate limiter. The rate limiter answers with a new
|
|
57
|
+
public `RATE_LIMITED` (429) code.
|
|
58
|
+
- Updated dependencies [f31f0d5]
|
|
59
|
+
- Updated dependencies [46b97b7]
|
|
60
|
+
- Updated dependencies [d2148c8]
|
|
61
|
+
- Updated dependencies [2bcf2fe]
|
|
62
|
+
- @prosopo/widget-skeleton@2.10.3
|
|
63
|
+
- @prosopo/api@4.7.4
|
|
64
|
+
- @prosopo/common@3.3.0
|
|
65
|
+
- @prosopo/locale@3.12.0
|
|
66
|
+
- @prosopo/procaptcha-audio@0.2.7
|
|
67
|
+
- @prosopo/procaptcha-common@2.21.6
|
|
68
|
+
- @prosopo/procaptcha-icon-order@0.2.7
|
|
69
|
+
- @prosopo/procaptcha-pow@2.13.16
|
|
70
|
+
- @prosopo/procaptcha-puzzle@2.17.6
|
|
71
|
+
- @prosopo/procaptcha-react@2.14.7
|
|
72
|
+
- @prosopo/types@5.17.0
|
|
73
|
+
|
|
3
74
|
## 2.21.5
|
|
4
75
|
### Patch Changes
|
|
5
76
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const require_detectorLoader = require("./detectorLoader.cjs");
|
|
2
2
|
const require_detectorPrefetch = require("./detectorPrefetch.cjs");
|
|
3
|
+
let _prosopo_common = require("@prosopo/common");
|
|
3
4
|
let _prosopo_locale = require("@prosopo/locale");
|
|
4
5
|
let _prosopo_procaptcha_common = require("@prosopo/procaptcha-common");
|
|
5
6
|
let _prosopo_api = require("@prosopo/api");
|
|
6
|
-
let _prosopo_common = require("@prosopo/common");
|
|
7
7
|
//#region src/customDetectBot.ts
|
|
8
8
|
var ASSIGN_TIMEOUT_MS = 1e4;
|
|
9
9
|
var sanitiseHref = (href) => {
|
|
@@ -53,7 +53,11 @@ var withTimeout = async (promise, ms) => {
|
|
|
53
53
|
let timeoutId;
|
|
54
54
|
const timeoutPromise = new Promise((_, reject) => {
|
|
55
55
|
timeoutId = setTimeout(() => {
|
|
56
|
-
reject(new _prosopo_common.
|
|
56
|
+
reject(new _prosopo_common.ProsopoError({
|
|
57
|
+
code: "UNEXPECTED",
|
|
58
|
+
errorSite: "FRIC-1",
|
|
59
|
+
message: "Unknown API error"
|
|
60
|
+
}));
|
|
57
61
|
}, ms);
|
|
58
62
|
});
|
|
59
63
|
try {
|
|
@@ -66,7 +70,10 @@ var withTimeout = async (promise, ms) => {
|
|
|
66
70
|
}
|
|
67
71
|
};
|
|
68
72
|
var customDetectBot = async (config, container, restartFn, retryContext, refreshOf, switchToImage) => {
|
|
69
|
-
if (!config.account.address) throw new _prosopo_common.
|
|
73
|
+
if (!config.account.address) throw new _prosopo_common.ProsopoError({
|
|
74
|
+
code: "SITE_KEY_MISSING",
|
|
75
|
+
errorSite: "FRIC-2"
|
|
76
|
+
});
|
|
70
77
|
const ipMode = (0, _prosopo_procaptcha_common.pickIpMode)(config);
|
|
71
78
|
const extClassPromise = (0, _prosopo_procaptcha_common.ExtensionLoader)(config.web2);
|
|
72
79
|
const prefetched = !retryContext || retryContext.attempt <= 1 ? require_detectorPrefetch.takePrefetchedDetector(config.defaultEnvironment, ipMode, config.account.address) : void 0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/frictionlessResultGuard.ts
|
|
2
2
|
/**
|
|
3
|
-
* Error
|
|
3
|
+
* Error codes that describe the caller's situation rather than the provider's
|
|
4
4
|
* health, so re-rolling onto another provider would return the same answer.
|
|
5
5
|
*
|
|
6
6
|
* Two groups. Integration faults (site key, origin, captcha type) need the
|
|
@@ -12,31 +12,31 @@
|
|
|
12
12
|
* Anything outside this list is treated as the provider failing, not the
|
|
13
13
|
* caller: see {@link evaluateFrictionlessResult}.
|
|
14
14
|
*/
|
|
15
|
-
var
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
15
|
+
var TERMINAL_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
16
|
+
"SITE_KEY_NOT_REGISTERED",
|
|
17
|
+
"SITE_KEY_INVALID",
|
|
18
|
+
"ORIGIN_NOT_ALLOWED",
|
|
19
|
+
"INCORRECT_CAPTCHA_TYPE",
|
|
20
|
+
"ACCESS_POLICY_BLOCK",
|
|
21
|
+
"ABUSER_BLOCKED",
|
|
22
|
+
"CRAWLER_BLOCKED",
|
|
23
|
+
"DATACENTER_BLOCKED",
|
|
24
|
+
"DISALLOWED_WEBVIEW",
|
|
25
|
+
"MOBILE_BLOCKED",
|
|
26
|
+
"PROXY_BLOCKED",
|
|
27
|
+
"SATELLITE_BLOCKED",
|
|
28
|
+
"TOR_BLOCKED",
|
|
29
|
+
"VPN_BLOCKED",
|
|
30
|
+
"FORBIDDEN",
|
|
31
|
+
"UNAUTHORIZED",
|
|
32
|
+
"NO_SESSION_FOUND"
|
|
33
33
|
]);
|
|
34
34
|
var MISSING_CAPTCHA_TYPE_MESSAGE = "Frictionless response missing captchaType; halting captcha mount";
|
|
35
35
|
/**
|
|
36
36
|
* Decide whether a `/frictionless` response is safe to mount an inner widget
|
|
37
37
|
* against.
|
|
38
38
|
*
|
|
39
|
-
* `result.error?.
|
|
39
|
+
* `result.error?.code` catches the well-formed error shape emitted when
|
|
40
40
|
* the provider surfaces a normal captcha error. A response with no
|
|
41
41
|
* `captchaType` is the other failure mode: request-time short-circuits
|
|
42
42
|
* (access-policy hard-block, decision-machine autoBan, domain / header
|
|
@@ -51,13 +51,19 @@ var MISSING_CAPTCHA_TYPE_MESSAGE = "Frictionless response missing captchaType; h
|
|
|
51
51
|
* is frictionless-configured, so a direct pow call isn't allowed).
|
|
52
52
|
*/
|
|
53
53
|
var evaluateFrictionlessResult = (result) => {
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
const code = result.error?.code;
|
|
55
|
+
if (code) {
|
|
56
|
+
const errorId = result.error?.errorId ?? code;
|
|
57
|
+
const message = result.error?.message;
|
|
56
58
|
return {
|
|
57
59
|
kind: "error",
|
|
58
|
-
message:
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
message: message ?? errorId,
|
|
61
|
+
error: {
|
|
62
|
+
code,
|
|
63
|
+
errorId,
|
|
64
|
+
...message !== void 0 && { message }
|
|
65
|
+
},
|
|
66
|
+
retryable: !TERMINAL_ERROR_CODES.has(code)
|
|
61
67
|
};
|
|
62
68
|
}
|
|
63
69
|
if (!result.captchaType) return {
|
|
@@ -2,12 +2,13 @@ const require_authenticatedBadge = require("./authenticatedBadge.cjs");
|
|
|
2
2
|
const require_customDetectBot = require("./customDetectBot.cjs");
|
|
3
3
|
const require_frictionlessResultGuard = require("./frictionlessResultGuard.cjs");
|
|
4
4
|
const require_sessionInvalidatedRecovery = require("./sessionInvalidatedRecovery.cjs");
|
|
5
|
+
let _prosopo_common = require("@prosopo/common");
|
|
5
6
|
let _prosopo_locale = require("@prosopo/locale");
|
|
6
7
|
let _prosopo_procaptcha_common = require("@prosopo/procaptcha-common");
|
|
7
8
|
let _prosopo_types = require("@prosopo/types");
|
|
8
9
|
let _prosopo_widget_skeleton = require("@prosopo/widget-skeleton");
|
|
9
10
|
//#region src/procaptchaFrictionless.ts
|
|
10
|
-
var
|
|
11
|
+
var frontendError = (error) => (0, _prosopo_common.toPublicError)(error, "FRONTEND_ERROR");
|
|
11
12
|
var MAX_PRESS_HOLD_MS = 1e3;
|
|
12
13
|
var PROCAPTCHA_EXECUTE_EVENT = "procaptcha:execute";
|
|
13
14
|
var ProcaptchaLoader = async () => (await import("@prosopo/procaptcha-react")).mountProcaptchaImageWidget;
|
|
@@ -101,16 +102,13 @@ var mountProcaptchaFrictionless = (container, props) => {
|
|
|
101
102
|
teardown.add(() => clearTimeout(timer));
|
|
102
103
|
};
|
|
103
104
|
const cannotLoadText = () => i18n.isInitialized ? i18n.t("WIDGET.CANNOT_LOAD") : "Cannot load CAPTCHA";
|
|
104
|
-
const fallOverWithStyle = (
|
|
105
|
-
if ("
|
|
105
|
+
const fallOverWithStyle = (error) => {
|
|
106
|
+
if (error?.code === "NO_SESSION_FOUND") {
|
|
106
107
|
restartComponentTimeout();
|
|
107
108
|
renderPlaceholder(config.mode, void 0, true);
|
|
108
109
|
return;
|
|
109
110
|
}
|
|
110
|
-
renderPlaceholder(config.mode,
|
|
111
|
-
message: errorMessage,
|
|
112
|
-
key: errorKey
|
|
113
|
-
}) : cannotLoadText(), false);
|
|
111
|
+
renderPlaceholder(config.mode, error ? (0, _prosopo_locale.localiseError)(i18n, error) : cannotLoadText(), false);
|
|
114
112
|
};
|
|
115
113
|
const replayPendingExecute = () => {
|
|
116
114
|
if (!pendingExecute) return;
|
|
@@ -134,9 +132,12 @@ var mountProcaptchaFrictionless = (container, props) => {
|
|
|
134
132
|
start();
|
|
135
133
|
return;
|
|
136
134
|
}
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
135
|
+
const error = frontendError(new _prosopo_common.ProsopoError({
|
|
136
|
+
code: "NO_SESSION_FOUND",
|
|
137
|
+
errorSite: "FRIC-3"
|
|
138
|
+
}));
|
|
139
|
+
events.onError(new Error((0, _prosopo_locale.localiseError)(i18n, error)));
|
|
140
|
+
fallOverWithStyle(error);
|
|
140
141
|
};
|
|
141
142
|
const onReload = (x, y, options) => {
|
|
142
143
|
pendingRetryCoords.current = require_sessionInvalidatedRecovery.normaliseRetryCoords(x, y);
|
|
@@ -232,9 +233,12 @@ var mountProcaptchaFrictionless = (container, props) => {
|
|
|
232
233
|
};
|
|
233
234
|
const start = async () => {
|
|
234
235
|
if (!(0, _prosopo_procaptcha_common.isSecureBrowserContext)()) {
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
236
|
+
const error = frontendError(new _prosopo_common.ProsopoError({
|
|
237
|
+
code: "INSECURE_CONTEXT",
|
|
238
|
+
errorSite: "FRIC-4"
|
|
239
|
+
}));
|
|
240
|
+
events.onError(new Error((0, _prosopo_locale.localiseError)(i18n, error)));
|
|
241
|
+
fallOverWithStyle(error);
|
|
238
242
|
return;
|
|
239
243
|
}
|
|
240
244
|
await (0, _prosopo_procaptcha_common.providerRetry)(async () => {
|
|
@@ -250,7 +254,7 @@ var mountProcaptchaFrictionless = (container, props) => {
|
|
|
250
254
|
errorMessage: guard.message
|
|
251
255
|
};
|
|
252
256
|
events.onError(new Error(guard.message));
|
|
253
|
-
fallOverWithStyle(guard.
|
|
257
|
+
fallOverWithStyle(guard.error);
|
|
254
258
|
return;
|
|
255
259
|
}
|
|
256
260
|
nextRefreshOf = void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customDetectBot.d.ts","sourceRoot":"","sources":["../src/customDetectBot.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EACX,oBAAoB,EAGpB,MAAM,gBAAgB,CAAC;AA0FxB,eAAO,MAAM,WAAW,GAAU,CAAC,WACzB,OAAO,CAAC,CAAC,CAAC,MACf,MAAM,KACR,OAAO,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"customDetectBot.d.ts","sourceRoot":"","sources":["../src/customDetectBot.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EACX,oBAAoB,EAGpB,MAAM,gBAAgB,CAAC;AA0FxB,eAAO,MAAM,WAAW,GAAU,CAAC,WACzB,OAAO,CAAC,CAAC,CAAC,MACf,MAAM,KACR,OAAO,CAAC,CAAC,CA0BX,CAAC;AAEF,QAAA,MAAM,eAAe,EAAE,oBAkQtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
package/dist/customDetectBot.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DetectorLoaderFromScript } from "./detectorLoader.js";
|
|
2
2
|
import { takePrefetchedDetector } from "./detectorPrefetch.js";
|
|
3
|
+
import { ProsopoError } from "@prosopo/common";
|
|
3
4
|
import { widgetLanguageHeaders } from "@prosopo/locale";
|
|
4
5
|
import { ExtensionLoader, getProcaptchaRandomActiveProvider, pickIpMode, resolveClientSessionId } from "@prosopo/procaptcha-common";
|
|
5
6
|
import { ProviderApi } from "@prosopo/api";
|
|
6
|
-
import { ProsopoEnvError } from "@prosopo/common";
|
|
7
7
|
//#region src/customDetectBot.ts
|
|
8
8
|
var ASSIGN_TIMEOUT_MS = 1e4;
|
|
9
9
|
var sanitiseHref = (href) => {
|
|
@@ -53,7 +53,11 @@ var withTimeout = async (promise, ms) => {
|
|
|
53
53
|
let timeoutId;
|
|
54
54
|
const timeoutPromise = new Promise((_, reject) => {
|
|
55
55
|
timeoutId = setTimeout(() => {
|
|
56
|
-
reject(new
|
|
56
|
+
reject(new ProsopoError({
|
|
57
|
+
code: "UNEXPECTED",
|
|
58
|
+
errorSite: "FRIC-1",
|
|
59
|
+
message: "Unknown API error"
|
|
60
|
+
}));
|
|
57
61
|
}, ms);
|
|
58
62
|
});
|
|
59
63
|
try {
|
|
@@ -66,7 +70,10 @@ var withTimeout = async (promise, ms) => {
|
|
|
66
70
|
}
|
|
67
71
|
};
|
|
68
72
|
var customDetectBot = async (config, container, restartFn, retryContext, refreshOf, switchToImage) => {
|
|
69
|
-
if (!config.account.address) throw new
|
|
73
|
+
if (!config.account.address) throw new ProsopoError({
|
|
74
|
+
code: "SITE_KEY_MISSING",
|
|
75
|
+
errorSite: "FRIC-2"
|
|
76
|
+
});
|
|
70
77
|
const ipMode = pickIpMode(config);
|
|
71
78
|
const extClassPromise = ExtensionLoader(config.web2);
|
|
72
79
|
const prefetched = !retryContext || retryContext.attempt <= 1 ? takePrefetchedDetector(config.defaultEnvironment, ipMode, config.account.address) : void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customDetectBot.js","sourceRoot":"","sources":["../src/customDetectBot.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"customDetectBot.js","sourceRoot":"","sources":["../src/customDetectBot.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EACN,eAAe,EACf,iCAAiC,EACjC,UAAU,EACV,sBAAsB,GACtB,MAAM,4BAA4B,CAAC;AAOpC,OAAO,EACN,wBAAwB,GAGxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEN,sBAAsB,GACtB,MAAM,uBAAuB,CAAC;AAO/B,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAqBjC,MAAM,YAAY,GAAG,CAAC,IAAY,EAAsB,EAAE;IACzD,IAAI,CAAC;QACJ,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;QACxB,IAAI,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM;YAAE,OAAO,SAAS,CAAC;QACvD,OAAO,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,QAAQ,IAAI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AAiB,CAAC;IAChC,UAAU,UAAU;QACnB,QAAQ,EAAE,IAAI,CAAC;QACf,QAAQ,EAAE,IAAI,CAAC;QACf,QAAQ,EAAE,IAAI,CAAC;QACf,QAAQ,EAAE,IAAI,CAAC;KACf;CACD;AAED,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorSites.js","sourceRoot":"","sources":["../src/errorSites.ts"],"names":[],"mappings":""}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
+
import type { WidgetError } from "@prosopo/types";
|
|
1
2
|
export type FrictionlessGuardOutcome = {
|
|
2
3
|
kind: "pass";
|
|
3
4
|
} | {
|
|
4
5
|
kind: "error";
|
|
5
6
|
message: string;
|
|
6
|
-
|
|
7
|
+
error?: WidgetError;
|
|
7
8
|
retryable: boolean;
|
|
8
9
|
};
|
|
9
10
|
export type FrictionlessGuardInput = {
|
|
10
11
|
captchaType?: string;
|
|
11
|
-
error?:
|
|
12
|
-
message?: string;
|
|
13
|
-
key?: string;
|
|
14
|
-
};
|
|
12
|
+
error?: Partial<WidgetError>;
|
|
15
13
|
};
|
|
16
14
|
declare const MISSING_CAPTCHA_TYPE_MESSAGE = "Frictionless response missing captchaType; halting captcha mount";
|
|
17
15
|
export declare const evaluateFrictionlessResult: (result: FrictionlessGuardInput) => FrictionlessGuardOutcome;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frictionlessResultGuard.d.ts","sourceRoot":"","sources":["../src/frictionlessResultGuard.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"frictionlessResultGuard.d.ts","sourceRoot":"","sources":["../src/frictionlessResultGuard.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,MAAM,wBAAwB,GACjC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IACA,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CAClB,CAAC;AAuCL,MAAM,MAAM,sBAAsB,GAAG;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAC7B,CAAC;AAEF,QAAA,MAAM,4BAA4B,qEACiC,CAAC;AAoBpE,eAAO,MAAM,0BAA0B,WAC9B,sBAAsB,KAC5B,wBAwBF,CAAC;AAEF,OAAO,EAAE,4BAA4B,EAAE,CAAC"}
|