@prosopo/procaptcha 2.10.57 → 2.10.59

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.
Files changed (41) hide show
  1. package/.turbo/turbo-build$colon$cjs.log +15 -14
  2. package/.turbo/turbo-build$colon$tsc.log +20 -20
  3. package/.turbo/turbo-build.log +17 -14
  4. package/CHANGELOG.md +48 -0
  5. package/dist/_virtual/_rolldown/runtime.js +3 -0
  6. package/dist/cjs/index.cjs +6 -8
  7. package/dist/cjs/modules/Manager.cjs +288 -384
  8. package/dist/cjs/modules/ProsopoCaptchaApi.cjs +41 -74
  9. package/dist/cjs/modules/collector.cjs +43 -73
  10. package/dist/cjs/modules/index.cjs +6 -8
  11. package/dist/index.js +3 -7
  12. package/dist/modules/Manager.d.ts.map +1 -1
  13. package/dist/modules/Manager.js +285 -382
  14. package/dist/modules/Manager.js.map +1 -1
  15. package/dist/modules/ProsopoCaptchaApi.d.ts.map +1 -1
  16. package/dist/modules/ProsopoCaptchaApi.js +40 -74
  17. package/dist/modules/ProsopoCaptchaApi.js.map +1 -1
  18. package/dist/modules/collector.js +44 -74
  19. package/dist/modules/index.js +2 -6
  20. package/dist/tests/collector.unit.test.d.ts +2 -0
  21. package/dist/tests/collector.unit.test.d.ts.map +1 -0
  22. package/dist/tests/collector.unit.test.js +173 -0
  23. package/dist/tests/collector.unit.test.js.map +1 -0
  24. package/dist/tests/manager.unit.test.d.ts +2 -0
  25. package/dist/tests/manager.unit.test.d.ts.map +1 -0
  26. package/dist/tests/manager.unit.test.js +788 -0
  27. package/dist/tests/manager.unit.test.js.map +1 -0
  28. package/dist/tests/managerHarness.d.ts +18 -0
  29. package/dist/tests/managerHarness.d.ts.map +1 -0
  30. package/dist/tests/managerHarness.js +94 -0
  31. package/dist/tests/managerHarness.js.map +1 -0
  32. package/dist/tests/procaptcha.test-d.d.ts +2 -0
  33. package/dist/tests/procaptcha.test-d.d.ts.map +1 -0
  34. package/dist/tests/procaptcha.test-d.js +78 -0
  35. package/dist/tests/procaptcha.test-d.js.map +1 -0
  36. package/dist/tests/prosopoCaptchaApi.unit.test.d.ts +2 -0
  37. package/dist/tests/prosopoCaptchaApi.unit.test.d.ts.map +1 -0
  38. package/dist/tests/prosopoCaptchaApi.unit.test.js +155 -0
  39. package/dist/tests/prosopoCaptchaApi.unit.test.js.map +1 -0
  40. package/package.json +17 -12
  41. package/vite.test.config.ts +25 -0
@@ -1,5 +1,5 @@
1
1
 
2
- > @prosopo/procaptcha@2.10.57 build:cjs
2
+ > @prosopo/procaptcha@2.10.59 build:cjs
3
3
  > NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
4
4
 
5
5
  ViteCommonJSConfig: .
@@ -13,8 +13,8 @@ ViteCommonJSConfig: .
13
13
  '/home/runner/work/captcha/captcha/packages/types/tsconfig.json',
14
14
  '/home/runner/work/captcha/captcha/packages/util-crypto/tsconfig.json',
15
15
  '/home/runner/work/captcha/captcha/packages/api/tsconfig.json',
16
- '/home/runner/work/captcha/captcha/packages/procaptcha-common/tsconfig.json',
17
16
  '/home/runner/work/captcha/captcha/packages/load-balancer/tsconfig.json',
17
+ '/home/runner/work/captcha/captcha/packages/procaptcha-common/tsconfig.json',
18
18
  '/home/runner/work/captcha/captcha/packages/widget-skeleton/tsconfig.json',
19
19
  '/home/runner/work/captcha/captcha/packages/account/tsconfig.json',
20
20
  '/home/runner/work/captcha/captcha/packages/fingerprint/tsconfig.json',
@@ -32,8 +32,8 @@ ViteCommonJSConfig: .
32
32
  '@prosopo/types',
33
33
  '@prosopo/util-crypto',
34
34
  '@prosopo/api',
35
- '@prosopo/procaptcha-common',
36
35
  '@prosopo/load-balancer',
36
+ '@prosopo/procaptcha-common',
37
37
  '@prosopo/widget-skeleton',
38
38
  '@prosopo/account',
39
39
  '@prosopo/fingerprint',
@@ -41,16 +41,17 @@ ViteCommonJSConfig: .
41
41
  '@prosopo/keyring'
42
42
  ]
43
43
  }
44
- vite v6.4.1 building SSR bundle for production...
44
+ The plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the resolve.tsconfigPaths option. You can remove the plugin and set resolve.tsconfigPaths: true in your Vite config instead.
45
+ vite v8.1.5 building ssr environment for production...
45
46
  Bundle build started
46
- transforming...
47
- Build end
48
- ✓ 5 modules transformed.
49
- Entry module "src/modules/ProsopoCaptchaApi.ts" is using named and default exports together. Consumers of your bundle will have to use `..default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
47
+ 
48
+ ✓ 6 modules transformed.
50
49
  rendering chunks...
51
- dist/cjs/modules/index.cjs  0.39 kB
52
- dist/cjs/index.cjs  0.44 kB
53
- dist/cjs/modules/collector.cjs  2.18 kB
54
- dist/cjs/modules/ProsopoCaptchaApi.cjs  2.48 kB
55
- dist/cjs/modules/Manager.cjs 14.14 kB
56
- ✓ built in 227ms
50
+ computing gzip size...
51
+ dist/cjs/modules/index.cjs 0.34 kB │ gzip: 0.13 kB
52
+ dist/cjs/index.cjs 0.44 kB │ gzip: 0.19 kB
53
+ dist/cjs/modules/collector.cjs 1.83 kB │ gzip: 0.59 kB
54
+ dist/cjs/modules/ProsopoCaptchaApi.cjs 2.17 kB │ gzip: 0.78 kB
55
+ dist/cjs/modules/Manager.cjs 13.39 kB │ gzip: 3.71 kB
56
+
57
+ ✓ built in 97ms
@@ -1,8 +1,8 @@
1
1
 
2
- > @prosopo/procaptcha@2.10.57 build:tsc
2
+ > @prosopo/procaptcha@2.10.59 build:tsc
3
3
  > tsc --build --verbose
4
4
 
5
- 10:22:55 PM - Projects in this build:
5
+ 12:36:38 PM - Projects in this build:
6
6
  * ../../dev/config/tsconfig.json
7
7
  * ../locale/tsconfig.json
8
8
  * ../util/tsconfig.json
@@ -21,39 +21,39 @@
21
21
  * ../procaptcha-common/tsconfig.json
22
22
  * tsconfig.json
23
23
 
24
- 10:22:55 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'
24
+ 12:36:38 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/index.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
25
25
 
26
- 10:22:55 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
26
+ 12:36:38 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
27
27
 
28
- 10:22:56 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
28
+ 12:36:38 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
29
29
 
30
- 10:22:56 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/tsconfig.tsbuildinfo'
30
+ 12:36:38 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/tsconfig.tsbuildinfo'
31
31
 
32
- 10:22:56 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'
32
+ 12:36:38 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'
33
33
 
34
- 10:22:56 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/procaptcha/api.ts' is older than output '../types/tsconfig.tsbuildinfo'
34
+ 12:36:38 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/provider/api.ts' is older than output '../types/tsconfig.tsbuildinfo'
35
35
 
36
- 10:22:56 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/error.ts' is older than output '../common/tsconfig.tsbuildinfo'
36
+ 12:36:38 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/index.ts' is older than output '../common/tsconfig.tsbuildinfo'
37
37
 
38
- 10:22:56 PM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/tests/dataset.unit.test.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
38
+ 12:36:38 PM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/tests/dataset.unit.test.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
39
39
 
40
- 10:22:56 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
40
+ 12:36:38 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/tests/apiHarness.ts' is older than output '../api/tsconfig.tsbuildinfo'
41
41
 
42
- 10:22:56 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
+ 12:36:39 PM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/tests/providers.unit.test.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
43
43
 
44
- 10:22:56 PM - Project '../widget-skeleton/tsconfig.json' is up to date because newest input '../widget-skeleton/src/index.ts' is older than output '../widget-skeleton/tsconfig.tsbuildinfo'
44
+ 12:36:39 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'
45
45
 
46
- 10:22:56 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
+ 12:36:39 PM - Project '../fingerprintjs/tsconfig.json' is up to date because newest input '../fingerprintjs/src/utils/browser.ts' is older than output '../fingerprintjs/tsconfig.tsbuildinfo'
47
47
 
48
- 10:22:56 PM - Project '../fingerprint/tsconfig.json' is up to date because newest input '../fingerprint/src/index.ts' is older than output '../fingerprint/tsconfig.tsbuildinfo'
48
+ 12:36:39 PM - Project '../fingerprint/tsconfig.json' is up to date because newest input '../fingerprint/src/index.ts' is older than output '../fingerprint/tsconfig.tsbuildinfo'
49
49
 
50
- 10:22:56 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/index.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
50
+ 12:36:39 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/keyring/keyring.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
51
51
 
52
- 10:22:56 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
+ 12:36:39 PM - Project '../account/tsconfig.json' is up to date because newest input '../account/src/custom.d.ts' is older than output '../account/tsconfig.tsbuildinfo'
53
53
 
54
- 10:22:56 PM - Project '../procaptcha-common/tsconfig.json' is up to date because newest input '../procaptcha-common/src/reactComponents/Honeypot.tsx' is older than output '../procaptcha-common/tsconfig.tsbuildinfo'
54
+ 12:36:39 PM - Project '../procaptcha-common/tsconfig.json' is up to date because newest input '../procaptcha-common/src/simdReadings.ts' is older than output '../procaptcha-common/tsconfig.tsbuildinfo'
55
55
 
56
- 10:22:56 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
56
+ 12:36:39 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
57
57
 
58
- 10:22:56 PM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha/tsconfig.json'...
58
+ 12:36:39 PM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha/tsconfig.json'...
59
59
 
@@ -1,9 +1,9 @@
1
1
 
2
- > @prosopo/procaptcha@2.10.57 build
2
+ > @prosopo/procaptcha@2.10.59 build
3
3
  > npm run build:cross-env -- --mode ${NODE_ENV:-development}
4
4
 
5
5
 
6
- > @prosopo/procaptcha@2.10.57 build:cross-env
6
+ > @prosopo/procaptcha@2.10.59 build:cross-env
7
7
  > vite build --config vite.esm.config.ts --mode production
8
8
 
9
9
  ViteEsmConfig: .
@@ -17,8 +17,8 @@ ViteEsmConfig: .
17
17
  '/home/runner/work/captcha/captcha/packages/types/tsconfig.json',
18
18
  '/home/runner/work/captcha/captcha/packages/util-crypto/tsconfig.json',
19
19
  '/home/runner/work/captcha/captcha/packages/api/tsconfig.json',
20
- '/home/runner/work/captcha/captcha/packages/procaptcha-common/tsconfig.json',
21
20
  '/home/runner/work/captcha/captcha/packages/load-balancer/tsconfig.json',
21
+ '/home/runner/work/captcha/captcha/packages/procaptcha-common/tsconfig.json',
22
22
  '/home/runner/work/captcha/captcha/packages/widget-skeleton/tsconfig.json',
23
23
  '/home/runner/work/captcha/captcha/packages/account/tsconfig.json',
24
24
  '/home/runner/work/captcha/captcha/packages/fingerprint/tsconfig.json',
@@ -36,8 +36,8 @@ ViteEsmConfig: .
36
36
  '@prosopo/types',
37
37
  '@prosopo/util-crypto',
38
38
  '@prosopo/api',
39
- '@prosopo/procaptcha-common',
40
39
  '@prosopo/load-balancer',
40
+ '@prosopo/procaptcha-common',
41
41
  '@prosopo/widget-skeleton',
42
42
  '@prosopo/account',
43
43
  '@prosopo/fingerprint',
@@ -45,15 +45,18 @@ ViteEsmConfig: .
45
45
  '@prosopo/keyring'
46
46
  ]
47
47
  }
48
- vite v6.4.1 building SSR bundle for production...
48
+ The plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the resolve.tsconfigPaths option. You can remove the plugin and set resolve.tsconfigPaths: true in your Vite config instead.
49
+ vite v8.1.5 building ssr environment for production...
49
50
  Bundle build started
50
- transforming...
51
- Build end
52
- ✓ 5 modules transformed.
51
+ 
52
+ ✓ 6 modules transformed.
53
53
  rendering chunks...
54
- dist/modules/index.js  0.21 kB
55
- dist/index.js  0.26 kB
56
- dist/modules/collector.js  2.08 kB
57
- dist/modules/ProsopoCaptchaApi.js  2.36 kB
58
- dist/modules/Manager.js 13.89 kB
59
- ✓ built in 219ms
54
+ computing gzip size...
55
+ dist/_virtual/_rolldown/runtime.js 0.04 kB │ gzip: 0.06 kB
56
+ dist/modules/index.js 0.20 kB │ gzip: 0.11 kB
57
+ dist/index.js 0.27 kB │ gzip: 0.14 kB
58
+ dist/modules/collector.js 1.81 kB │ gzip: 0.59 kB
59
+ dist/modules/ProsopoCaptchaApi.js 2.09 kB │ gzip: 0.78 kB
60
+ dist/modules/Manager.js 12.62 kB │ gzip: 3.65 kB
61
+
62
+ ✓ built in 66ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,53 @@
1
1
  # @prosopo/procaptcha
2
2
 
3
+ ## 2.10.59
4
+ ### Patch Changes
5
+
6
+ - cc022be: Add unit and type tests for the image captcha manager, the provider adapter and the behavioural collector (140 tests, 100% statement/branch/function/line coverage).
7
+
8
+ Two edge cases surfaced and fixed while covering `ProsopoCaptchaApi`/`Manager`:
9
+
10
+ - `submitCaptchaSolution` overflowed the stack on an empty solution set: `CaptchaMerkleTree` recurses on an empty layer, so the existing `!tree.root` guard never ran. Empty solution sets are now rejected up front.
11
+ - `loadProviderApi` proved the site key was set but its callers still fell back to `""` when constructing `ProsopoCaptchaApi`, so a missing site key could have been forwarded as an empty dapp account. It now returns the validated site key alongside the client.
12
+
13
+ No behavioural changes to the captcha flow itself.
14
+ - Updated dependencies [1e0cf14]
15
+ - @prosopo/api@3.5.21
16
+
17
+ ## 2.10.58
18
+ ### Patch Changes
19
+
20
+ - ab3499c: feat(procaptcha): block on SIMD readings at solution submit
21
+
22
+ Solution submit is the last hop the client controls, so it's the last chance to
23
+ attach the catcher's WASM SIMD readings for a session. The image, PoW and puzzle
24
+ managers now wait for the benchmark there via a shared
25
+ `getSimdReadingsForSubmit` helper, capped at 5s, instead of attaching only
26
+ whatever the prefetch happened to have resolved.
27
+
28
+ The helper passes the budget down to the detector *and* races it locally — the
29
+ detector ships prebuilt, so a bundle that ignores `timeoutMs` (or a benchmark
30
+ wedged on a busy main thread) can't hang the submission. It never rejects: a
31
+ missing accessor, a rejection, a synchronous throw and a timeout all resolve to
32
+ `undefined` and the solution is submitted without readings, so a user is never
33
+ failed over telemetry.
34
+
35
+ The earlier frictionless POST and challenge GET hops are unchanged and remain
36
+ non-blocking.
37
+ - e14fce6: chore(deps): bump vite to 6.4.3 and mongoose to 8.24.1, and adjust types for the mongoose 8.24 Document/ObjectId changes
38
+ - Updated dependencies [2c47bb7]
39
+ - Updated dependencies [ab3499c]
40
+ - Updated dependencies [0e1171c]
41
+ - Updated dependencies [103318c]
42
+ - Updated dependencies [270a8d8]
43
+ - Updated dependencies [e14fce6]
44
+ - @prosopo/util@3.3.5
45
+ - @prosopo/procaptcha-common@2.11.18
46
+ - @prosopo/types@4.10.0
47
+ - @prosopo/api@3.5.20
48
+ - @prosopo/common@3.1.48
49
+ - @prosopo/datasets@3.1.55
50
+
3
51
  ## 2.10.57
4
52
  ### Patch Changes
5
53
 
@@ -0,0 +1,3 @@
1
+ import "node:module";
2
+ //#endregion
3
+ export {};
@@ -1,9 +1,7 @@
1
- "use strict";
2
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- require("./modules/index.cjs");
4
- const Manager = require("./modules/Manager.cjs");
5
- const ProsopoCaptchaApi = require("./modules/ProsopoCaptchaApi.cjs");
6
- const collector = require("./modules/collector.cjs");
7
- exports.Manager = Manager.Manager;
8
- exports.ProsopoCaptchaApi = ProsopoCaptchaApi.ProsopoCaptchaApi;
9
- exports.startCollector = collector.startCollector;
2
+ const require_ProsopoCaptchaApi = require("./modules/ProsopoCaptchaApi.cjs");
3
+ const require_Manager = require("./modules/Manager.cjs");
4
+ const require_collector = require("./modules/collector.cjs");
5
+ exports.Manager = require_Manager.Manager;
6
+ exports.ProsopoCaptchaApi = require_ProsopoCaptchaApi.ProsopoCaptchaApi;
7
+ exports.startCollector = require_collector.startCollector;