@prosopo/provider 5.10.2 → 5.10.3

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 (54) hide show
  1. package/.turbo/turbo-build$colon$cjs.log +8 -8
  2. package/.turbo/turbo-build$colon$tsc.log +27 -27
  3. package/.turbo/turbo-build.log +9 -9
  4. package/CHANGELOG.md +46 -0
  5. package/dist/cjs/tasks/captchaManager.cjs +2 -1
  6. package/dist/cjs/tasks/decisionMachine/decisionMachineRunner.cjs +20 -17
  7. package/dist/cjs/tasks/detection/bundlePool.cjs +7 -4
  8. package/dist/cjs/tasks/detection/decodePayload.cjs +1139 -1120
  9. package/dist/cjs/tasks/detection/decodePayload.js +1 -1
  10. package/dist/cjs/tasks/detection/getBotScore.cjs +2 -2
  11. package/dist/cjs/tasks/frictionless/frictionlessTasks.cjs +3 -2
  12. package/dist/tasks/captchaManager.d.ts +1 -0
  13. package/dist/tasks/captchaManager.d.ts.map +1 -1
  14. package/dist/tasks/captchaManager.js +2 -1
  15. package/dist/tasks/captchaManager.js.map +1 -1
  16. package/dist/tasks/decisionMachine/decisionMachineRunner.d.ts +2 -0
  17. package/dist/tasks/decisionMachine/decisionMachineRunner.d.ts.map +1 -1
  18. package/dist/tasks/decisionMachine/decisionMachineRunner.js +20 -17
  19. package/dist/tasks/decisionMachine/decisionMachineRunner.js.map +1 -1
  20. package/dist/tasks/detection/bundlePool.d.ts +1 -0
  21. package/dist/tasks/detection/bundlePool.d.ts.map +1 -1
  22. package/dist/tasks/detection/bundlePool.js +7 -4
  23. package/dist/tasks/detection/bundlePool.js.map +1 -1
  24. package/dist/tasks/detection/bundlePool.test.js +36 -0
  25. package/dist/tasks/detection/bundlePool.test.js.map +1 -1
  26. package/dist/tasks/detection/decodePayload.d.ts +2 -2
  27. package/dist/tasks/detection/decodePayload.d.ts.map +1 -1
  28. package/dist/tasks/detection/decodePayload.js +1 -1
  29. package/dist/tasks/detection/decodePayload.js.map +1 -1
  30. package/dist/tasks/detection/getBotScore.d.ts +1 -1
  31. package/dist/tasks/detection/getBotScore.d.ts.map +1 -1
  32. package/dist/tasks/detection/getBotScore.js +3 -3
  33. package/dist/tasks/detection/getBotScore.js.map +1 -1
  34. package/dist/tasks/frictionless/frictionlessTasks.d.ts +1 -0
  35. package/dist/tasks/frictionless/frictionlessTasks.d.ts.map +1 -1
  36. package/dist/tasks/frictionless/frictionlessTasks.js +3 -2
  37. package/dist/tasks/frictionless/frictionlessTasks.js.map +1 -1
  38. package/dist/tests/integration/decisionMachines.integration.test.js +65 -1
  39. package/dist/tests/integration/decisionMachines.integration.test.js.map +1 -1
  40. package/dist/tests/unit/schedulers/captchaScheduler.unit.test.js +5 -3
  41. package/dist/tests/unit/schedulers/captchaScheduler.unit.test.js.map +1 -1
  42. package/dist/tests/unit/tasks/client/clientTasks.unit.test.js +10 -9
  43. package/dist/tests/unit/tasks/client/clientTasks.unit.test.js.map +1 -1
  44. package/dist/tests/unit/tasks/dataset/datasetTasks.unit.test.js +9 -3
  45. package/dist/tests/unit/tasks/dataset/datasetTasks.unit.test.js.map +1 -1
  46. package/dist/tests/unit/tasks/dataset/datasetTasksUtils.unit.test.js +11 -6
  47. package/dist/tests/unit/tasks/dataset/datasetTasksUtils.unit.test.js.map +1 -1
  48. package/dist/tests/unit/tasks/decisionMachine/decisionMachineRunner.unit.test.js +38 -0
  49. package/dist/tests/unit/tasks/decisionMachine/decisionMachineRunner.unit.test.js.map +1 -1
  50. package/dist/tests/unit/tasks/detection/getBotScore.unit.test.js +3 -3
  51. package/dist/tests/unit/tasks/detection/getBotScore.unit.test.js.map +1 -1
  52. package/dist/tests/unit/tasks/powCaptcha/powTasks.unit.test.js +78 -84
  53. package/dist/tests/unit/tasks/powCaptcha/powTasks.unit.test.js.map +1 -1
  54. package/package.json +28 -28
@@ -1,5 +1,5 @@
1
1
 
2
- > @prosopo/provider@5.10.2 build:cjs
2
+ > @prosopo/provider@5.10.3 build:cjs
3
3
  > NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
4
4
 
5
5
  ViteCommonJSConfig: .
@@ -123,11 +123,11 @@ dist/cjs/tasks/puzzle/stratifiedSampler.cjs 2
123
123
  dist/cjs/tasks/frictionless/frictionlessTasksUtils.cjs 2.21 kB │ gzip: 1.10 kB
124
124
  dist/cjs/tasks/captchaTypeSelection.cjs 2.44 kB │ gzip: 1.04 kB
125
125
  dist/cjs/api/admin/apiDnsEventEndpoint.cjs 2.59 kB │ gzip: 1.00 kB
126
- dist/cjs/tasks/detection/getBotScore.cjs 2.63 kB │ gzip: 0.96 kB
127
126
  dist/cjs/utils/dns.cjs 2.66 kB │ gzip: 1.02 kB
128
127
  dist/cjs/api/forwardVerify.cjs 2.66 kB │ gzip: 1.12 kB
129
128
  dist/cjs/tasks/puzzle/puzzleDifficulty.cjs 2.66 kB │ gzip: 1.10 kB
130
129
  dist/cjs/api/public.cjs 2.67 kB │ gzip: 1.05 kB
130
+ dist/cjs/tasks/detection/getBotScore.cjs 2.67 kB │ gzip: 0.97 kB
131
131
  dist/cjs/api/captcha/checkSpamEmail.cjs 2.73 kB │ gzip: 0.95 kB
132
132
  dist/cjs/api/captcha/submitPuzzleCaptchaSolution.cjs 2.77 kB │ gzip: 0.99 kB
133
133
  dist/cjs/api/captcha/assignDetectorBundle.cjs 2.90 kB │ gzip: 1.15 kB
@@ -155,26 +155,26 @@ dist/cjs/api/captcha/getImageCaptchaChallenge.cjs 7
155
155
  dist/cjs/tasks/spam/checkTrafficFilter.cjs 7.47 kB │ gzip: 2.48 kB
156
156
  dist/cjs/api/captcha/getPuzzleCaptchaChallenge.cjs 7.56 kB │ gzip: 2.03 kB
157
157
  dist/cjs/api/metrics.cjs 7.96 kB │ gzip: 2.23 kB
158
- dist/cjs/tasks/detection/bundlePool.cjs 8.89 kB │ gzip: 3.29 kB
158
+ dist/cjs/tasks/detection/bundlePool.cjs 9.12 kB │ gzip: 3.34 kB
159
159
  dist/cjs/api/captcha/submitPoWCaptchaSolution.cjs 9.54 kB │ gzip: 2.81 kB
160
160
  dist/cjs/api/captcha/getFrictionlessCaptchaChallenge/decisionMachine.cjs 10.33 kB │ gzip: 1.82 kB
161
161
  dist/cjs/api/startProviderApi.cjs 11.62 kB │ gzip: 3.70 kB
162
162
  dist/cjs/tasks/client/clientTasks.cjs 11.73 kB │ gzip: 3.04 kB
163
- dist/cjs/tasks/decisionMachine/decisionMachineRunner.cjs 12.32 kB │ gzip: 3.81 kB
163
+ dist/cjs/tasks/decisionMachine/decisionMachineRunner.cjs 12.57 kB │ gzip: 3.87 kB
164
164
  dist/cjs/api/blacklistRequestInspector.cjs 13.10 kB │ gzip: 4.41 kB
165
165
  dist/cjs/util.cjs 13.15 kB │ gzip: 3.26 kB
166
166
  dist/cjs/api/verify.cjs 16.79 kB │ gzip: 2.93 kB
167
167
  dist/cjs/api/captcha/getFrictionlessCaptchaChallenge/handler.cjs 20.65 kB │ gzip: 4.74 kB
168
- dist/cjs/tasks/frictionless/frictionlessTasks.cjs 20.69 kB │ gzip: 5.49 kB
169
- dist/cjs/tasks/captchaManager.cjs 23.52 kB │ gzip: 6.78 kB
168
+ dist/cjs/tasks/frictionless/frictionlessTasks.cjs 20.75 kB │ gzip: 5.51 kB
169
+ dist/cjs/tasks/captchaManager.cjs 23.59 kB │ gzip: 6.81 kB
170
170
  dist/cjs/tasks/puzzleCaptcha/puzzleTasks.cjs 24.03 kB │ gzip: 5.15 kB
171
171
  dist/cjs/tasks/powCaptcha/powTasks.cjs 24.84 kB │ gzip: 5.97 kB
172
172
  dist/cjs/tasks/imgCaptcha/imgCaptchaTasks.cjs 27.96 kB │ gzip: 6.37 kB
173
173
  dist/cjs/tasks/detection/decodeBehavior.cjs 32.24 kB │ gzip: 10.32 kB
174
174
  dist/cjs/tasks/detection/decodeSimd.cjs 36.03 kB │ gzip: 11.96 kB
175
- dist/cjs/tasks/detection/decodePayload.cjs 53.96 kB │ gzip: 18.08 kB
175
+ dist/cjs/tasks/detection/decodePayload.cjs 54.63 kB │ gzip: 19.30 kB
176
176
 
177
- ✓ built in 173ms
177
+ ✓ built in 180ms
178
178
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/provider/src/tasks/detection/decodeBehavior.js to /home/runner/work/captcha/captcha/packages/provider/dist/cjs/tasks/detection/decodeBehavior.js
179
179
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/provider/src/tasks/detection/decodePayload.js to /home/runner/work/captcha/captcha/packages/provider/dist/cjs/tasks/detection/decodePayload.js
180
180
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/provider/src/tasks/detection/decodeSimd.js to /home/runner/work/captcha/captcha/packages/provider/dist/cjs/tasks/detection/decodeSimd.js
@@ -1,8 +1,8 @@
1
1
 
2
- > @prosopo/provider@5.10.2 build:tsc
2
+ > @prosopo/provider@5.10.3 build:tsc
3
3
  > tsc --build --verbose
4
4
 
5
- 5:39:46 AM - Projects in this build:
5
+ 1:05:09 PM - Projects in this build:
6
6
  * ../../dev/config/tsconfig.json
7
7
  * ../util/tsconfig.json
8
8
  * ../logger/tsconfig.json
@@ -28,53 +28,53 @@
28
28
  * ../web-bot-auth/tsconfig.json
29
29
  * tsconfig.json
30
30
 
31
- 5:39:46 AM - 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'
31
+ 1:05:09 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'
32
32
 
33
- 5:39:46 AM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
33
+ 1:05:09 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
34
34
 
35
- 5:39:46 AM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/tsconfig.tsbuildinfo'
35
+ 1:05:09 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/logger.ts' is older than output '../logger/tsconfig.tsbuildinfo'
36
36
 
37
- 5:39:46 AM - Project '../api-route/tsconfig.json' is up to date because newest input '../api-route/src/apiRoutes.ts' is older than output '../api-route/tsconfig.tsbuildinfo'
37
+ 1:05:09 PM - Project '../api-route/tsconfig.json' is up to date because newest input '../api-route/src/tests/apiRoute.unit.test.ts' is older than output '../api-route/tsconfig.tsbuildinfo'
38
38
 
39
- 5:39:46 AM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
39
+ 1:05:09 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
40
40
 
41
- 5:39:46 AM - 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'
41
+ 1:05:09 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'
42
42
 
43
- 5:39:46 AM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/types.test-d.ts' is older than output '../types/tsconfig.tsbuildinfo'
43
+ 1:05:09 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'
44
44
 
45
- 5:39:46 AM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/index.ts' is older than output '../common/tsconfig.tsbuildinfo'
45
+ 1:05:09 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/tests/utils/batches.unit.test.ts' is older than output '../common/tsconfig.tsbuildinfo'
46
46
 
47
- 5:39:46 AM - Project '../ipinfo/tsconfig.json' is up to date because newest input '../ipinfo/src/types.ts' is older than output '../ipinfo/tsconfig.tsbuildinfo'
47
+ 1:05:09 PM - Project '../ipinfo/tsconfig.json' is up to date because newest input '../ipinfo/src/IpInfoService.ts' is older than output '../ipinfo/tsconfig.tsbuildinfo'
48
48
 
49
- 5:39:46 AM - Project '../redis-client/tsconfig.json' is up to date because newest input '../redis-client/src/index.ts' is older than output '../redis-client/tsconfig.tsbuildinfo'
49
+ 1:05:09 PM - Project '../redis-client/tsconfig.json' is up to date because newest input '../redis-client/src/index.ts' is older than output '../redis-client/tsconfig.tsbuildinfo'
50
50
 
51
- 5:39:46 AM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
51
+ 1:05:09 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/tests/apiHarness.ts' is older than output '../api/tsconfig.tsbuildinfo'
52
52
 
53
- 5:39:47 AM - Project '../user-access-policy/tsconfig.json' is up to date because newest input '../user-access-policy/src/ruleRecord.ts' is older than output '../user-access-policy/tsconfig.tsbuildinfo'
53
+ 1:05:09 PM - Project '../user-access-policy/tsconfig.json' is up to date because newest input '../user-access-policy/src/transformRule.ts' is older than output '../user-access-policy/tsconfig.tsbuildinfo'
54
54
 
55
- 5:39:47 AM - Project '../types-database/tsconfig.json' is up to date because newest input '../types-database/src/index.ts' is older than output '../types-database/tsconfig.tsbuildinfo'
55
+ 1:05:09 PM - Project '../types-database/tsconfig.json' is up to date because newest input '../types-database/src/index.ts' is older than output '../types-database/tsconfig.tsbuildinfo'
56
56
 
57
- 5:39:47 AM - Project '../database/tsconfig.json' is up to date because newest input '../database/src/tests/mongoGlobalSetup.ts' is older than output '../database/tsconfig.tsbuildinfo'
57
+ 1:05:09 PM - Project '../database/tsconfig.json' is up to date because newest input '../database/src/tests/mongoGlobalSetup.ts' is older than output '../database/tsconfig.tsbuildinfo'
58
58
 
59
- 5:39:47 AM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/keyring/keyring.test.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
59
+ 1:05:09 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/pair/decode.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
60
60
 
61
- 5:39:47 AM - Project '../types-env/tsconfig.json' is up to date because newest input '../types-env/src/env.ts' is older than output '../types-env/tsconfig.tsbuildinfo'
61
+ 1:05:09 PM - Project '../types-env/tsconfig.json' is up to date because newest input '../types-env/src/tests/typesEnv.test-d.ts' is older than output '../types-env/tsconfig.tsbuildinfo'
62
62
 
63
- 5:39:47 AM - Project '../env/tsconfig.json' is up to date because newest input '../env/src/tests/env.maintenance.unit.test.ts' is older than output '../env/tsconfig.tsbuildinfo'
63
+ 1:05:09 PM - Project '../env/tsconfig.json' is up to date because newest input '../env/src/tests/env.maintenance.unit.test.ts' is older than output '../env/tsconfig.tsbuildinfo'
64
64
 
65
- 5:39:47 AM - Project '../api-express-router/tsconfig.json' is up to date because newest input '../api-express-router/src/errorHandler.ts' is older than output '../api-express-router/tsconfig.tsbuildinfo'
65
+ 1:05:09 PM - Project '../api-express-router/tsconfig.json' is up to date because newest input '../api-express-router/src/errorHandler.ts' is older than output '../api-express-router/tsconfig.tsbuildinfo'
66
66
 
67
- 5:39:47 AM - Project '../captcha-severity/tsconfig.json' is up to date because newest input '../captcha-severity/src/index.test.ts' is older than output '../captcha-severity/tsconfig.tsbuildinfo'
67
+ 1:05:09 PM - Project '../captcha-severity/tsconfig.json' is up to date because newest input '../captcha-severity/src/index.test.ts' is older than output '../captcha-severity/tsconfig.tsbuildinfo'
68
68
 
69
- 5:39:47 AM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/index.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
69
+ 1:05:09 PM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/tests/mocks/data/captchas.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
70
70
 
71
- 5:39:47 AM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/tests/productionProviderList.unit.test.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
71
+ 1:05:09 PM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/tests/productionProviderList.unit.test.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
72
72
 
73
- 5:39:47 AM - Project '../puzzle-assets/tsconfig.json' is up to date because newest input '../puzzle-assets/src/background.ts' is older than output '../puzzle-assets/tsconfig.tsbuildinfo'
73
+ 1:05:09 PM - Project '../puzzle-assets/tsconfig.json' is up to date because newest input '../puzzle-assets/src/background.ts' is older than output '../puzzle-assets/tsconfig.tsbuildinfo'
74
74
 
75
- 5:39:47 AM - Project '../web-bot-auth/tsconfig.json' is up to date because newest input '../web-bot-auth/src/base64.ts' is older than output '../web-bot-auth/tsconfig.tsbuildinfo'
75
+ 1:05:09 PM - Project '../web-bot-auth/tsconfig.json' is up to date because newest input '../web-bot-auth/src/base64.ts' is older than output '../web-bot-auth/tsconfig.tsbuildinfo'
76
76
 
77
- 5:39:47 AM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
77
+ 1:05:09 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
78
78
 
79
- 5:39:47 AM - Building project '/home/runner/work/captcha/captcha/packages/provider/tsconfig.json'...
79
+ 1:05:09 PM - Building project '/home/runner/work/captcha/captcha/packages/provider/tsconfig.json'...
80
80
 
@@ -1,9 +1,9 @@
1
1
 
2
- > @prosopo/provider@5.10.2 build
2
+ > @prosopo/provider@5.10.3 build
3
3
  > npm run build:cross-env -- --mode ${NODE_ENV:-development}
4
4
 
5
5
 
6
- > @prosopo/provider@5.10.2 build:cross-env
6
+ > @prosopo/provider@5.10.3 build:cross-env
7
7
  > vite build --config vite.esm.config.ts --mode production
8
8
 
9
9
  ViteEsmConfig: .
@@ -132,10 +132,10 @@ dist/utils/dns.js 2.36 k
132
132
  dist/api/admin/apiDnsEventEndpoint.js 2.43 kB │ gzip: 0.96 kB
133
133
  dist/api/captcha/checkSpamEmail.js 2.47 kB │ gzip: 0.91 kB
134
134
  dist/tasks/puzzle/puzzleDifficulty.js 2.50 kB │ gzip: 1.09 kB
135
- dist/tasks/detection/getBotScore.js 2.55 kB │ gzip: 0.95 kB
136
135
  dist/api/captcha/submitPuzzleCaptchaSolution.js 2.55 kB │ gzip: 0.96 kB
137
136
  dist/api/forwardVerify.js 2.59 kB │ gzip: 1.10 kB
138
137
  dist/api/captcha/submitImageCaptchaSolution.js 2.59 kB │ gzip: 1.00 kB
138
+ dist/tasks/detection/getBotScore.js 2.59 kB │ gzip: 0.95 kB
139
139
  dist/api/captcha/assignDetectorBundle.js 2.69 kB │ gzip: 1.11 kB
140
140
  dist/api/admin/apiAdminRoutesProvider.js 2.78 kB │ gzip: 0.55 kB
141
141
  dist/index.js 2.92 kB │ gzip: 0.80 kB
@@ -159,26 +159,26 @@ dist/api/captcha/getPuzzleCaptchaChallenge.js 6.84 k
159
159
  dist/api/healthzGeo.js 6.86 kB │ gzip: 2.68 kB
160
160
  dist/tasks/spam/checkTrafficFilter.js 7.16 kB │ gzip: 2.45 kB
161
161
  dist/api/metrics.js 7.36 kB │ gzip: 2.19 kB
162
- dist/tasks/detection/bundlePool.js 8.46 kB │ gzip: 3.25 kB
162
+ dist/tasks/detection/bundlePool.js 8.69 kB │ gzip: 3.30 kB
163
163
  dist/api/captcha/submitPoWCaptchaSolution.js 9.02 kB │ gzip: 2.76 kB
164
164
  dist/api/captcha/getFrictionlessCaptchaChallenge/decisionMachine.js 9.36 kB │ gzip: 1.80 kB
165
165
  dist/api/startProviderApi.js 9.93 kB │ gzip: 3.42 kB
166
166
  dist/tasks/client/clientTasks.js 11.27 kB │ gzip: 3.00 kB
167
- dist/tasks/decisionMachine/decisionMachineRunner.js 11.93 kB │ gzip: 3.75 kB
167
+ dist/tasks/decisionMachine/decisionMachineRunner.js 12.19 kB │ gzip: 3.81 kB
168
168
  dist/api/blacklistRequestInspector.js 12.46 kB │ gzip: 4.37 kB
169
169
  dist/util.js 12.47 kB │ gzip: 3.20 kB
170
170
  dist/api/verify.js 15.12 kB │ gzip: 2.82 kB
171
171
  dist/api/captcha/getFrictionlessCaptchaChallenge/handler.js 19.13 kB │ gzip: 4.63 kB
172
- dist/tasks/frictionless/frictionlessTasks.js 20.12 kB │ gzip: 5.46 kB
172
+ dist/tasks/frictionless/frictionlessTasks.js 20.18 kB │ gzip: 5.48 kB
173
173
  dist/tasks/puzzleCaptcha/puzzleTasks.js 22.62 kB │ gzip: 5.10 kB
174
- dist/tasks/captchaManager.js 23.01 kB │ gzip: 6.72 kB
174
+ dist/tasks/captchaManager.js 23.08 kB │ gzip: 6.74 kB
175
175
  dist/tasks/powCaptcha/powTasks.js 23.47 kB │ gzip: 5.93 kB
176
176
  dist/tasks/imgCaptcha/imgCaptchaTasks.js 26.44 kB │ gzip: 6.31 kB
177
177
  dist/tasks/detection/decodeBehavior.js 32.26 kB │ gzip: 10.34 kB
178
178
  dist/tasks/detection/decodeSimd.js 36.06 kB │ gzip: 12.00 kB
179
- dist/tasks/detection/decodePayload.js 53.87 kB │ gzip: 18.06 kB
179
+ dist/tasks/detection/decodePayload.js 54.54 kB │ gzip: 19.29 kB
180
180
 
181
- ✓ built in 170ms
181
+ ✓ built in 152ms
182
182
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/provider/src/tasks/detection/decodeBehavior.js to /home/runner/work/captcha/captcha/packages/provider/dist/tasks/detection/decodeBehavior.js
183
183
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/provider/src/tasks/detection/decodePayload.js to /home/runner/work/captcha/captcha/packages/provider/dist/tasks/detection/decodePayload.js
184
184
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/provider/src/tasks/detection/decodeSimd.js to /home/runner/work/captcha/captcha/packages/provider/dist/tasks/detection/decodeSimd.js
package/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # @prosopo/provider
2
2
 
3
+ ## 5.10.3
4
+ ### Patch Changes
5
+
6
+ - f4e4a83: chore(deps): roll up the open dependabot bumps (react 19.3, mongoose 9.10, @polkadot/util 14, redis 6, cron-parser 5, react-i18next 17 with i18next 26, @scure/base 2, cypress 16, rollup/babel plugin majors, vitest 4.1.11, angular 20.3.28, js-yaml)
7
+ - c386199: Carry each detector bundle's `payloadLayout` from its pool entry through to the decoder.
8
+
9
+ Pool bundles now ship an extra opaque per-bundle value alongside the private key and inner config, and the decoder needs it to read what that bundle's detector produced. The pool loader reads it from `{id}.json`, the persist and admin-push paths keep it, and the frictionless decrypt passes it to `decodePayload` along with the key.
10
+
11
+ Bundles without one — pools built before this — behave exactly as before, so a provider can be updated ahead of its pool.
12
+
13
+ Covered by pool tests that the value survives load, persist and reload, and by the existing decrypt tests.
14
+ - 4d45e3d: Stop `DecisionMachineRunner` retaining every instance, and re-roll the frictionless widget onto another provider on an unrecognised error.
15
+
16
+ `DecisionMachineRunner` enrolled itself in a module-level `Set` so an artifact upload could flush every runner's cache. That assumed runners were built once per process; they are built per request, and nothing pruned the set, so it grew for as long as the process lived and construction eventually began to fail. `WeakRef` did not bound it — the set held the wrapper, which outlives its referent. The registry is replaced by a generation counter: an invalidation bumps it, and a runner drops its cache when the value it carries no longer matches. Nothing holds a runner reference, so there is nothing to grow.
17
+
18
+ The widget compounded it. The HTTP client does not throw on a 400 with a JSON body, so a provider-side failure came back looking like a normal result, and the frictionless guard turned it into a terminal error — no fallback, no retry, no restart timer. One unhealthy provider stranded the user on its first response even when every other node was healthy. Errors whose key we do not recognise are now thrown, which hands them to the existing provider re-roll. Integration faults (site key, origin, captcha type) and policy denials still display as before: another provider returns the same answer, and for those the message is the point. Errors with no key at all are unchanged, since hard blocks arrive in that shape. A site's error callback now also fires once retries are exhausted, which it previously did not.
19
+ - Updated dependencies [f4e4a83]
20
+ - Updated dependencies [c386199]
21
+ - Updated dependencies [d710b7f]
22
+ - Updated dependencies [d4e9425]
23
+ - Updated dependencies [ae121df]
24
+ - Updated dependencies [0be8838]
25
+ - @prosopo/api-express-router@3.1.88
26
+ - @prosopo/captcha-severity@1.1.1
27
+ - @prosopo/common@3.1.56
28
+ - @prosopo/database@4.0.34
29
+ - @prosopo/datasets@3.1.83
30
+ - @prosopo/keyring@2.9.90
31
+ - @prosopo/locale@3.4.3
32
+ - @prosopo/native-ja4@0.0.6
33
+ - @prosopo/native-merkle@0.0.6
34
+ - @prosopo/redis-client@1.0.36
35
+ - @prosopo/types-database@5.5.4
36
+ - @prosopo/types@5.8.4
37
+ - @prosopo/user-access-policy@3.14.4
38
+ - @prosopo/util-crypto@13.5.32
39
+ - @prosopo/web-bot-auth@0.1.1
40
+ - @prosopo/util@3.3.10
41
+ - @prosopo/api@4.2.4
42
+ - @prosopo/api-route@2.6.59
43
+ - @prosopo/env@3.6.57
44
+ - @prosopo/ipinfo@0.4.3
45
+ - @prosopo/load-balancer@2.10.45
46
+ - @prosopo/logger@2.0.10
47
+ - @prosopo/types-env@2.11.3
48
+
3
49
  ## 5.10.2
4
50
  ### Patch Changes
5
51
 
@@ -345,7 +345,8 @@ var CaptchaManager = class CaptchaManager {
345
345
  const bundle = bundleId ? require_bundlePool.getDetectorBundlePool()?.get(bundleId) : void 0;
346
346
  return bundle ? {
347
347
  key: bundle.privateKey,
348
- innerConfig: bundle.innerConfig
348
+ innerConfig: bundle.innerConfig,
349
+ ...bundle.payloadLayout && { payloadLayout: bundle.payloadLayout }
349
350
  } : void 0;
350
351
  }
351
352
  /**
@@ -43,46 +43,49 @@ var ARTIFACT_CACHE_TTL_MS = Number.parseInt(process.env.DECISION_MACHINE_ARTIFAC
43
43
  var DEFAULT_DECISION = { decision: _prosopo_types.DecisionMachineDecision.Allow };
44
44
  var RequiredCountersSchema = zod.z.array(_prosopo_types.CounterSpecSchema);
45
45
  /**
46
- * WeakSet-style registry of every live runner. Populated in the constructor
47
- * and consulted by {@link invalidateAllDecisionMachineArtifactCaches} so an
48
- * artifact upload can flush every runner's in-memory artifact cache in one
49
- * call. Held as `WeakRef` so a runner that goes out of scope is garbage
50
- * collected — this map only ever grows in prod (runners are constructed
51
- * per task class at process start and live for the process's lifetime) so
52
- * a plain array would also work, but `WeakRef` is defensive.
46
+ * Bumped by {@link invalidateAllDecisionMachineArtifactCaches}. A runner
47
+ * caches the value it last saw and drops its artifact cache whenever the two
48
+ * diverge, which flushes every runner — including ones built after the
49
+ * invalidation — without holding a reference to any of them.
50
+ *
51
+ * This replaces a registry of live runners, which assumed runners were built
52
+ * once per process. They are built per request, so the registry grew without
53
+ * bound and construction eventually began to fail. `WeakRef` did not bound
54
+ * it: the set held the wrapper, which outlives its referent.
53
55
  */
54
- var liveRunners = /* @__PURE__ */ new Set();
56
+ var artifactCacheGeneration = 0;
55
57
  /**
56
58
  * Flush every runner's in-memory artifact cache. Companion to
57
59
  * {@link invalidateDecisionMachineScriptCache}. Call both after any
58
60
  * `upsertDecisionMachineArtifact` upload.
59
61
  */
60
62
  var invalidateAllDecisionMachineArtifactCaches = () => {
61
- for (const ref of liveRunners) {
62
- const runner = ref.deref();
63
- if (runner === void 0) {
64
- liveRunners.delete(ref);
65
- continue;
66
- }
67
- runner.invalidateArtifactCache();
68
- }
63
+ artifactCacheGeneration++;
69
64
  };
70
65
  var DecisionMachineRunner = class DecisionMachineRunner {
71
66
  constructor(db) {
72
67
  this.db = db;
73
68
  this.artifactCache = /* @__PURE__ */ new Map();
74
- liveRunners.add(new WeakRef(this));
69
+ this.seenArtifactCacheGeneration = artifactCacheGeneration;
75
70
  }
76
71
  /** Drop every entry in this runner's artifact cache. */
77
72
  invalidateArtifactCache() {
78
73
  this.artifactCache.clear();
79
74
  }
75
+ /** Drop the cache if an invalidation happened since it was last consulted. */
76
+ dropArtifactCacheIfStale() {
77
+ if (this.seenArtifactCacheGeneration !== artifactCacheGeneration) {
78
+ this.seenArtifactCacheGeneration = artifactCacheGeneration;
79
+ this.artifactCache.clear();
80
+ }
81
+ }
80
82
  /** Build a cache key for a given scope + kind + dappAccount tuple. */
81
83
  static cacheKey(scope, kind, dappAccount) {
82
84
  return `${scope}:${kind}:${dappAccount ?? ""}`;
83
85
  }
84
86
  /** Return a cached artifact if still fresh, or undefined. */
85
87
  getCachedArtifact(scope, kind, dappAccount) {
88
+ this.dropArtifactCacheIfStale();
86
89
  const entry = this.artifactCache.get(DecisionMachineRunner.cacheKey(scope, kind, dappAccount));
87
90
  if (!entry) return null;
88
91
  if (Date.now() - entry.cachedAt > ARTIFACT_CACHE_TTL_MS) {
@@ -7,8 +7,8 @@ let node_path = require("node:path");
7
7
  * Loads a pool of precomputed, obfuscated detector bundles from disk and caches
8
8
  * them in memory — the Node analogue of the Rust "bumblebee" `bundle_manager`.
9
9
  * Each bundle is a `{id}.js` (served to the browser) paired with a `{id}.json`
10
- * (`{ privateKey, innerConfig }`, kept server-side) produced by the catcher
11
- * `bundle:pool` build script.
10
+ * (`{ privateKey, innerConfig, payloadLayout }`, kept server-side) produced by
11
+ * the catcher `bundle:pool` build script.
12
12
  *
13
13
  * A bundle is assigned per detector session by {@link DetectorBundlePool.at},
14
14
  * served by id, and resolved again at decryption time so the provider uses the
@@ -67,11 +67,13 @@ var DetectorBundlePool = class {
67
67
  continue;
68
68
  }
69
69
  if (expectedRelease && !release) unstamped++;
70
+ const payloadLayout = typeof secrets.payloadLayout === "string" ? secrets.payloadLayout : void 0;
70
71
  next.set(bundleId, {
71
72
  js,
72
73
  privateKey: secrets.privateKey,
73
74
  innerConfig: secrets.innerConfig,
74
- ...release && { release }
75
+ ...release && { release },
76
+ ...payloadLayout && { payloadLayout }
75
77
  });
76
78
  } catch (error) {
77
79
  logger.warn?.("failed to load bundle pool entry", {
@@ -167,7 +169,8 @@ function persistDetectorBundlePool(bundles, dir = globalPoolDir) {
167
169
  (0, node_fs.writeFileSync)(jsonTmp, JSON.stringify({
168
170
  privateKey: bundle.privateKey,
169
171
  innerConfig: bundle.innerConfig,
170
- ...bundle.release && { release: bundle.release }
172
+ ...bundle.release && { release: bundle.release },
173
+ ...bundle.payloadLayout && { payloadLayout: bundle.payloadLayout }
171
174
  }), {
172
175
  encoding: "utf8",
173
176
  mode: 384