@prosopo/types-database 4.1.5 → 4.8.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 (42) hide show
  1. package/.turbo/turbo-build$colon$cjs.log +16 -12
  2. package/.turbo/turbo-build$colon$tsc.log +17 -14
  3. package/.turbo/turbo-build.log +17 -13
  4. package/CHANGELOG.md +506 -0
  5. package/dist/cjs/index.cjs +6 -7
  6. package/dist/cjs/types/bannedDomain.cjs +8 -0
  7. package/dist/cjs/types/client.cjs +77 -5
  8. package/dist/cjs/types/index.cjs +6 -7
  9. package/dist/cjs/types/provider.cjs +298 -88
  10. package/dist/cjs/types/spamEmailDomain.cjs +8 -0
  11. package/dist/index.d.ts +0 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +8 -9
  14. package/dist/types/bannedDomain.d.ts +15 -0
  15. package/dist/types/bannedDomain.d.ts.map +1 -0
  16. package/dist/types/bannedDomain.js +8 -0
  17. package/dist/types/bannedDomain.js.map +1 -0
  18. package/dist/types/captcha.d.ts +2 -2
  19. package/dist/types/captcha.d.ts.map +1 -1
  20. package/dist/types/captcha.js.map +1 -1
  21. package/dist/types/client.d.ts +111 -12
  22. package/dist/types/client.d.ts.map +1 -1
  23. package/dist/types/client.js +78 -6
  24. package/dist/types/client.js.map +1 -1
  25. package/dist/types/index.d.ts +2 -0
  26. package/dist/types/index.d.ts.map +1 -1
  27. package/dist/types/index.js +8 -9
  28. package/dist/types/index.js.map +1 -1
  29. package/dist/types/mongo.d.ts +1 -1
  30. package/dist/types/provider.d.ts +59 -463
  31. package/dist/types/provider.d.ts.map +1 -1
  32. package/dist/types/provider.js +300 -90
  33. package/dist/types/provider.js.map +1 -1
  34. package/dist/types/spamEmailDomain.d.ts +15 -0
  35. package/dist/types/spamEmailDomain.d.ts.map +1 -0
  36. package/dist/types/spamEmailDomain.js +8 -0
  37. package/dist/types/spamEmailDomain.js.map +1 -0
  38. package/package.json +9 -7
  39. package/dist/provider/pendingCaptchaRequest.d.ts +0 -14
  40. package/dist/provider/pendingCaptchaRequest.d.ts.map +0 -1
  41. package/dist/provider/pendingCaptchaRequest.js +0 -2
  42. package/dist/provider/pendingCaptchaRequest.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,511 @@
1
1
  # @prosopo/types-database
2
2
 
3
+ ## 4.8.0
4
+ ### Minor Changes
5
+
6
+ - 2392aaf: Integrate the prosopo/dns sidecar against the procaptcha provider.
7
+
8
+ - New admin endpoint `POST /v1/prosopo/provider/admin/dns/event` ingests batched DNS observation events from the sidecar (auth: admin sr25519 JWT) and merges resolver / peer IPs onto the matching Session record under a new `Session.dnsEvent` field.
9
+ - Frictionless response carries a per-session `dns_url` when the pronode has `DNS_EVENT_SUBZONE` + `DNS_EVENT_HMAC_SECRET` set. The HMAC path mirrors the sidecar's Rust implementation so both sides agree without shared per-request state.
10
+ - The frictionless bundle fires one no-cors GET to `dns_url` on detection completion (fire-and-forget; failures never affect the captcha flow).
11
+ - `dns_url` is included on the `reuse_session` short-circuit path too, not only the new-session path — otherwise repeat visits from the same user/IP/sitekey combination silently dropped the observation hop.
12
+ - Deploy compose entry for the sidecar plus a Caddy `layer4` SNI-passthrough block so the sidecar terminates TLS itself (no Cloudflare token needed). Caddy image must be rebuilt with the `caddy-l4` plugin.
13
+
14
+ ### Patch Changes
15
+
16
+ - a1d60db: Add optional internal ML labelling fields (label/labelReason/labelledBy/labelledAt) to captcha records.
17
+ - Updated dependencies [a1d60db]
18
+ - Updated dependencies [2392aaf]
19
+ - Updated dependencies [97cf7bd]
20
+ - Updated dependencies [6ca1125]
21
+ - Updated dependencies [32a591b]
22
+ - @prosopo/types@4.3.0
23
+ - @prosopo/logger@1.0.2
24
+ - @prosopo/common@3.1.38
25
+ - @prosopo/user-access-policy@3.7.11
26
+
27
+ ## 4.7.8
28
+ ### Patch Changes
29
+
30
+ - 6c26669: Add per-site honeypot trap. When enabled, the provider attaches an encoded question (morse or semaphore, base64-wrapped) in the `x-prosopo-meta` response header on frictionless responses. The widget renders the value into an off-screen hidden input with `name="email_confirm"`; bots that auto-fill text inputs populate it and the value rides back on the solution submit as `clientMetaData.hp`, which is persisted on the `StoredCaptcha` record. Falls back to a random phrase from `PROSOPO_HONEYPOT_PHRASE_BANK_PATH` when no custom question is configured.
31
+ - Updated dependencies [6c26669]
32
+ - Updated dependencies [f7f9ec5]
33
+ - @prosopo/types@4.2.1
34
+ - @prosopo/user-access-policy@3.7.10
35
+
36
+ ## 4.7.7
37
+ ### Patch Changes
38
+
39
+ - 0fd81af: Extract the logger into its own `@prosopo/logger` package, out of `@prosopo/common`. Consumers now import logger symbols from `@prosopo/logger`; `@prosopo/common` no longer re-exports them. Unused `@prosopo/common` dependencies pruned where the only usage was the logger.
40
+ - Updated dependencies [0fd81af]
41
+ - @prosopo/common@3.1.37
42
+ - @prosopo/logger@1.0.1
43
+ - @prosopo/user-access-policy@3.7.9
44
+
45
+ ## 4.7.6
46
+ ### Patch Changes
47
+
48
+ - cdbc5ed: fix(types-database): persist `autoBanScoreThreshold` on client settings
49
+
50
+ `autoBanScoreThreshold` was added to the zod `ClientSettingsSchema` and the
51
+ frictionless decision machine in #2592, but the Mongoose `UserSettingsSchema`
52
+ was never updated. Mongoose's strict mode silently dropped the field on every
53
+ `$set`, so neither the portal account collection nor the provider
54
+ `ClientRecord` collection ever persisted the value — meaning a system user
55
+ could set the threshold in the portal, the API would accept it, but the
56
+ provider would never actually enforce it.
57
+
58
+ Adds the field to the Mongoose schema (`Number`, `min: 0`, `required: false`,
59
+ no default) so the property is preserved on write.
60
+ - 4d9923e: test(provider): integration test asserting every IUserSettings field round-trips through Mongo
61
+
62
+ Registers a site key with a fully-populated `IUserSettings` (every field set, including the new `storeMetadata` and the existing nested `contextAware` / `ipValidationRules` / `spamFilter` / `trafficFilter` sub-documents), reads the record back from Mongo via the real Mongoose write/read path, and asserts each top-level and nested field survived. This is the regression test class that would have caught the `autoBanScoreThreshold` Mongoose-strict-mode drop on the original PR.
63
+
64
+ While adding the test it caught another field that was in zod `ClientSettingsSchema` but missing from the Mongoose `UserSettingsSchema`: `puzzleTolerance`. The fix is bundled here — adds `puzzleTolerance: { type: Number, required: false }` to `UserSettingsSchema` so it actually persists.
65
+ - 4d9923e: feat: optional `storeMetadata` site setting persists `/verify` metadata
66
+
67
+ Adds a per-site-key boolean `storeMetadata` (default `false`) to
68
+ `ClientSettingsSchema` / `UserSettingsSchema`. When enabled, the provider
69
+ writes the dapp-server-forwarded metadata that arrives on the image, PoW
70
+ and puzzle `/verify` endpoints onto the corresponding captcha record under
71
+ a new `metadata` sub-document (`{ email?: string }` today; more fields
72
+ will be added here as the verify payload grows).
73
+
74
+ `providedIp` stays top-level — existing data and indexes already use it,
75
+ and it predates this setting.
76
+
77
+ Off by default. Existing spam-email checks still inspect the submitted
78
+ email unconditionally — this setting only gates **storage** of metadata
79
+ so the submitted values can be sampled later to judge whether traffic is
80
+ mostly spam.
81
+ - Updated dependencies [20cae63]
82
+ - Updated dependencies [4d9923e]
83
+ - @prosopo/types@4.2.0
84
+ - @prosopo/user-access-policy@3.7.8
85
+
86
+ ## 4.7.5
87
+ ### Patch Changes
88
+
89
+ - d351362: fix: replace `$or + $expr` unstored-records sweep with a `pendingStage` sentinel
90
+
91
+ The `StoreCommitmentsExternal` background job fetches "records that still
92
+ need to be shipped to the central DB" via
93
+ `{ $or: [ { storedAtTimestamp: { $exists: false } }, { $expr: { $lt: [$storedAtTimestamp, $lastUpdatedTimestamp] } } ] }`.
94
+ `$expr` is unindexable (per-doc computation) and combined with `$or`
95
+ defeats the planner entirely — production was running this every sweep
96
+ as a `IXSCAN { _id: 1 }` collection scan, examining ~673K powcaptcha
97
+ docs, ~240K usercommitments docs, and ~60K sessions docs per pass. On
98
+ the worst-affected nodes this thrashed the WiredTiger cache (10h of
99
+ cumulative app-thread blocking on disk reads in 43h of uptime) and made
100
+ every other Mongo lookup (including the frictionless session dedup
101
+ queries) slow by eviction — manifesting as traffic-correlated provider
102
+ latency starting 2026-05-26.
103
+
104
+ Replace the query semantics with a `pendingStage: true` sentinel:
105
+
106
+ - New optional `pendingStage` field on `StoredCaptcha` and `Session`
107
+ (Zod + TS + Mongoose schemas).
108
+ - New tiny partial index per collection:
109
+ `{ pendingStage: 1 }` with `partialFilterExpression: { pendingStage: true }`.
110
+ Indexes only the rows that need staging — typically a tiny rolling set,
111
+ ~20 KB for a 700K-row collection with 100 pending rows in local tests.
112
+ - Write paths (`storeXxx`, `updateXxx`, `markXxxChecked`, approve /
113
+ disapprove, `checkAndRemoveSession`, `recordSessionSimdReadingsIfAbsent`,
114
+ `storePendingImageCommitment`) set `pendingStage: true` alongside the
115
+ existing `lastUpdatedTimestamp` bump.
116
+ - `markXxxStored` and the per-record streamer mark-stored callbacks
117
+ `$unset: { pendingStage: 1 }` alongside the `storedAtTimestamp` write,
118
+ guarded by `lastUpdatedTimestamp: { $lte: ts }` so an in-flight update
119
+ doesn't get its pending flag cleared by an older stage completion.
120
+ - `markXxxStored` bulk methods accept an `asOfTimestamp` argument; the
121
+ sweep passes the time it fetched the batch so the guard is correct
122
+ across the full ship-then-mark round trip.
123
+ - `getUnstoredXxx` queries become `{ pendingStage: true }` sorted by
124
+ `_id` — uses the new partial index, examines only pending docs.
125
+
126
+ Local verification on a 700,100-doc test collection: old query ~549 ms
127
+ examining 700,100 docs; new query 0 ms examining 100 docs. Index storage
128
+ ~20 KB.
129
+ - Updated dependencies [d351362]
130
+ - @prosopo/types@4.1.4
131
+ - @prosopo/user-access-policy@3.7.7
132
+
133
+ ## 4.7.4
134
+ ### Patch Changes
135
+
136
+ - 7e8cbb7: fix(types-database): replace broken partial indexes with regular non-sparse indexes for CHECK_IP_INFO / PARSE_USER_AGENT backfill queries
137
+
138
+ The original partial-index approach (#2587, then #2589) couldn't work in MongoDB:
139
+
140
+ - `partialFilterExpression` isn't allowed on `_id` indexes (caught by #2589).
141
+ - More fundamentally, `{ $exists: false }` is rewritten internally as `$not: { $exists: true }`, and `$not` isn't on the partial-filter operator allowlist either. So no key field could rescue the partial-index design.
142
+
143
+ Replace the six broken partial-index definitions on `PoWCaptchaRecordSchema`, `PuzzleCaptchaRecordSchema`, and `UserCommitmentRecordSchema` with regular non-sparse indexes on the fields themselves (`{ ipInfo: 1 }` and `{ parsedUserAgentInfo: 1 }`). Non-sparse indexes include entries for missing-field documents (stored as null), which the planner can use to satisfy `{ <field>: { $exists: false } }` via `IXSCAN`.
144
+
145
+ Note: both layers that swallowed the original `createIndex` failures (`CaptchaDatabase.ensureIndexes()` `.catch` warning, and Mongoose `autoIndex`'s un-listened `'index'` event) are still silent — worth a follow-up so the next bad schema change doesn't ship unnoticed.
146
+ - Updated dependencies [e2711ae]
147
+ - Updated dependencies [5786629]
148
+ - @prosopo/types@4.1.3
149
+ - @prosopo/locale@3.2.4
150
+ - @prosopo/user-access-policy@3.7.6
151
+ - @prosopo/common@3.1.36
152
+
153
+ ## 4.7.3
154
+ ### Patch Changes
155
+
156
+ - @prosopo/types@4.1.2
157
+ - @prosopo/user-access-policy@3.7.5
158
+
159
+ ## 4.7.2
160
+ ### Patch Changes
161
+
162
+ - Updated dependencies [53bfd45]
163
+ - Updated dependencies [91958da]
164
+ - @prosopo/locale@3.2.3
165
+ - @prosopo/types@4.1.1
166
+ - @prosopo/common@3.1.35
167
+ - @prosopo/user-access-policy@3.7.4
168
+
169
+ ## 4.7.1
170
+ ### Patch Changes
171
+
172
+ - Updated dependencies [6a741ce]
173
+ - @prosopo/types@4.1.0
174
+ - @prosopo/user-access-policy@3.7.3
175
+
176
+ ## 4.7.0
177
+ ### Minor Changes
178
+
179
+ - d865319: Add puzzle captcha (drag-to-target challenge) as a new captcha type:
180
+ provider endpoints, manager + widget package, types, demo pages, and
181
+ a `puzzleTolerance` site setting.
182
+
183
+ ### Patch Changes
184
+
185
+ - f9ea09d: Drop flat ipinfo fields (`vpn`, `countryCode`, `tor`, `proxy`, `datacenter`, `abuser`, `geolocation`) from captcha records — persist the full `IPInfoResponse` payload as `ipInfo` instead
186
+
187
+ The provider's `ipInfoMiddleware` already calls `ipInfoService.lookup()` on every captcha request and attaches the result to `req.ipInfo`. Persisting that whole payload on every captcha record means the portal sees the *exact* response the traffic filter consulted, with no cherry-picked-field translation layer in between. Adding a new flag in the future (e.g. `isMobile`) requires zero schema changes — it's already in the payload.
188
+
189
+ - `StoredCaptcha` interface: removed `vpn`, `countryCode`, `geolocation`. Keeps `ipInfo?: IPInfoResponse`.
190
+ - `PoWCaptchaStoredSchema` zod validator: same removals, adds `ipInfo` (validated as `any()` since `IPInfoResponse` is a discriminated union narrowed at read time).
191
+ - PoW, Puzzle, UserCommitment mongoose schemas in `@prosopo/types-database`: same removals. UserCommitment now also has `ipInfo` (previously only PoW + Puzzle did). Replaced `{ countryCode: 1 }` index with `{ "ipInfo.countryCode": 1 }` + `{ "ipInfo.isVPN": 1 }`.
192
+ - `IProviderDatabase` interface: `storePowCaptchaRecord` / `storePuzzleCaptchaRecord` / `storePendingImageCommitment` now take `ipInfo?: IPInfoResponse` in place of `countryCode?: string`.
193
+ - Provider call sites (`getPoWCaptchaChallenge.ts`, `getPuzzleCaptchaChallenge.ts`, `getImageCaptchaChallenge.ts`, `submitImageCaptchaSolution.ts`) pass `req.ipInfo` directly. The earlier "prefer session.countryCode, fallback to req's countryCode" branching is gone — record `ipInfo` reflects what was true at challenge-issuance time.
194
+ - Provider read sites (`powTasks.ts`, `puzzleTasks.ts`, `imgCaptchaTasks.ts`) narrow `record.ipInfo?.isValid` then read `.countryCode` for access-policy / decision-machine input — same effective value, derived from the persisted payload.
195
+ - Lean projections in `provider.ts` switched from `countryCode: 1` to `ipInfo: 1`.
196
+
197
+ Paired with [captcha-private#3339](https://github.com/prosopo/captcha-private/pull/3339), which updates the CHECK_IP_INFO backfill job (now writes the full payload, query becomes `{ ipInfo: { $exists: false } }`), the portal search models / aggregation pipeline (read nested `ipInfo.*`), and the anomaly detectors.
198
+ - f9ea09d: Drop flat `countryCode` / `geolocation` fields from Session records — persist the full `IPInfoResponse` payload as `session.ipInfo` instead
199
+
200
+ Brings sessions in line with captcha records (PoW / Puzzle / UserCommitment), which already store the full payload. The provider's `ipInfoMiddleware` populates `req.ipInfo` at session-creation time; that whole payload now lives on the session, so consumers narrow on `session.ipInfo?.isValid` and read whichever sub-field they need (countryCode, isVPN, isMobile, isTor, ...).
201
+
202
+ - `Session` interface + `SessionSchema` zod (`@prosopo/types`): replace `countryCode?: string` / `geolocation?: string` with `ipInfo?: IPInfoResponse`.
203
+ - `SessionRecordSchema` mongoose (`@prosopo/types-database`): same.
204
+ - `FrictionlessManager.setSessionParams` / `createSession`: accept `ipInfo` instead of `countryCode`.
205
+ - `getFrictionlessCaptchaChallenge.ts` call sites (10 of them — `sendImageCaptcha`, `sendPowCaptcha`, `registerBlockedSession`, etc.) pass `req.ipInfo` instead of `countryCode`.
206
+ - `CaptchaManager.isValidRequest()` return: drop dead `countryCode: sessionRecord.countryCode` field (no caller was destructuring it after the earlier refactor), surface `ipInfo: sessionRecord.ipInfo` instead for callers that want it.
207
+ - Two new MongoMemory roundtrip tests in `ipInfoPersistence.integration.test.ts` cover Session.ipInfo (valid response + error response). `routingDecisionMachines.integration.test.ts` fixture updated to write the full payload.
208
+
209
+ `RoutingContext.countryCode` is unchanged — that's a transient runtime struct fed into the routing machine, not a stored record. Callers of `setRoutingContext` already derive `countryCode` from `req.ipInfo.countryCode` at the API boundary.
210
+
211
+ Paired with [captcha-private#3339](https://github.com/prosopo/captcha-private/pull/3339).
212
+ - 4aae4e6: Plumb the WASM SIMD CPU fingerprint readings (collected by the catcher
213
+ client per https://blog.azerpas.com/writing/wasm-simd-fingerprinting/)
214
+ through the captcha flow and onto the linked `Session` record.
215
+ Collection-only — no scoring or classification yet.
216
+
217
+ The readings are sent at the earliest moment they're available so the
218
+ signal lands on the session as soon as possible:
219
+
220
+ 1. **Captcha-challenge GET** (PoW / Puzzle / Image) — the procaptcha
221
+ Manager calls `frictionlessState.getSimdReadings(0)` (non-blocking
222
+ cache check) and attaches it to the challenge-request body. The
223
+ provider handler decodes and patches the linked session via
224
+ `updateSessionRecord`.
225
+ 2. **Solution submission** (PoW / Puzzle / Image) — same non-blocking
226
+ check on the submit body. Acts as a backup if the benchmark wasn't
227
+ ready in time for the challenge GET.
228
+
229
+ Frictionless init itself stays SIMD-free (benchmark is too slow to gate
230
+ the first hop).
231
+
232
+ Surface area:
233
+
234
+ - `SimdReadings` discriminated union + `SimdOpReadingRecord` /
235
+ `SimdOpCategory` in `@prosopo/types`, plus `simdReadingsCodec` shared
236
+ encode/decode helpers so the browser SDK and the provider use the same
237
+ pipe-safe wire format.
238
+ - Optional `simdReadings: string()` on `CaptchaRequestBody`,
239
+ `GetPowCaptchaChallengeRequestBody`, `GetPuzzleCaptchaChallengeRequestBody`,
240
+ `CaptchaSolutionBody`, `SubmitPowCaptchaSolutionBody`, and
241
+ `SubmitPuzzleCaptchaSolutionBody`.
242
+ - `FrictionlessState.getSimdReadings` + `BotDetectionFunctionResult.getSimdReadings`
243
+ so the catcher's prefetched benchmark is consumed at the request sites.
244
+ - `ProcaptchaApiInterface.{getCaptchaChallenge, submitCaptchaSolution}` and
245
+ the `ProviderApi.{getCaptchaChallenge, getPowCaptchaChallenge, getPuzzleCaptchaChallenge,
246
+ submitCaptchaSolution, submitPowCaptchaSolution, submitPuzzleCaptchaSolution}`
247
+ client methods accept the field.
248
+ - Provider challenge + solution handlers decode via `decodeSimdReadings`
249
+ and `updateSessionRecord` (Mongoose `Mixed`, Zod discriminated-union
250
+ validation at the edge). The challenge-GET patch is fire-and-forget.
251
+
252
+ Backward-compatible: older catcher clients omit the field at every layer;
253
+ the session record omits it in turn.
254
+ - Updated dependencies [3c0be68]
255
+ - Updated dependencies [f9ea09d]
256
+ - Updated dependencies [4aae4e6]
257
+ - Updated dependencies [d865319]
258
+ - Updated dependencies [753304b]
259
+ - Updated dependencies [8bb7286]
260
+ - Updated dependencies [f9ea09d]
261
+ - Updated dependencies [4aae4e6]
262
+ - Updated dependencies [4993813]
263
+ - Updated dependencies [72a0483]
264
+ - @prosopo/types@4.0.0
265
+ - @prosopo/locale@3.2.2
266
+ - @prosopo/common@3.1.34
267
+ - @prosopo/user-access-policy@3.7.2
268
+
269
+ ## 4.6.2
270
+ ### Patch Changes
271
+
272
+ - 819ed95: Adding invisible mode to session data
273
+ - Updated dependencies [819ed95]
274
+ - @prosopo/types@3.16.1
275
+ - @prosopo/user-access-policy@3.7.1
276
+
277
+ ## 4.6.1
278
+ ### Patch Changes
279
+
280
+ - Updated dependencies [60ba3b1]
281
+ - @prosopo/user-access-policy@3.7.0
282
+
283
+ ## 4.6.0
284
+ ### Minor Changes
285
+
286
+ - 74092d0: Stream data back to central for decisions
287
+
288
+ ## 4.5.3
289
+ ### Patch Changes
290
+
291
+ - f6a4402: API endpoint for removing site keys
292
+ - Updated dependencies [f6a4402]
293
+ - Updated dependencies [99dfb44]
294
+ - @prosopo/types@3.16.0
295
+ - @prosopo/user-access-policy@3.6.24
296
+
297
+ ## 4.5.2
298
+ ### Patch Changes
299
+
300
+ - Updated dependencies [3e54c0a]
301
+ - @prosopo/types@3.15.0
302
+ - @prosopo/user-access-policy@3.6.23
303
+
304
+ ## 4.5.1
305
+ ### Patch Changes
306
+
307
+ - 946a8ba: Abuser score threshold
308
+ - Updated dependencies [946a8ba]
309
+ - Updated dependencies [5614814]
310
+ - Updated dependencies [b94890c]
311
+ - @prosopo/types@3.14.1
312
+ - @prosopo/locale@3.2.1
313
+ - @prosopo/common@3.1.33
314
+ - @prosopo/user-access-policy@3.6.22
315
+
316
+ ## 4.5.0
317
+ ### Minor Changes
318
+
319
+ - 42650db: Add better spam rules and move ipinfo service to local instead of external
320
+
321
+ ### Patch Changes
322
+
323
+ - fc514dd: ability to block different types of traffic
324
+ - Updated dependencies [fc514dd]
325
+ - Updated dependencies [42650db]
326
+ - @prosopo/locale@3.2.0
327
+ - @prosopo/types@3.14.0
328
+ - @prosopo/common@3.1.32
329
+ - @prosopo/user-access-policy@3.6.21
330
+
331
+ ## 4.4.14
332
+ ### Patch Changes
333
+
334
+ - Updated dependencies [4a9c518]
335
+ - @prosopo/common@3.1.31
336
+ - @prosopo/user-access-policy@3.6.20
337
+
338
+ ## 4.4.13
339
+ ### Patch Changes
340
+
341
+ - @prosopo/types@3.13.3
342
+ - @prosopo/user-access-policy@3.6.19
343
+
344
+ ## 4.4.12
345
+ ### Patch Changes
346
+
347
+ - @prosopo/types@3.13.2
348
+ - @prosopo/user-access-policy@3.6.18
349
+
350
+ ## 4.4.11
351
+ ### Patch Changes
352
+
353
+ - @prosopo/types@3.13.1
354
+ - @prosopo/user-access-policy@3.6.17
355
+
356
+ ## 4.4.10
357
+ ### Patch Changes
358
+
359
+ - Updated dependencies [e6d9553]
360
+ - @prosopo/types@3.13.0
361
+ - @prosopo/user-access-policy@3.6.16
362
+
363
+ ## 4.4.9
364
+ ### Patch Changes
365
+
366
+ - e1ea65f: Better spam email domain checking
367
+ - c316257: Adding sync fo sessions wrt captcha status
368
+ - Updated dependencies [d5082a9]
369
+ - Updated dependencies [e1ea65f]
370
+ - Updated dependencies [c316257]
371
+ - @prosopo/types@3.12.3
372
+ - @prosopo/user-access-policy@3.6.15
373
+
374
+ ## 4.4.8
375
+ ### Patch Changes
376
+
377
+ - adb89a6: Disposable email checking
378
+ - Updated dependencies [adb89a6]
379
+ - @prosopo/locale@3.1.29
380
+ - @prosopo/types@3.12.2
381
+ - @prosopo/common@3.1.30
382
+ - @prosopo/user-access-policy@3.6.14
383
+
384
+ ## 4.4.7
385
+ ### Patch Changes
386
+
387
+ - a90eb54: We know WHAT happens but we don't know WHY happens
388
+ - Updated dependencies [c5ee492]
389
+ - Updated dependencies [a90eb54]
390
+ - @prosopo/common@3.1.29
391
+ - @prosopo/types@3.12.1
392
+ - @prosopo/user-access-policy@3.6.13
393
+
394
+ ## 4.4.6
395
+ ### Patch Changes
396
+
397
+ - Updated dependencies [676c5f2]
398
+ - Updated dependencies [feaca02]
399
+ - @prosopo/types@3.12.0
400
+ - @prosopo/user-access-policy@3.6.12
401
+
402
+ ## 4.4.5
403
+ ### Patch Changes
404
+
405
+ - 8148587: Clustering
406
+ - Updated dependencies [8148587]
407
+ - @prosopo/types@3.11.1
408
+ - @prosopo/user-access-policy@3.6.11
409
+
410
+ ## 4.4.4
411
+ ### Patch Changes
412
+
413
+ - 90033e9: Add missing schema field
414
+
415
+ ## 4.4.3
416
+ ### Patch Changes
417
+
418
+ - Updated dependencies [7f6ffc5]
419
+ - @prosopo/types@3.11.0
420
+ - @prosopo/user-access-policy@3.6.10
421
+
422
+ ## 4.4.2
423
+ ### Patch Changes
424
+
425
+ - 93fa086: Add decision engine endpoints
426
+ - Updated dependencies [93fa086]
427
+ - @prosopo/types@3.10.2
428
+ - @prosopo/user-access-policy@3.6.9
429
+
430
+ ## 4.4.1
431
+ ### Patch Changes
432
+
433
+ - cde7550: enhance/frictionless-headers-db-field
434
+ - Updated dependencies [cde7550]
435
+ - @prosopo/types@3.10.1
436
+ - @prosopo/user-access-policy@3.6.8
437
+
438
+ ## 4.4.0
439
+ ### Minor Changes
440
+
441
+ - ad6d622: Separate types from mongoose schemas to avoid bundling mongoose in frontend
442
+
443
+ ### Patch Changes
444
+
445
+ - fa95c5f: zod types for db records
446
+ - Updated dependencies [ad6d622]
447
+ - @prosopo/types@3.10.0
448
+ - @prosopo/user-access-policy@3.6.7
449
+
450
+ ## 4.3.1
451
+ ### Patch Changes
452
+
453
+ - Updated dependencies [ff58a70]
454
+ - @prosopo/types@3.9.0
455
+ - @prosopo/user-access-policy@3.6.6
456
+
457
+ ## 4.3.0
458
+ ### Minor Changes
459
+
460
+ - 3feeea4: Store geolocation. Remove pending image captcha collection
461
+
462
+ ## 4.2.4
463
+ ### Patch Changes
464
+
465
+ - 4c08158: Skip ip validation unit tests
466
+ - d2431cd: Allow IP validation rules to be disabled
467
+ - Updated dependencies [d2431cd]
468
+ - @prosopo/types@3.8.4
469
+ - @prosopo/user-access-policy@3.6.5
470
+
471
+ ## 4.2.3
472
+ ### Patch Changes
473
+
474
+ - 8dad7f3: Implement frictionless blocks
475
+
476
+ ## 4.2.2
477
+ ### Patch Changes
478
+
479
+ - Updated dependencies [bd6995b]
480
+ - @prosopo/user-access-policy@3.6.4
481
+ - @prosopo/types@3.8.3
482
+
483
+ ## 4.2.1
484
+ ### Patch Changes
485
+
486
+ - 9633e58: Add captcha type to decision machine and run on image verification"
487
+ - Updated dependencies [9633e58]
488
+ - @prosopo/types@3.8.2
489
+ - @prosopo/user-access-policy@3.6.3
490
+
491
+ ## 4.2.0
492
+ ### Minor Changes
493
+
494
+ - 4299cae: Adding site key to session records
495
+
496
+ ### Patch Changes
497
+
498
+ - f52a5c1: Adding decision machine to provider for behavior detection
499
+ - Updated dependencies [f52a5c1]
500
+ - @prosopo/types@3.8.1
501
+ - @prosopo/user-access-policy@3.6.2
502
+
503
+ ## 4.1.6
504
+ ### Patch Changes
505
+
506
+ - Updated dependencies [ed87b6f]
507
+ - @prosopo/user-access-policy@3.6.1
508
+
3
509
  ## 4.1.5
4
510
  ### Patch Changes
5
511
 
@@ -4,26 +4,23 @@ require("./types/index.cjs");
4
4
  const provider = require("./types/provider.cjs");
5
5
  const client = require("./types/client.cjs");
6
6
  const captcha = require("./types/captcha.cjs");
7
+ const spamEmailDomain = require("./types/spamEmailDomain.cjs");
8
+ const bannedDomain = require("./types/bannedDomain.cjs");
7
9
  exports.CaptchaRecordSchema = provider.CaptchaRecordSchema;
8
10
  exports.ClientContextEntropyRecordSchema = provider.ClientContextEntropyRecordSchema;
9
11
  exports.ClientRecordSchema = provider.ClientRecordSchema;
10
12
  exports.CompositeIpAddressRecordSchemaObj = provider.CompositeIpAddressRecordSchemaObj;
11
- exports.CompositeIpAddressSchema = provider.CompositeIpAddressSchema;
12
13
  exports.DatasetRecordSchema = provider.DatasetRecordSchema;
14
+ exports.DecisionMachineArtifactRecordSchema = provider.DecisionMachineArtifactRecordSchema;
13
15
  exports.DetectorRecordSchema = provider.DetectorRecordSchema;
14
- exports.IpAddressType = provider.IpAddressType;
15
- exports.PendingRecordSchema = provider.PendingRecordSchema;
16
16
  exports.PoWCaptchaRecordSchema = provider.PoWCaptchaRecordSchema;
17
+ exports.PuzzleCaptchaRecordSchema = provider.PuzzleCaptchaRecordSchema;
17
18
  exports.ScheduledTaskRecordSchema = provider.ScheduledTaskRecordSchema;
18
19
  exports.ScheduledTaskSchema = provider.ScheduledTaskSchema;
19
20
  exports.SessionRecordSchema = provider.SessionRecordSchema;
20
21
  exports.SolutionRecordSchema = provider.SolutionRecordSchema;
21
22
  exports.UserCommitmentRecordSchema = provider.UserCommitmentRecordSchema;
22
- exports.UserCommitmentSchema = provider.UserCommitmentSchema;
23
- exports.UserCommitmentWithSolutionsSchema = provider.UserCommitmentWithSolutionsSchema;
24
23
  exports.UserSolutionRecordSchema = provider.UserSolutionRecordSchema;
25
- exports.UserSolutionSchema = provider.UserSolutionSchema;
26
- exports.parseMongooseCompositeIpAddress = provider.parseMongooseCompositeIpAddress;
27
24
  exports.AccountSchema = client.AccountSchema;
28
25
  exports.IPValidationRulesSchema = client.IPValidationRulesSchema;
29
26
  exports.TableNames = client.TableNames;
@@ -32,3 +29,5 @@ exports.UserSettingsSchema = client.UserSettingsSchema;
32
29
  exports.StoredPoWCaptchaRecordSchema = captcha.StoredPoWCaptchaRecordSchema;
33
30
  exports.StoredSessionRecordSchema = captcha.StoredSessionRecordSchema;
34
31
  exports.StoredUserCommitmentRecordSchema = captcha.StoredUserCommitmentRecordSchema;
32
+ exports.SpamEmailDomainRecordSchema = spamEmailDomain.SpamEmailDomainRecordSchema;
33
+ exports.BannedDomainRecordSchema = bannedDomain.BannedDomainRecordSchema;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const mongoose = require("mongoose");
4
+ const BannedDomainRecordSchema = new mongoose.Schema({
5
+ domain: { type: String, required: true, unique: true }
6
+ });
7
+ BannedDomainRecordSchema.index({ domain: 1 });
8
+ exports.BannedDomainRecordSchema = BannedDomainRecordSchema;
@@ -3,6 +3,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const types = require("@prosopo/types");
4
4
  const mongoose = require("mongoose");
5
5
  const IPValidationRulesSchema = new mongoose.Schema({
6
+ enabled: {
7
+ type: Boolean,
8
+ default: false,
9
+ required: true
10
+ },
6
11
  actions: {
7
12
  countryChangeAction: {
8
13
  type: mongoose.Schema.Types.Mixed,
@@ -61,12 +66,34 @@ const IPValidationRulesSchema = new mongoose.Schema({
61
66
  }
62
67
  });
63
68
  const UserSettingsSchema = new mongoose.Schema({
64
- captchaType: String,
65
- frictionlessThreshold: Number,
66
- powDifficulty: Number,
67
- imageThreshold: Number,
69
+ captchaType: {
70
+ type: String,
71
+ enum: types.CaptchaType,
72
+ default: types.captchaTypeDefault
73
+ },
74
+ frictionlessThreshold: {
75
+ type: Number,
76
+ default: types.frictionlessThresholdDefault
77
+ },
78
+ powDifficulty: { type: Number, default: types.powDifficultyDefault },
79
+ imageThreshold: {
80
+ type: Number,
81
+ default: types.imageThresholdDefault
82
+ },
83
+ imageMaxRounds: {
84
+ type: Number,
85
+ default: types.imageMaxRoundsDefault,
86
+ required: false
87
+ },
88
+ puzzleTolerance: {
89
+ type: Number,
90
+ required: false
91
+ },
68
92
  ipValidationRules: IPValidationRulesSchema,
69
- domains: [String],
93
+ domains: {
94
+ type: [String],
95
+ default: types.domainsDefault
96
+ },
70
97
  disallowWebView: {
71
98
  type: Boolean,
72
99
  default: false
@@ -86,6 +113,51 @@ const UserSettingsSchema = new mongoose.Schema({
86
113
  }
87
114
  }
88
115
  }
116
+ },
117
+ spamEmailDomainCheckEnabled: {
118
+ type: Boolean,
119
+ default: false,
120
+ required: false
121
+ },
122
+ autoBanScoreThreshold: {
123
+ type: Number,
124
+ min: 0,
125
+ required: false
126
+ },
127
+ spamFilter: {
128
+ enabled: { type: Boolean, default: false },
129
+ emailRules: {
130
+ enabled: { type: Boolean, default: false },
131
+ maxLocalPartDots: { type: Number, required: false },
132
+ normaliseGmail: { type: Boolean, default: false },
133
+ useDefaultPatterns: { type: Boolean, default: false },
134
+ customRegexBlocklist: { type: [String], default: [] }
135
+ }
136
+ },
137
+ trafficFilter: {
138
+ blockVpn: { type: Boolean, default: false },
139
+ blockProxy: { type: Boolean, default: false },
140
+ blockTor: { type: Boolean, default: false },
141
+ blockAbuser: { type: Boolean, default: true },
142
+ abuserScoreThreshold: { type: Number, min: 0, max: 1, default: 0 },
143
+ blockDatacenter: { type: Boolean, default: false },
144
+ blockMobile: { type: Boolean, default: false },
145
+ blockSatellite: { type: Boolean, default: false },
146
+ blockCrawler: { type: Boolean, default: false }
147
+ },
148
+ storeMetadata: {
149
+ type: Boolean,
150
+ default: false,
151
+ required: false
152
+ },
153
+ honeypot: {
154
+ enabled: { type: Boolean, default: false },
155
+ question: { type: String, required: false },
156
+ encodingType: {
157
+ type: String,
158
+ enum: ["morse", "semaphore"],
159
+ default: "morse"
160
+ }
89
161
  }
90
162
  });
91
163
  const UserDataSchema = new mongoose.Schema({