@prosopo/types-database 5.11.2 → 5.13.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.
Files changed (101) hide show
  1. package/.turbo/turbo-build$colon$cjs.log +3 -3
  2. package/.turbo/{turbo-build.log → turbo-build$colon$esm.log} +12 -13
  3. package/.turbo/turbo-build$colon$tsc.log +14 -14
  4. package/.turbo/turbo-build$colon$types.log +1 -0
  5. package/CHANGELOG.md +51 -0
  6. package/dist/cjs/types/client.cjs +32 -1
  7. package/dist/cjs/types/provider.cjs +60 -54
  8. package/dist/{types → esm/types}/client.js +32 -1
  9. package/dist/{types → esm/types}/provider.js +60 -54
  10. package/dist/{index.d.ts.map → tsc/index.d.ts.map} +1 -1
  11. package/dist/tsc/index.js +2 -0
  12. package/dist/tsc/index.js.map +1 -0
  13. package/dist/tsc/types/bannedDomain.d.ts.map +1 -0
  14. package/dist/tsc/types/bannedDomain.js +5 -0
  15. package/dist/tsc/types/bannedDomain.js.map +1 -0
  16. package/dist/tsc/types/captcha.d.ts.map +1 -0
  17. package/dist/tsc/types/captcha.js +24 -0
  18. package/dist/tsc/types/captcha.js.map +1 -0
  19. package/dist/{types → tsc/types}/client.d.ts +45 -0
  20. package/dist/tsc/types/client.d.ts.map +1 -0
  21. package/dist/tsc/types/client.js +330 -0
  22. package/dist/tsc/types/client.js.map +1 -0
  23. package/dist/tsc/types/index.d.ts +8 -0
  24. package/dist/tsc/types/index.d.ts.map +1 -0
  25. package/dist/tsc/types/index.js +8 -0
  26. package/dist/tsc/types/index.js.map +1 -0
  27. package/dist/tsc/types/mongo.d.ts.map +1 -0
  28. package/dist/tsc/types/mongo.js +2 -0
  29. package/dist/{types → tsc/types}/mongo.js.map +1 -1
  30. package/dist/{types → tsc/types}/provider.d.ts +596 -12
  31. package/dist/tsc/types/provider.d.ts.map +1 -0
  32. package/dist/tsc/types/provider.js +803 -0
  33. package/dist/tsc/types/provider.js.map +1 -0
  34. package/dist/tsc/types/schemas.test.d.ts.map +1 -0
  35. package/dist/{types → tsc/types}/schemas.test.js +63 -1
  36. package/dist/tsc/types/schemas.test.js.map +1 -0
  37. package/dist/tsc/types/spamEmailDomain.d.ts.map +1 -0
  38. package/dist/tsc/types/spamEmailDomain.js +5 -0
  39. package/dist/tsc/types/spamEmailDomain.js.map +1 -0
  40. package/dist/tsc/types/userAgent.d.ts.map +1 -0
  41. package/dist/tsc/types/userAgent.js +2 -0
  42. package/dist/{types → tsc/types}/userAgent.js.map +1 -1
  43. package/dist/{types.test-d.d.ts.map → tsc/types.test-d.d.ts.map} +1 -1
  44. package/dist/tsc/types.test-d.js.map +1 -0
  45. package/dist/types/index.d.ts +1 -7
  46. package/dist/types/index.d.ts.map +1 -1
  47. package/dist/types/types/bannedDomain.d.ts +38 -0
  48. package/dist/types/types/bannedDomain.d.ts.map +1 -0
  49. package/dist/types/types/captcha.d.ts +24 -0
  50. package/dist/types/types/captcha.d.ts.map +1 -0
  51. package/dist/types/types/client.d.ts +2112 -0
  52. package/dist/types/types/client.d.ts.map +1 -0
  53. package/dist/types/types/index.d.ts +8 -0
  54. package/dist/types/types/index.d.ts.map +1 -0
  55. package/dist/types/types/mongo.d.ts +13 -0
  56. package/dist/types/types/mongo.d.ts.map +1 -0
  57. package/dist/types/types/provider.d.ts +4662 -0
  58. package/dist/types/types/provider.d.ts.map +1 -0
  59. package/dist/types/types/schemas.test.d.ts +2 -0
  60. package/dist/types/types/schemas.test.d.ts.map +1 -0
  61. package/dist/types/types/spamEmailDomain.d.ts +38 -0
  62. package/dist/types/types/spamEmailDomain.d.ts.map +1 -0
  63. package/dist/types/types/userAgent.d.ts +31 -0
  64. package/dist/types/types/userAgent.d.ts.map +1 -0
  65. package/dist/types/types.test-d.d.ts +2 -0
  66. package/dist/types/types.test-d.d.ts.map +1 -0
  67. package/package.json +15 -16
  68. package/dist/index.js.map +0 -1
  69. package/dist/types/bannedDomain.d.ts.map +0 -1
  70. package/dist/types/bannedDomain.js.map +0 -1
  71. package/dist/types/captcha.d.ts.map +0 -1
  72. package/dist/types/captcha.js.map +0 -1
  73. package/dist/types/client.d.ts.map +0 -1
  74. package/dist/types/client.js.map +0 -1
  75. package/dist/types/index.js.map +0 -1
  76. package/dist/types/mongo.d.ts.map +0 -1
  77. package/dist/types/provider.d.ts.map +0 -1
  78. package/dist/types/provider.js.map +0 -1
  79. package/dist/types/schemas.test.d.ts.map +0 -1
  80. package/dist/types/schemas.test.js.map +0 -1
  81. package/dist/types/spamEmailDomain.d.ts.map +0 -1
  82. package/dist/types/spamEmailDomain.js.map +0 -1
  83. package/dist/types/userAgent.d.ts.map +0 -1
  84. package/dist/types.test-d.js.map +0 -1
  85. /package/dist/{_virtual → esm/_virtual}/_rolldown/runtime.js +0 -0
  86. /package/dist/{index.js → esm/index.js} +0 -0
  87. /package/dist/{types → esm/types}/bannedDomain.js +0 -0
  88. /package/dist/{types → esm/types}/captcha.js +0 -0
  89. /package/dist/{types → esm/types}/index.js +0 -0
  90. /package/dist/{types → esm/types}/mongo.js +0 -0
  91. /package/dist/{types → esm/types}/spamEmailDomain.js +0 -0
  92. /package/dist/{types → esm/types}/userAgent.js +0 -0
  93. /package/dist/{index.d.ts → tsc/index.d.ts} +0 -0
  94. /package/dist/{types → tsc/types}/bannedDomain.d.ts +0 -0
  95. /package/dist/{types → tsc/types}/captcha.d.ts +0 -0
  96. /package/dist/{types → tsc/types}/mongo.d.ts +0 -0
  97. /package/dist/{types → tsc/types}/schemas.test.d.ts +0 -0
  98. /package/dist/{types → tsc/types}/spamEmailDomain.d.ts +0 -0
  99. /package/dist/{types → tsc/types}/userAgent.d.ts +0 -0
  100. /package/dist/{types.test-d.d.ts → tsc/types.test-d.d.ts} +0 -0
  101. /package/dist/{types.test-d.js → tsc/types.test-d.js} +0 -0
@@ -42,7 +42,7 @@ dist/cjs/types/spamEmailDomain.cjs 0.25 kB │ gzip: 0.17 kB
42
42
  dist/cjs/types/captcha.cjs 1.49 kB │ gzip: 0.31 kB
43
43
  dist/cjs/types/index.cjs 2.92 kB │ gzip: 0.53 kB
44
44
  dist/cjs/index.cjs 3.03 kB │ gzip: 0.59 kB
45
- dist/cjs/types/client.cjs 10.08 kB │ gzip: 1.99 kB
46
- dist/cjs/types/provider.cjs 33.54 kB │ gzip: 5.32 kB
45
+ dist/cjs/types/client.cjs 10.68 kB │ gzip: 2.09 kB
46
+ dist/cjs/types/provider.cjs 33.74 kB │ gzip: 5.38 kB
47
47
 
48
- ✓ built in 54ms
48
+ ✓ built in 55ms
@@ -1,5 +1,4 @@
1
- $ pnpm run build:cross-env --mode ${NODE_ENV:-development}
2
- $ vite build --config vite.esm.config.ts --mode production
1
+ $ vite build --config vite.esm.config.ts --mode ${NODE_ENV:-development}
3
2
  ViteEsmConfig: .
4
3
  {
5
4
  tsConfigPaths: [
@@ -36,15 +35,15 @@ Bundle build started
36
35
  ✓ 10 modules transformed.
37
36
  rendering chunks...
38
37
  computing gzip size...
39
- dist/types/mongo.js 0.01 kB │ gzip: 0.03 kB
40
- dist/types/userAgent.js 0.01 kB │ gzip: 0.03 kB
41
- dist/_virtual/_rolldown/runtime.js 0.04 kB │ gzip: 0.06 kB
42
- dist/types/bannedDomain.js 0.22 kB │ gzip: 0.17 kB
43
- dist/types/spamEmailDomain.js 0.23 kB │ gzip: 0.17 kB
44
- dist/types/captcha.js 1.24 kB │ gzip: 0.30 kB
45
- dist/types/index.js 1.95 kB │ gzip: 0.42 kB
46
- dist/index.js 2.03 kB │ gzip: 0.45 kB
47
- dist/types/client.js 9.82 kB │ gzip: 2.04 kB
48
- dist/types/provider.js 32.17 kB │ gzip: 5.31 kB
38
+ dist/esm/types/mongo.js 0.01 kB │ gzip: 0.03 kB
39
+ dist/esm/types/userAgent.js 0.01 kB │ gzip: 0.03 kB
40
+ dist/esm/_virtual/_rolldown/runtime.js 0.04 kB │ gzip: 0.06 kB
41
+ dist/esm/types/bannedDomain.js 0.22 kB │ gzip: 0.17 kB
42
+ dist/esm/types/spamEmailDomain.js 0.23 kB │ gzip: 0.17 kB
43
+ dist/esm/types/captcha.js 1.24 kB │ gzip: 0.30 kB
44
+ dist/esm/types/index.js 1.95 kB │ gzip: 0.42 kB
45
+ dist/esm/index.js 2.03 kB │ gzip: 0.45 kB
46
+ dist/esm/types/client.js 10.42 kB │ gzip: 2.13 kB
47
+ dist/esm/types/provider.js 32.37 kB │ gzip: 5.35 kB
49
48
 
50
- ✓ built in 86ms
49
+ ✓ built in 69ms
@@ -1,5 +1,5 @@
1
1
  $ tsc --build --verbose
2
- 3:59:43 PM - Projects in this build:
2
+ 12:57:06 PM - Projects in this build:
3
3
  * ../../dev/config/tsconfig.json
4
4
  * ../util/tsconfig.json
5
5
  * ../locale/tsconfig.json
@@ -13,29 +13,29 @@ $ tsc --build --verbose
13
13
  * ../user-access-policy/tsconfig.json
14
14
  * tsconfig.json
15
15
 
16
- 3:59:43 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'
16
+ 12:57:06 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/vite/vite.esm.config.ts' is older than output '../../dev/config/dist/tsc/tsconfig.tsbuildinfo'
17
17
 
18
- 3:59:43 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
18
+ 12:57:06 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/dist/tsc/tsconfig.tsbuildinfo'
19
19
 
20
- 3:59:43 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/process.ts' is older than output '../locale/tsconfig.tsbuildinfo'
20
+ 12:57:06 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translator.ts' is older than output '../locale/dist/tsc/tsconfig.tsbuildinfo'
21
21
 
22
- 3:59:43 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'
22
+ 12:57:06 PM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/dist/tsc/tsconfig.tsbuildinfo'
23
23
 
24
- 3:59:43 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'
24
+ 12:57:06 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/types.test-d.ts' is older than output '../types/dist/tsc/tsconfig.tsbuildinfo'
25
25
 
26
- 3:59:43 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/tests/errorSites.unit.test.ts' is older than output '../common/tsconfig.tsbuildinfo'
26
+ 12:57:06 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/error.ts' is older than output '../common/dist/tsc/tsconfig.tsbuildinfo'
27
27
 
28
- 3:59:43 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'
28
+ 12:57:06 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/dist/tsc/tsconfig.tsbuildinfo'
29
29
 
30
- 3:59:43 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'
30
+ 12:57:06 PM - Project '../api-route/tsconfig.json' is up to date because newest input '../api-route/src/apiRoutes.ts' is older than output '../api-route/dist/tsc/tsconfig.tsbuildinfo'
31
31
 
32
- 3:59:43 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'
32
+ 12:57:06 PM - Project '../redis-client/tsconfig.json' is up to date because newest input '../redis-client/src/index.ts' is older than output '../redis-client/dist/tsc/tsconfig.tsbuildinfo'
33
33
 
34
- 3:59:43 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/tests/apiHarness.ts' is older than output '../api/tsconfig.tsbuildinfo'
34
+ 12:57:06 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/tests/apiHarness.ts' is older than output '../api/dist/tsc/tsconfig.tsbuildinfo'
35
35
 
36
- 3:59:43 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'
36
+ 12:57:06 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/dist/tsc/tsconfig.tsbuildinfo'
37
37
 
38
- 3:59:43 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
38
+ 12:57:06 PM - Project 'tsconfig.json' is out of date because output file 'dist/tsc/tsconfig.tsbuildinfo' does not exist
39
39
 
40
- 3:59:43 PM - Building project '/home/runner/work/captcha/captcha/packages/types-database/tsconfig.json'...
40
+ 12:57:06 PM - Building project '/home/runner/work/captcha/captcha/packages/types-database/tsconfig.json'...
41
41
 
@@ -0,0 +1 @@
1
+ $ tsc --project tsconfig.types.json
package/CHANGELOG.md CHANGED
@@ -1,5 +1,56 @@
1
1
  # @prosopo/types-database
2
2
 
3
+ ## 5.13.0
4
+ ### Minor Changes
5
+
6
+ - 78107d9: Record the fingerprint summary, and with it the device bucket, for every captcha type rather than only PoW.
7
+
8
+ The proof of fingerprint was only built by the PoW widget and only read when a PoW solution was submitted, so sessions served a puzzle or an image never had a bucket. About half of puzzle drags could only be given one by finding a PoW the same account had solved.
9
+
10
+ The widget now sends the proof with the frictionless request, best-effort and capped at a second so it never delays the captcha. The provider verifies and summarises it once, stores the summary on the session, and the PoW, puzzle and image records copy it from there. Escalation sessions inherit it. A proof sent with a PoW solution still replaces the one from the frictionless request.
11
+
12
+ The summary is only recorded at the frictionless step, not passed to the routing machine there, so existing `deviceBucket` counter rules keep firing where they did before.
13
+
14
+ ### Patch Changes
15
+
16
+ - 1966fc1: Bump the npm-minor-and-patch group across 1 directory with 15 updates
17
+ - 77bd891: The provider accepts an `x-prosopo-integration` request header, which names the platform that embedded the widget (e.g. `mc4wp`). It is saved on the session with the other request headers and added to the provider's request logs as `integration`. The widget does not send it yet; this has to be deployed to providers first, because browsers block a header the provider does not allow.
18
+ - Updated dependencies [1966fc1]
19
+ - Updated dependencies [c69b636]
20
+ - Updated dependencies [78107d9]
21
+ - Updated dependencies [d6cc6fe]
22
+ - Updated dependencies [77bd891]
23
+ - Updated dependencies [76b6edd]
24
+ - @prosopo/common@3.3.2
25
+ - @prosopo/locale@3.13.2
26
+ - @prosopo/logger@2.1.7
27
+ - @prosopo/types@5.20.0
28
+ - @prosopo/user-access-policy@3.15.9
29
+
30
+ ## 5.12.0
31
+ ### Minor Changes
32
+
33
+ - 915f30b: Traffic filter categories can now have exceptions. An exception matches visitors by country, by whether their country is inside or outside the account's market, by a minimum abuser score, or any mix of these. It then replaces the category's block or challenge action. When several exceptions match, the harshest wins: a block beats any challenge, and a stricter captcha beats a milder one. So the order of the list does not matter. For example, block proxies, but challenge those from the account's market unless their abuser score is at least 0.5.
34
+
35
+ The account's market countries now travel to providers inside each site's traffic filter, including when a provider pulls updated sites from the portal database. An exception that depends on the market never matches while the account has no market set.
36
+
37
+ `@prosopo/captcha-severity` gains `policyHarshness` and `harshestPolicy`. They rank a policy that may block, and the access rules now use them too, with the same ordering as before.
38
+
39
+ ### Patch Changes
40
+
41
+ - 2086040: Each kind of build now writes to its own folder under dist: dist/esm (vite ESM), dist/cjs (vite CommonJS), dist/types (declarations), dist/tsc (plain tsc), dist/bundle and dist/bundle-webpack (bundles) and dist/native (the Rust addons). Turbo caches each folder separately, so building one variant no longer overwrites or invalidates another. Package exports point at the new folders; anything importing a file from dist by path has to add the variant folder.
42
+
43
+ The Rust addons are no longer committed. They are built into dist/native, in debug for development and tests and fully optimised when NODE_ENV=production, so building them now needs a Rust toolchain.
44
+
45
+ Code that found the repo root or its certificates by climbing a fixed number of folders up from its own file now starts from its package's folder instead (new `packageDir` in @prosopo/util/node). The fixed count stopped working once the build output moved one folder deeper.
46
+ - Updated dependencies [2086040]
47
+ - Updated dependencies [915f30b]
48
+ - @prosopo/common@3.3.1
49
+ - @prosopo/locale@3.13.1
50
+ - @prosopo/logger@2.1.6
51
+ - @prosopo/types@5.19.0
52
+ - @prosopo/user-access-policy@3.15.8
53
+
3
54
  ## 5.11.2
4
55
  ### Patch Changes
5
56
 
@@ -158,7 +158,7 @@ var AudioRenderSettingsSchema = new mongoose.Schema({
158
158
  }
159
159
  }, { _id: false });
160
160
  var SELECTABLE_CAPTCHA_TYPES = Object.values(_prosopo_types.CaptchaType).filter((captchaType) => captchaType !== _prosopo_types.CaptchaType.audio);
161
- var TrafficCategoryPolicySchema = new mongoose.Schema({
161
+ var TrafficCategoryActionSchema = new mongoose.Schema({
162
162
  action: {
163
163
  type: String,
164
164
  enum: _prosopo_types.TrafficFilterAction,
@@ -204,6 +204,28 @@ var TrafficCategoryPolicySchema = new mongoose.Schema({
204
204
  required: false
205
205
  }
206
206
  }, { _id: false });
207
+ var TrafficCategoryExceptionSchema = TrafficCategoryActionSchema.clone().add({
208
+ countries: {
209
+ type: [String],
210
+ default: void 0,
211
+ required: false
212
+ },
213
+ inMarket: {
214
+ type: Boolean,
215
+ required: false
216
+ },
217
+ minAbuserScore: {
218
+ type: Number,
219
+ min: 0,
220
+ max: 1,
221
+ required: false
222
+ }
223
+ });
224
+ var TrafficCategoryPolicySchema = TrafficCategoryActionSchema.clone().add({ exceptions: {
225
+ type: [TrafficCategoryExceptionSchema],
226
+ default: void 0,
227
+ required: false
228
+ } });
207
229
  var UserSettingsSchema = new mongoose.Schema({
208
230
  captchaType: {
209
231
  type: String,
@@ -413,6 +435,11 @@ var UserSettingsSchema = new mongoose.Schema({
413
435
  crawler: {
414
436
  type: TrafficCategoryPolicySchema,
415
437
  required: false
438
+ },
439
+ marketCountries: {
440
+ type: [String],
441
+ default: void 0,
442
+ required: false
416
443
  }
417
444
  },
418
445
  storeMetadata: {
@@ -469,6 +496,10 @@ var AccountSchema = new mongoose.Schema({
469
496
  signupEmail: String,
470
497
  tier: String,
471
498
  tierRequestQuota: Number,
499
+ marketCountries: {
500
+ type: [String],
501
+ default: void 0
502
+ },
472
503
  marketingPreferences: Boolean,
473
504
  users: [{
474
505
  email: String,
@@ -126,6 +126,60 @@ CaptchaRecordSchema.index({
126
126
  solved: 1,
127
127
  randomKey: 1
128
128
  });
129
+ var fingerprintSummaryField = {
130
+ type: new mongoose.Schema({
131
+ root: {
132
+ type: String,
133
+ required: true
134
+ },
135
+ groupHash: {
136
+ type: String,
137
+ required: true
138
+ },
139
+ bucketId: {
140
+ type: String,
141
+ required: false
142
+ },
143
+ colorDepth: {
144
+ type: Number,
145
+ required: false
146
+ },
147
+ hardwareConcurrency: {
148
+ type: Number,
149
+ required: false
150
+ },
151
+ disclosed: {
152
+ type: new mongoose.Schema({
153
+ timezone: {
154
+ type: String,
155
+ required: false
156
+ },
157
+ languages: {
158
+ type: String,
159
+ required: false
160
+ },
161
+ architecture: {
162
+ type: Number,
163
+ required: false
164
+ },
165
+ cookiesEnabled: {
166
+ type: Boolean,
167
+ required: false
168
+ },
169
+ sessionStorage: {
170
+ type: Boolean,
171
+ required: false
172
+ },
173
+ localStorage: {
174
+ type: Boolean,
175
+ required: false
176
+ }
177
+ }, { _id: false }),
178
+ required: false
179
+ }
180
+ }, { _id: false }),
181
+ required: false
182
+ };
129
183
  var PoWCaptchaRecordSchema = new mongoose.Schema({
130
184
  challenge: {
131
185
  type: String,
@@ -283,60 +337,7 @@ var PoWCaptchaRecordSchema = new mongoose.Schema({
283
337
  type: String,
284
338
  required: true
285
339
  },
286
- fingerprintSummary: {
287
- type: new mongoose.Schema({
288
- root: {
289
- type: String,
290
- required: true
291
- },
292
- groupHash: {
293
- type: String,
294
- required: true
295
- },
296
- bucketId: {
297
- type: String,
298
- required: false
299
- },
300
- colorDepth: {
301
- type: Number,
302
- required: false
303
- },
304
- hardwareConcurrency: {
305
- type: Number,
306
- required: false
307
- },
308
- disclosed: {
309
- type: new mongoose.Schema({
310
- timezone: {
311
- type: String,
312
- required: false
313
- },
314
- languages: {
315
- type: String,
316
- required: false
317
- },
318
- architecture: {
319
- type: Number,
320
- required: false
321
- },
322
- cookiesEnabled: {
323
- type: Boolean,
324
- required: false
325
- },
326
- sessionStorage: {
327
- type: Boolean,
328
- required: false
329
- },
330
- localStorage: {
331
- type: Boolean,
332
- required: false
333
- }
334
- }, { _id: false }),
335
- required: false
336
- }
337
- }, { _id: false }),
338
- required: false
339
- },
340
+ fingerprintSummary: fingerprintSummaryField,
340
341
  label: {
341
342
  type: String,
342
343
  enum: Object.values(_prosopo_types.CaptchaLabel),
@@ -400,6 +401,7 @@ PoWCaptchaRecordSchema.index({ blocked: 1 }, {
400
401
  * type shows up as an empty column rather than a compile error.
401
402
  */
402
403
  var interactiveCaptchaRecordFields = {
404
+ fingerprintSummary: fingerprintSummaryField,
403
405
  challenge: {
404
406
  type: String,
405
407
  required: true
@@ -765,6 +767,7 @@ indexInteractiveCaptchaRecord(PuzzleCaptchaRecordSchema);
765
767
  indexInteractiveCaptchaRecord(IconOrderCaptchaRecordSchema);
766
768
  indexInteractiveCaptchaRecord(AudioCaptchaRecordSchema);
767
769
  var UserCommitmentRecordSchema = new mongoose.Schema({
770
+ fingerprintSummary: fingerprintSummaryField,
768
771
  userAccount: {
769
772
  type: String,
770
773
  required: true
@@ -1153,6 +1156,7 @@ ScheduledTaskRecordSchema.index({
1153
1156
  status: 1
1154
1157
  });
1155
1158
  var SessionRecordSchema = new mongoose.Schema({
1159
+ fingerprintSummary: fingerprintSummaryField,
1156
1160
  sessionId: {
1157
1161
  type: String,
1158
1162
  required: true
@@ -1757,6 +1761,7 @@ var SESSION_PROJECTION = {
1757
1761
  currentUrl: 1,
1758
1762
  iframeUrl: 1,
1759
1763
  clientMetaData: 1,
1764
+ fingerprintSummary: 1,
1760
1765
  captchaType: 1,
1761
1766
  serverChecked: 1,
1762
1767
  synNs: 1,
@@ -1797,6 +1802,7 @@ var SESSION_PROJECTION = {
1797
1802
  "headers.prosopo-user": 1,
1798
1803
  "headers.prosopo-site-key": 1,
1799
1804
  "headers.prosopo-type": 1,
1805
+ "headers.x-prosopo-integration": 1,
1800
1806
  "headers.x-tls-version": 1
1801
1807
  };
1802
1808
  //#endregion
@@ -158,7 +158,7 @@ var AudioRenderSettingsSchema = new Schema({
158
158
  }
159
159
  }, { _id: false });
160
160
  var SELECTABLE_CAPTCHA_TYPES = Object.values(CaptchaType).filter((captchaType) => captchaType !== CaptchaType.audio);
161
- var TrafficCategoryPolicySchema = new Schema({
161
+ var TrafficCategoryActionSchema = new Schema({
162
162
  action: {
163
163
  type: String,
164
164
  enum: TrafficFilterAction,
@@ -204,6 +204,28 @@ var TrafficCategoryPolicySchema = new Schema({
204
204
  required: false
205
205
  }
206
206
  }, { _id: false });
207
+ var TrafficCategoryExceptionSchema = TrafficCategoryActionSchema.clone().add({
208
+ countries: {
209
+ type: [String],
210
+ default: void 0,
211
+ required: false
212
+ },
213
+ inMarket: {
214
+ type: Boolean,
215
+ required: false
216
+ },
217
+ minAbuserScore: {
218
+ type: Number,
219
+ min: 0,
220
+ max: 1,
221
+ required: false
222
+ }
223
+ });
224
+ var TrafficCategoryPolicySchema = TrafficCategoryActionSchema.clone().add({ exceptions: {
225
+ type: [TrafficCategoryExceptionSchema],
226
+ default: void 0,
227
+ required: false
228
+ } });
207
229
  var UserSettingsSchema = new Schema({
208
230
  captchaType: {
209
231
  type: String,
@@ -413,6 +435,11 @@ var UserSettingsSchema = new Schema({
413
435
  crawler: {
414
436
  type: TrafficCategoryPolicySchema,
415
437
  required: false
438
+ },
439
+ marketCountries: {
440
+ type: [String],
441
+ default: void 0,
442
+ required: false
416
443
  }
417
444
  },
418
445
  storeMetadata: {
@@ -469,6 +496,10 @@ var AccountSchema = new Schema({
469
496
  signupEmail: String,
470
497
  tier: String,
471
498
  tierRequestQuota: Number,
499
+ marketCountries: {
500
+ type: [String],
501
+ default: void 0
502
+ },
472
503
  marketingPreferences: Boolean,
473
504
  users: [{
474
505
  email: String,
@@ -126,6 +126,60 @@ CaptchaRecordSchema.index({
126
126
  solved: 1,
127
127
  randomKey: 1
128
128
  });
129
+ var fingerprintSummaryField = {
130
+ type: new Schema({
131
+ root: {
132
+ type: String,
133
+ required: true
134
+ },
135
+ groupHash: {
136
+ type: String,
137
+ required: true
138
+ },
139
+ bucketId: {
140
+ type: String,
141
+ required: false
142
+ },
143
+ colorDepth: {
144
+ type: Number,
145
+ required: false
146
+ },
147
+ hardwareConcurrency: {
148
+ type: Number,
149
+ required: false
150
+ },
151
+ disclosed: {
152
+ type: new Schema({
153
+ timezone: {
154
+ type: String,
155
+ required: false
156
+ },
157
+ languages: {
158
+ type: String,
159
+ required: false
160
+ },
161
+ architecture: {
162
+ type: Number,
163
+ required: false
164
+ },
165
+ cookiesEnabled: {
166
+ type: Boolean,
167
+ required: false
168
+ },
169
+ sessionStorage: {
170
+ type: Boolean,
171
+ required: false
172
+ },
173
+ localStorage: {
174
+ type: Boolean,
175
+ required: false
176
+ }
177
+ }, { _id: false }),
178
+ required: false
179
+ }
180
+ }, { _id: false }),
181
+ required: false
182
+ };
129
183
  var PoWCaptchaRecordSchema = new Schema({
130
184
  challenge: {
131
185
  type: String,
@@ -283,60 +337,7 @@ var PoWCaptchaRecordSchema = new Schema({
283
337
  type: String,
284
338
  required: true
285
339
  },
286
- fingerprintSummary: {
287
- type: new Schema({
288
- root: {
289
- type: String,
290
- required: true
291
- },
292
- groupHash: {
293
- type: String,
294
- required: true
295
- },
296
- bucketId: {
297
- type: String,
298
- required: false
299
- },
300
- colorDepth: {
301
- type: Number,
302
- required: false
303
- },
304
- hardwareConcurrency: {
305
- type: Number,
306
- required: false
307
- },
308
- disclosed: {
309
- type: new Schema({
310
- timezone: {
311
- type: String,
312
- required: false
313
- },
314
- languages: {
315
- type: String,
316
- required: false
317
- },
318
- architecture: {
319
- type: Number,
320
- required: false
321
- },
322
- cookiesEnabled: {
323
- type: Boolean,
324
- required: false
325
- },
326
- sessionStorage: {
327
- type: Boolean,
328
- required: false
329
- },
330
- localStorage: {
331
- type: Boolean,
332
- required: false
333
- }
334
- }, { _id: false }),
335
- required: false
336
- }
337
- }, { _id: false }),
338
- required: false
339
- },
340
+ fingerprintSummary: fingerprintSummaryField,
340
341
  label: {
341
342
  type: String,
342
343
  enum: Object.values(CaptchaLabel),
@@ -400,6 +401,7 @@ PoWCaptchaRecordSchema.index({ blocked: 1 }, {
400
401
  * type shows up as an empty column rather than a compile error.
401
402
  */
402
403
  var interactiveCaptchaRecordFields = {
404
+ fingerprintSummary: fingerprintSummaryField,
403
405
  challenge: {
404
406
  type: String,
405
407
  required: true
@@ -765,6 +767,7 @@ indexInteractiveCaptchaRecord(PuzzleCaptchaRecordSchema);
765
767
  indexInteractiveCaptchaRecord(IconOrderCaptchaRecordSchema);
766
768
  indexInteractiveCaptchaRecord(AudioCaptchaRecordSchema);
767
769
  var UserCommitmentRecordSchema = new Schema({
770
+ fingerprintSummary: fingerprintSummaryField,
768
771
  userAccount: {
769
772
  type: String,
770
773
  required: true
@@ -1153,6 +1156,7 @@ ScheduledTaskRecordSchema.index({
1153
1156
  status: 1
1154
1157
  });
1155
1158
  var SessionRecordSchema = new Schema({
1159
+ fingerprintSummary: fingerprintSummaryField,
1156
1160
  sessionId: {
1157
1161
  type: String,
1158
1162
  required: true
@@ -1757,6 +1761,7 @@ var SESSION_PROJECTION = {
1757
1761
  currentUrl: 1,
1758
1762
  iframeUrl: 1,
1759
1763
  clientMetaData: 1,
1764
+ fingerprintSummary: 1,
1760
1765
  captchaType: 1,
1761
1766
  serverChecked: 1,
1762
1767
  synNs: 1,
@@ -1797,6 +1802,7 @@ var SESSION_PROJECTION = {
1797
1802
  "headers.prosopo-user": 1,
1798
1803
  "headers.prosopo-site-key": 1,
1799
1804
  "headers.prosopo-type": 1,
1805
+ "headers.x-prosopo-integration": 1,
1800
1806
  "headers.x-tls-version": 1
1801
1807
  };
1802
1808
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./types/index.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bannedDomain.d.ts","sourceRoot":"","sources":["../../../src/types/bannedDomain.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAGrC,MAAM,MAAM,YAAY,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,QAAQ,GAAG,YAAY,CAAC;AAElE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAKnC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Schema } from "mongoose";
2
+ export const BannedDomainRecordSchema = new Schema({
3
+ domain: { type: String, required: true, unique: true },
4
+ });
5
+ //# sourceMappingURL=bannedDomain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bannedDomain.js","sourceRoot":"","sources":["../../../src/types/bannedDomain.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAQlC,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,MAAM,CAAqB;IAItE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;CACtD,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"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B,EAAE,mBAAmB,EAAE,CAAC;QAC5C,mBAAmB,EAAE,kBAAkB,EAAE,CAAC;QAC1C,uBAAuB,EAAE,sBAAsB,EAAE,CAAC;KAClD,CAAC,CAAC;CACH;AAED,MAAM,WAAW,iBAChB,SAAQ,OAAO,CAAC,cAAc,GAAG,UAAU,CAAC;CAAG"}
@@ -0,0 +1,24 @@
1
+ import { Schema } from "mongoose";
2
+ import { AudioCaptchaRecordSchema, IconOrderCaptchaRecordSchema, PoWCaptchaRecordSchema, PuzzleCaptchaRecordSchema, SessionRecordSchema, UserCommitmentRecordSchema, } from "./provider.js";
3
+ export const StoredSessionRecordSchema = SessionRecordSchema;
4
+ export const StoredUserCommitmentRecordSchema = new Schema({
5
+ ...UserCommitmentRecordSchema.obj,
6
+ });
7
+ StoredUserCommitmentRecordSchema.index({ sessionId: 1 });
8
+ export const StoredPoWCaptchaRecordSchema = new Schema({
9
+ ...PoWCaptchaRecordSchema.obj,
10
+ });
11
+ StoredPoWCaptchaRecordSchema.index({ sessionId: 1 });
12
+ export const StoredPuzzleCaptchaRecordSchema = new Schema({
13
+ ...PuzzleCaptchaRecordSchema.obj,
14
+ });
15
+ StoredPuzzleCaptchaRecordSchema.index({ sessionId: 1 });
16
+ export const StoredAudioCaptchaRecordSchema = new Schema({
17
+ ...AudioCaptchaRecordSchema.obj,
18
+ });
19
+ StoredAudioCaptchaRecordSchema.index({ sessionId: 1 });
20
+ export const StoredIconOrderCaptchaRecordSchema = new Schema({
21
+ ...IconOrderCaptchaRecordSchema.obj,
22
+ });
23
+ StoredIconOrderCaptchaRecordSchema.index({ sessionId: 1 });
24
+ //# sourceMappingURL=captcha.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"captcha.js","sourceRoot":"","sources":["../../../src/types/captcha.ts"],"names":[],"mappings":"AAeA,OAAO,EAAoB,MAAM,EAAE,MAAM,UAAU,CAAC;AAEpD,OAAO,EAEN,wBAAwB,EAExB,4BAA4B,EAE5B,sBAAsB,EAEtB,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