@prosopo/database 3.6.6 → 3.13.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/.turbo/turbo-build$colon$cjs.log +17 -13
  2. package/.turbo/turbo-build$colon$tsc.log +18 -15
  3. package/.turbo/turbo-build.log +18 -14
  4. package/CHANGELOG.md +604 -0
  5. package/dist/base/mongo.d.ts +1 -1
  6. package/dist/base/mongo.d.ts.map +1 -1
  7. package/dist/base/mongo.js +5 -2
  8. package/dist/base/mongo.js.map +1 -1
  9. package/dist/base/mongoMemory.d.ts +1 -1
  10. package/dist/cjs/base/mongo.cjs +6 -3
  11. package/dist/cjs/databases/captcha.cjs +2 -1
  12. package/dist/cjs/databases/centralDbStreamer.cjs +136 -0
  13. package/dist/cjs/databases/index.cjs +2 -0
  14. package/dist/cjs/databases/provider.cjs +687 -162
  15. package/dist/cjs/index.cjs +4 -0
  16. package/dist/cjs/redisCache.cjs +388 -0
  17. package/dist/databases/captcha.d.ts +1 -1
  18. package/dist/databases/captcha.d.ts.map +1 -1
  19. package/dist/databases/captcha.js +2 -1
  20. package/dist/databases/captcha.js.map +1 -1
  21. package/dist/databases/centralDbStreamer.d.ts +19 -0
  22. package/dist/databases/centralDbStreamer.d.ts.map +1 -0
  23. package/dist/databases/centralDbStreamer.js +136 -0
  24. package/dist/databases/centralDbStreamer.js.map +1 -0
  25. package/dist/databases/client.d.ts +1 -1
  26. package/dist/databases/client.d.ts.map +1 -1
  27. package/dist/databases/client.js.map +1 -1
  28. package/dist/databases/index.d.ts +1 -0
  29. package/dist/databases/index.d.ts.map +1 -1
  30. package/dist/databases/index.js +2 -0
  31. package/dist/databases/index.js.map +1 -1
  32. package/dist/databases/provider.d.ts +45 -14
  33. package/dist/databases/provider.d.ts.map +1 -1
  34. package/dist/databases/provider.js +688 -163
  35. package/dist/databases/provider.js.map +1 -1
  36. package/dist/index.d.ts +1 -0
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +5 -1
  39. package/dist/index.js.map +1 -1
  40. package/dist/redisCache.d.ts +31 -0
  41. package/dist/redisCache.d.ts.map +1 -0
  42. package/dist/redisCache.js +388 -0
  43. package/dist/redisCache.js.map +1 -0
  44. package/dist/tests/integration/ipInfoPersistence.integration.test.d.ts +2 -0
  45. package/dist/tests/integration/ipInfoPersistence.integration.test.d.ts.map +1 -0
  46. package/dist/tests/integration/ipInfoPersistence.integration.test.js +243 -0
  47. package/dist/tests/integration/ipInfoPersistence.integration.test.js.map +1 -0
  48. package/dist/tests/unit/captchaLabel.unit.test.d.ts +2 -0
  49. package/dist/tests/unit/captchaLabel.unit.test.d.ts.map +1 -0
  50. package/dist/tests/unit/captchaLabel.unit.test.js +41 -0
  51. package/dist/tests/unit/captchaLabel.unit.test.js.map +1 -0
  52. package/dist/tests/unit/databases/centralDbStreamer.unit.test.d.ts +2 -0
  53. package/dist/tests/unit/databases/centralDbStreamer.unit.test.d.ts.map +1 -0
  54. package/dist/tests/unit/databases/centralDbStreamer.unit.test.js +221 -0
  55. package/dist/tests/unit/databases/centralDbStreamer.unit.test.js.map +1 -0
  56. package/package.json +12 -9
  57. package/vite.test.config.ts +18 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,609 @@
1
1
  # @prosopo/database
2
2
 
3
+ ## 3.13.7
4
+ ### Patch Changes
5
+
6
+ - Updated dependencies [a1d60db]
7
+ - Updated dependencies [2392aaf]
8
+ - Updated dependencies [97cf7bd]
9
+ - Updated dependencies [6ca1125]
10
+ - Updated dependencies [32a591b]
11
+ - @prosopo/types@4.3.0
12
+ - @prosopo/types-database@4.8.0
13
+ - @prosopo/logger@1.0.2
14
+ - @prosopo/util@3.2.15
15
+ - @prosopo/common@3.1.38
16
+ - @prosopo/user-access-policy@3.7.11
17
+ - @prosopo/redis-client@1.0.23
18
+
19
+ ## 3.13.6
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [6c26669]
23
+ - Updated dependencies [f7f9ec5]
24
+ - @prosopo/types@4.2.1
25
+ - @prosopo/types-database@4.7.8
26
+ - @prosopo/user-access-policy@3.7.10
27
+
28
+ ## 3.13.5
29
+ ### Patch Changes
30
+
31
+ - 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.
32
+ - Updated dependencies [0fd81af]
33
+ - @prosopo/common@3.1.37
34
+ - @prosopo/logger@1.0.1
35
+ - @prosopo/redis-client@1.0.22
36
+ - @prosopo/types-database@4.7.7
37
+ - @prosopo/user-access-policy@3.7.9
38
+
39
+ ## 3.13.4
40
+ ### Patch Changes
41
+
42
+ - b2e1a5d: fix(database/provider): don't flag image-captcha placeholder records as `pendingStage`
43
+
44
+ #2596 set `pendingStage: true` on every commitment write, including
45
+ `storePendingImageCommitment` which inserts placeholder records with
46
+ `id: ""` while waiting for the user to submit a solution. The sweep
47
+ then picked those up via `pendingStage_partial` (fast) and called
48
+ `markDappUserCommitmentsStored(["", "", ...], ts)` (slow) — Mongo
49
+ dedupes the `$in` array to a single empty-string bound and the
50
+ `IXSCAN { id: -1 }` walks every empty-id document on the node (~102K
51
+ on production). On pronode11 that meant 2–8 s per sweep cycle of
52
+ unnecessary index scan on `usercommitments`, replacing the old
53
+ WT-cache-thrash with a different one.
54
+
55
+ Two-part fix:
56
+
57
+ - `storePendingImageCommitment` no longer sets `pendingStage`. The
58
+ real commitment record only gets the flag once `approve` /
59
+ `disapprove` runs, at which point `id` is populated and staging is
60
+ meaningful.
61
+ - `storeCommitmentsExternal` defensively skips any batch entry whose
62
+ `id` is empty before calling `markDappUserCommitmentsStored`, so a
63
+ stray placeholder slipping into the partial index can never
64
+ re-introduce the bug.
65
+
66
+ For nodes already running #2596, the existing flagged placeholders
67
+ need clearing once (otherwise they sit at `pendingStage: true`
68
+ forever, since `markDappUserCommitmentsStored`'s
69
+ `lastUpdatedTimestamp <= ts` guard never matches them after their
70
+ last update). One-shot per node:
71
+
72
+ ```js
73
+ db.usercommitments.updateMany(
74
+ { pendingStage: true, id: "" },
75
+ { $unset: { pendingStage: 1 } }
76
+ );
77
+ ```
78
+ - Updated dependencies [cdbc5ed]
79
+ - Updated dependencies [4d9923e]
80
+ - Updated dependencies [20cae63]
81
+ - Updated dependencies [4d9923e]
82
+ - @prosopo/types-database@4.7.6
83
+ - @prosopo/types@4.2.0
84
+ - @prosopo/user-access-policy@3.7.8
85
+
86
+ ## 3.13.3
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/types-database@4.7.5
132
+ - @prosopo/user-access-policy@3.7.7
133
+
134
+ ## 3.13.2
135
+ ### Patch Changes
136
+
137
+ - Updated dependencies [6567ce0]
138
+ - Updated dependencies [e2711ae]
139
+ - Updated dependencies [5786629]
140
+ - Updated dependencies [7e8cbb7]
141
+ - @prosopo/util@3.2.14
142
+ - @prosopo/types@4.1.3
143
+ - @prosopo/types-database@4.7.4
144
+ - @prosopo/user-access-policy@3.7.6
145
+ - @prosopo/common@3.1.36
146
+ - @prosopo/redis-client@1.0.21
147
+
148
+ ## 3.13.1
149
+ ### Patch Changes
150
+
151
+ - Updated dependencies [72a1218]
152
+ - @prosopo/util@3.2.13
153
+ - @prosopo/types@4.1.2
154
+ - @prosopo/user-access-policy@3.7.5
155
+ - @prosopo/types-database@4.7.3
156
+
157
+ ## 3.13.0
158
+ ### Minor Changes
159
+
160
+ - 91958da: Puzzle captcha + maintenance mode hardening, plus a refactor of the
161
+ frictionless handler into focused modules.
162
+
163
+ - **Puzzle captcha now records checkbox-click coordinates like POW.** Adds an
164
+ optional `salt` field to `SubmitPuzzleCaptchaSolutionBody`; the puzzle
165
+ widget hashes the click coords into the salt and the server decodes them
166
+ into the puzzle record's `coords` field on submit. New `start(x, y)`
167
+ parameters on `procaptcha-puzzle` Manager + widget.
168
+ - **Fix puzzle "No session found" caused by stale Redis dedup.** The
169
+ `/frictionless` dedup path is now Mongo-authoritative — Redis is no
170
+ longer consulted as a session source. A concurrent `/captcha/{type}`
171
+ invalidation could previously race a fire-and-forget Redis repopulation
172
+ in the `/frictionless` dedup branch, leaving Redis pointing at a
173
+ Mongo-deleted session for the full 1-hour TTL. Stale pointers are now
174
+ evicted lazily.
175
+ - **Maintenance mode operates without MongoDB.** `/frictionless` and
176
+ `/captcha/{pow,puzzle}` short-circuit to dummy responses before any DB
177
+ call, and `Environment.isReady()` tolerates a Mongo connect failure when
178
+ `MAINTENANCE_MODE=true` so the provider can start with Mongo down.
179
+ - **Refactor `getFrictionlessCaptchaChallenge.ts` into focused modules** under
180
+ `getFrictionlessCaptchaChallenge/` (handler, sessionDedup, shortCircuit,
181
+ accessPolicy, decisionMachine, decryptSimdReadings, constants). Original
182
+ import path preserved via a re-export shim.
183
+ - **Move `RedisWriteQueue` from `@prosopo/provider` to `@prosopo/database`**
184
+ (where the Redis connection itself lives), and clear residual Redis
185
+ session keys at provider startup via `Environment.cleanup()` so a
186
+ previously-crashed run can't leak stale dedup pointers.
187
+ - Adds puzzle-type branch to access-policy handling in `/frictionless`.
188
+
189
+ ### Patch Changes
190
+
191
+ - Updated dependencies [91958da]
192
+ - @prosopo/types@4.1.1
193
+ - @prosopo/common@3.1.35
194
+ - @prosopo/types-database@4.7.2
195
+ - @prosopo/user-access-policy@3.7.4
196
+ - @prosopo/redis-client@1.0.20
197
+
198
+ ## 3.12.1
199
+ ### Patch Changes
200
+
201
+ - 6a741ce: Move `FrictionlessReason` into `@prosopo/types` and add a new
202
+ `ResultReason` enum covering the values previously inlined as string
203
+ literals on `result.reason` (API.CAPTCHA_PASSED, API.VPN_BLOCKED,
204
+ EMAIL_INVALID, etc.). Provider task code now references the enums so the
205
+ canonical list of selection/result reasons lives in one place and can be
206
+ imported by non-server packages (portal, audit tooling) without pulling
207
+ in `@prosopo/provider`. The previous `FrictionlessReason` export from
208
+ `@prosopo/provider` is preserved as a re-export for backwards
209
+ compatibility.
210
+
211
+ `CaptchaResult.reason`, `StoredCaptcha.result.reason`, `Session.result.reason`
212
+ are now typed `ResultReason | undefined`; `Session.reason` is typed
213
+ `FrictionlessReason | undefined`. The runtime zod schema stays permissive
214
+ (`string().optional().transform(v => v as ResultReason | undefined)`) so
215
+ operator-authored decision-machine output and old MongoDB records still
216
+ parse without throwing; the strict enum is preserved on the TS surface
217
+ via the transform.
218
+ - Updated dependencies [6a741ce]
219
+ - @prosopo/types@4.1.0
220
+ - @prosopo/types-database@4.7.1
221
+ - @prosopo/user-access-policy@3.7.3
222
+
223
+ ## 3.12.0
224
+ ### Minor Changes
225
+
226
+ - d865319: Add puzzle captcha (drag-to-target challenge) as a new captcha type:
227
+ provider endpoints, manager + widget package, types, demo pages, and
228
+ a `puzzleTolerance` site setting.
229
+
230
+ ### Patch Changes
231
+
232
+ - f9ea09d: Stop re-looking up the IP in `checkTrafficFilter` — read `record.ipInfo` instead
233
+
234
+ Now that every captcha record carries the full `IPInfoResponse` (written by `ipInfoMiddleware` at request time), `checkTrafficFilter` no longer needs to call `ipInfoService.lookup(ip)` on the verify path. The function takes an `IPInfoResponse | undefined` directly and is no longer async — one fewer sidecar round-trip per verify call.
235
+
236
+ - `checkTrafficFilter(ip, trafficFilter, ipInfoService, logger)` → `checkTrafficFilter(ipInfo, trafficFilter)`.
237
+ - `serverVerifyPowCaptchaSolution`, `verifyImageCaptchaSolution`, and `serverVerifyPuzzleCaptchaSolution` (newly given a `trafficFilter` parameter to bring it to parity with the other two) read `challengeRecord.ipInfo` / `solution.ipInfo` by default, and only do a fresh `env.ipInfoService.lookup(ip)` when the dapp passed up the end user's current IP via the verify call — that's the "now" IP for filtering, and may differ from the IP that originally requested the captcha.
238
+ - Existing unit tests (`checkTrafficFilter.unit.test.ts`) updated to the new shape; new MongoMemory roundtrip tests in `packages/database/src/tests/integration/ipInfoPersistence.integration.test.ts` prove the three captcha schemas (PoW / Puzzle / UserCommitment) actually persist + retrieve a full IPInfoResponse, and that the `{ ipInfo: { $exists: false } }` backfill query matches records missing the field.
239
+
240
+ Paired with [captcha-private#3339](https://github.com/prosopo/captcha-private/pull/3339).
241
+ - f9ea09d: Drop flat ipinfo fields (`vpn`, `countryCode`, `tor`, `proxy`, `datacenter`, `abuser`, `geolocation`) from captcha records — persist the full `IPInfoResponse` payload as `ipInfo` instead
242
+
243
+ 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.
244
+
245
+ - `StoredCaptcha` interface: removed `vpn`, `countryCode`, `geolocation`. Keeps `ipInfo?: IPInfoResponse`.
246
+ - `PoWCaptchaStoredSchema` zod validator: same removals, adds `ipInfo` (validated as `any()` since `IPInfoResponse` is a discriminated union narrowed at read time).
247
+ - 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 }`.
248
+ - `IProviderDatabase` interface: `storePowCaptchaRecord` / `storePuzzleCaptchaRecord` / `storePendingImageCommitment` now take `ipInfo?: IPInfoResponse` in place of `countryCode?: string`.
249
+ - 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.
250
+ - 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.
251
+ - Lean projections in `provider.ts` switched from `countryCode: 1` to `ipInfo: 1`.
252
+
253
+ 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.
254
+ - 4aae4e6: Plumb the WASM SIMD CPU fingerprint readings (collected by the catcher
255
+ client per https://blog.azerpas.com/writing/wasm-simd-fingerprinting/)
256
+ through the captcha flow and onto the linked `Session` record.
257
+ Collection-only — no scoring or classification yet.
258
+
259
+ The readings are sent at the earliest moment they're available so the
260
+ signal lands on the session as soon as possible:
261
+
262
+ 1. **Captcha-challenge GET** (PoW / Puzzle / Image) — the procaptcha
263
+ Manager calls `frictionlessState.getSimdReadings(0)` (non-blocking
264
+ cache check) and attaches it to the challenge-request body. The
265
+ provider handler decodes and patches the linked session via
266
+ `updateSessionRecord`.
267
+ 2. **Solution submission** (PoW / Puzzle / Image) — same non-blocking
268
+ check on the submit body. Acts as a backup if the benchmark wasn't
269
+ ready in time for the challenge GET.
270
+
271
+ Frictionless init itself stays SIMD-free (benchmark is too slow to gate
272
+ the first hop).
273
+
274
+ Surface area:
275
+
276
+ - `SimdReadings` discriminated union + `SimdOpReadingRecord` /
277
+ `SimdOpCategory` in `@prosopo/types`, plus `simdReadingsCodec` shared
278
+ encode/decode helpers so the browser SDK and the provider use the same
279
+ pipe-safe wire format.
280
+ - Optional `simdReadings: string()` on `CaptchaRequestBody`,
281
+ `GetPowCaptchaChallengeRequestBody`, `GetPuzzleCaptchaChallengeRequestBody`,
282
+ `CaptchaSolutionBody`, `SubmitPowCaptchaSolutionBody`, and
283
+ `SubmitPuzzleCaptchaSolutionBody`.
284
+ - `FrictionlessState.getSimdReadings` + `BotDetectionFunctionResult.getSimdReadings`
285
+ so the catcher's prefetched benchmark is consumed at the request sites.
286
+ - `ProcaptchaApiInterface.{getCaptchaChallenge, submitCaptchaSolution}` and
287
+ the `ProviderApi.{getCaptchaChallenge, getPowCaptchaChallenge, getPuzzleCaptchaChallenge,
288
+ submitCaptchaSolution, submitPowCaptchaSolution, submitPuzzleCaptchaSolution}`
289
+ client methods accept the field.
290
+ - Provider challenge + solution handlers decode via `decodeSimdReadings`
291
+ and `updateSessionRecord` (Mongoose `Mixed`, Zod discriminated-union
292
+ validation at the edge). The challenge-GET patch is fire-and-forget.
293
+
294
+ Backward-compatible: older catcher clients omit the field at every layer;
295
+ the session record omits it in turn.
296
+ - Updated dependencies [3c0be68]
297
+ - Updated dependencies [f9ea09d]
298
+ - Updated dependencies [4aae4e6]
299
+ - Updated dependencies [d865319]
300
+ - Updated dependencies [753304b]
301
+ - Updated dependencies [8bb7286]
302
+ - Updated dependencies [f9ea09d]
303
+ - Updated dependencies [4aae4e6]
304
+ - Updated dependencies [4993813]
305
+ - Updated dependencies [72a0483]
306
+ - @prosopo/types@4.0.0
307
+ - @prosopo/types-database@4.7.0
308
+ - @prosopo/locale@3.2.2
309
+ - @prosopo/util@3.2.12
310
+ - @prosopo/common@3.1.34
311
+ - @prosopo/user-access-policy@3.7.2
312
+ - @prosopo/redis-client@1.0.19
313
+
314
+ ## 3.11.0
315
+ ### Minor Changes
316
+
317
+ - 33a6c57: Provider speed ups
318
+
319
+ ### Patch Changes
320
+
321
+ - Updated dependencies [819ed95]
322
+ - @prosopo/types-database@4.6.2
323
+ - @prosopo/types@3.16.1
324
+ - @prosopo/user-access-policy@3.7.1
325
+
326
+ ## 3.10.2
327
+ ### Patch Changes
328
+
329
+ - Updated dependencies [60ba3b1]
330
+ - @prosopo/user-access-policy@3.7.0
331
+ - @prosopo/types-database@4.6.1
332
+
333
+ ## 3.10.1
334
+ ### Patch Changes
335
+
336
+ - 942701b: Connection drop fix
337
+
338
+ ## 3.10.0
339
+ ### Minor Changes
340
+
341
+ - 74092d0: Stream data back to central for decisions
342
+
343
+ ### Patch Changes
344
+
345
+ - Updated dependencies [74092d0]
346
+ - @prosopo/types-database@4.6.0
347
+
348
+ ## 3.9.18
349
+ ### Patch Changes
350
+
351
+ - f6a4402: API endpoint for removing site keys
352
+ - Updated dependencies [f6a4402]
353
+ - Updated dependencies [99dfb44]
354
+ - @prosopo/types-database@4.5.3
355
+ - @prosopo/types@3.16.0
356
+ - @prosopo/user-access-policy@3.6.24
357
+
358
+ ## 3.9.17
359
+ ### Patch Changes
360
+
361
+ - Updated dependencies [3e54c0a]
362
+ - @prosopo/types@3.15.0
363
+ - @prosopo/types-database@4.5.2
364
+ - @prosopo/user-access-policy@3.6.23
365
+
366
+ ## 3.9.16
367
+ ### Patch Changes
368
+
369
+ - Updated dependencies [946a8ba]
370
+ - Updated dependencies [5614814]
371
+ - Updated dependencies [b94890c]
372
+ - @prosopo/types-database@4.5.1
373
+ - @prosopo/types@3.14.1
374
+ - @prosopo/locale@3.2.1
375
+ - @prosopo/common@3.1.33
376
+ - @prosopo/user-access-policy@3.6.22
377
+ - @prosopo/redis-client@1.0.18
378
+
379
+ ## 3.9.15
380
+ ### Patch Changes
381
+
382
+ - Updated dependencies [fc514dd]
383
+ - Updated dependencies [42650db]
384
+ - @prosopo/types-database@4.5.0
385
+ - @prosopo/locale@3.2.0
386
+ - @prosopo/types@3.14.0
387
+ - @prosopo/common@3.1.32
388
+ - @prosopo/user-access-policy@3.6.21
389
+ - @prosopo/redis-client@1.0.17
390
+
391
+ ## 3.9.14
392
+ ### Patch Changes
393
+
394
+ - Updated dependencies [4a9c518]
395
+ - @prosopo/common@3.1.31
396
+ - @prosopo/redis-client@1.0.16
397
+ - @prosopo/types-database@4.4.14
398
+ - @prosopo/user-access-policy@3.6.20
399
+
400
+ ## 3.9.13
401
+ ### Patch Changes
402
+
403
+ - Updated dependencies [a25dffa]
404
+ - @prosopo/util@3.2.11
405
+ - @prosopo/types@3.13.3
406
+ - @prosopo/user-access-policy@3.6.19
407
+ - @prosopo/types-database@4.4.13
408
+
409
+ ## 3.9.12
410
+ ### Patch Changes
411
+
412
+ - Updated dependencies [346edd7]
413
+ - @prosopo/util@3.2.10
414
+ - @prosopo/types@3.13.2
415
+ - @prosopo/user-access-policy@3.6.18
416
+ - @prosopo/types-database@4.4.12
417
+
418
+ ## 3.9.11
419
+ ### Patch Changes
420
+
421
+ - Updated dependencies [22bfee7]
422
+ - @prosopo/util@3.2.9
423
+ - @prosopo/types@3.13.1
424
+ - @prosopo/user-access-policy@3.6.17
425
+ - @prosopo/types-database@4.4.11
426
+
427
+ ## 3.9.10
428
+ ### Patch Changes
429
+
430
+ - Updated dependencies [e0fb3d6]
431
+ - Updated dependencies [e6d9553]
432
+ - Updated dependencies [f3f23e3]
433
+ - @prosopo/util@3.2.8
434
+ - @prosopo/types@3.13.0
435
+ - @prosopo/user-access-policy@3.6.16
436
+ - @prosopo/types-database@4.4.10
437
+
438
+ ## 3.9.9
439
+ ### Patch Changes
440
+
441
+ - e1ea65f: Better spam email domain checking
442
+ - c316257: Adding sync fo sessions wrt captcha status
443
+ - Updated dependencies [d5082a9]
444
+ - Updated dependencies [e1ea65f]
445
+ - Updated dependencies [c316257]
446
+ - @prosopo/types@3.12.3
447
+ - @prosopo/types-database@4.4.9
448
+ - @prosopo/util@3.2.7
449
+ - @prosopo/user-access-policy@3.6.15
450
+
451
+ ## 3.9.8
452
+ ### Patch Changes
453
+
454
+ - adb89a6: Disposable email checking
455
+ - Updated dependencies [adb89a6]
456
+ - @prosopo/types-database@4.4.8
457
+ - @prosopo/locale@3.1.29
458
+ - @prosopo/types@3.12.2
459
+ - @prosopo/common@3.1.30
460
+ - @prosopo/user-access-policy@3.6.14
461
+ - @prosopo/redis-client@1.0.15
462
+
463
+ ## 3.9.7
464
+ ### Patch Changes
465
+
466
+ - Updated dependencies [c5ee492]
467
+ - Updated dependencies [a90eb54]
468
+ - @prosopo/common@3.1.29
469
+ - @prosopo/types-database@4.4.7
470
+ - @prosopo/types@3.12.1
471
+ - @prosopo/redis-client@1.0.14
472
+ - @prosopo/user-access-policy@3.6.13
473
+
474
+ ## 3.9.6
475
+ ### Patch Changes
476
+
477
+ - Updated dependencies [676c5f2]
478
+ - Updated dependencies [feaca02]
479
+ - @prosopo/types@3.12.0
480
+ - @prosopo/types-database@4.4.6
481
+ - @prosopo/user-access-policy@3.6.12
482
+
483
+ ## 3.9.5
484
+ ### Patch Changes
485
+
486
+ - Updated dependencies [8148587]
487
+ - @prosopo/types-database@4.4.5
488
+ - @prosopo/types@3.11.1
489
+ - @prosopo/user-access-policy@3.6.11
490
+
491
+ ## 3.9.4
492
+ ### Patch Changes
493
+
494
+ - Updated dependencies [90033e9]
495
+ - @prosopo/types-database@4.4.4
496
+
497
+ ## 3.9.3
498
+ ### Patch Changes
499
+
500
+ - Updated dependencies [7f6ffc5]
501
+ - @prosopo/types@3.11.0
502
+ - @prosopo/types-database@4.4.3
503
+ - @prosopo/user-access-policy@3.6.10
504
+
505
+ ## 3.9.2
506
+ ### Patch Changes
507
+
508
+ - 93fa086: Add decision engine endpoints
509
+ - Updated dependencies [93fa086]
510
+ - @prosopo/types-database@4.4.2
511
+ - @prosopo/types@3.10.2
512
+ - @prosopo/user-access-policy@3.6.9
513
+
514
+ ## 3.9.1
515
+ ### Patch Changes
516
+
517
+ - Updated dependencies [cde7550]
518
+ - @prosopo/types-database@4.4.1
519
+ - @prosopo/types@3.10.1
520
+ - @prosopo/user-access-policy@3.6.8
521
+
522
+ ## 3.9.0
523
+ ### Minor Changes
524
+
525
+ - ad6d622: Separate types from mongoose schemas to avoid bundling mongoose in frontend
526
+
527
+ ### Patch Changes
528
+
529
+ - ced9f41: Fix incorrect projection
530
+ - fa95c5f: zod types for db records
531
+ - Updated dependencies [ad6d622]
532
+ - Updated dependencies [fa95c5f]
533
+ - @prosopo/types-database@4.4.0
534
+ - @prosopo/types@3.10.0
535
+ - @prosopo/user-access-policy@3.6.7
536
+
537
+ ## 3.8.0
538
+ ### Minor Changes
539
+
540
+ - d329e63: Use projections to speed up queries
541
+
542
+ ### Patch Changes
543
+
544
+ - Updated dependencies [ff58a70]
545
+ - @prosopo/types@3.9.0
546
+ - @prosopo/types-database@4.3.1
547
+ - @prosopo/user-access-policy@3.6.6
548
+
549
+ ## 3.7.0
550
+ ### Minor Changes
551
+
552
+ - 3feeea4: Store geolocation. Remove pending image captcha collection
553
+
554
+ ### Patch Changes
555
+
556
+ - Updated dependencies [3feeea4]
557
+ - @prosopo/types-database@4.3.0
558
+
559
+ ## 3.6.12
560
+ ### Patch Changes
561
+
562
+ - Updated dependencies [4c08158]
563
+ - Updated dependencies [d2431cd]
564
+ - @prosopo/types-database@4.2.4
565
+ - @prosopo/types@3.8.4
566
+ - @prosopo/user-access-policy@3.6.5
567
+
568
+ ## 3.6.11
569
+ ### Patch Changes
570
+
571
+ - Updated dependencies [8dad7f3]
572
+ - @prosopo/types-database@4.2.3
573
+
574
+ ## 3.6.10
575
+ ### Patch Changes
576
+
577
+ - Updated dependencies [bd6995b]
578
+ - @prosopo/user-access-policy@3.6.4
579
+ - @prosopo/types@3.8.3
580
+ - @prosopo/types-database@4.2.2
581
+
582
+ ## 3.6.9
583
+ ### Patch Changes
584
+
585
+ - Updated dependencies [9633e58]
586
+ - @prosopo/types-database@4.2.1
587
+ - @prosopo/types@3.8.2
588
+ - @prosopo/user-access-policy@3.6.3
589
+
590
+ ## 3.6.8
591
+ ### Patch Changes
592
+
593
+ - f52a5c1: Adding decision machine to provider for behavior detection
594
+ - Updated dependencies [f52a5c1]
595
+ - Updated dependencies [4299cae]
596
+ - @prosopo/types-database@4.2.0
597
+ - @prosopo/types@3.8.1
598
+ - @prosopo/user-access-policy@3.6.2
599
+
600
+ ## 3.6.7
601
+ ### Patch Changes
602
+
603
+ - Updated dependencies [ed87b6f]
604
+ - @prosopo/user-access-policy@3.6.1
605
+ - @prosopo/types-database@4.1.6
606
+
3
607
  ## 3.6.6
4
608
  ### Patch Changes
5
609
 
@@ -1,4 +1,4 @@
1
- import { type Logger } from "@prosopo/common";
1
+ import { type Logger } from "@prosopo/logger";
2
2
  import type { IDatabase } from "@prosopo/types-database";
3
3
  import mongoose, { type Connection } from "mongoose";
4
4
  export declare class MongoDatabase implements IDatabase {
@@ -1 +1 @@
1
- {"version":3,"file":"mongo.d.ts","sourceRoot":"","sources":["../../src/base/mongo.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,MAAM,EAA6B,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,QAAQ,EAAE,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAarD,qBAAa,aAAc,YAAW,SAAS;IAC9C,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,UAAS;IAClB,OAAO,CAAC,UAAU,CAAC,CAAgB;gBAGlC,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,MAAM;IAgBhB,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED,aAAa,IAAI,QAAQ,CAAC,UAAU;IAa9B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAsGxB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAO5B"}
1
+ {"version":3,"file":"mongo.d.ts","sourceRoot":"","sources":["../../src/base/mongo.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,MAAM,EAAa,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,QAAQ,EAAE,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAarD,qBAAa,aAAc,YAAW,SAAS;IAC9C,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,UAAS;IAClB,OAAO,CAAC,UAAU,CAAC,CAAgB;gBAGlC,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,MAAM;IAgBhB,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED,aAAa,IAAI,QAAQ,CAAC,UAAU;IAa9B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAwGxB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAO5B"}
@@ -1,4 +1,5 @@
1
- import { getLogger, ProsopoDBError } from "@prosopo/common";
1
+ import { ProsopoDBError } from "@prosopo/common";
2
+ import { getLogger } from "@prosopo/logger";
2
3
  import { ServerApiVersion } from "mongodb";
3
4
  import mongoose from "mongoose";
4
5
  mongoose.set("strictQuery", false);
@@ -57,7 +58,9 @@ class MongoDatabase {
57
58
  this.connecting = new Promise((resolve, reject) => {
58
59
  const connection = mongoose.createConnection(this.url, {
59
60
  dbName: this.dbname,
60
- serverApi: ServerApiVersion.v1
61
+ serverApi: ServerApiVersion.v1,
62
+ maxPoolSize: 50,
63
+ minPoolSize: 5
61
64
  });
62
65
  const onConnected = () => {
63
66
  this.logger.debug(() => ({
@@ -1 +1 @@
1
- {"version":3,"file":"mongo.js","sourceRoot":"","sources":["../../src/base/mongo.ts"],"names":[],"mappings":"AAaA,OAAO,EAAe,cAAc,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,QAA6B,MAAM,UAAU,CAAC;AA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,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;gBACxB,GAAG,EAAE,CAAC;gBACN,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE;gBAChC,GAAG,EAAE,2BAA2B;aAChC,CAAC,CAAC,CAAC;YACJ,MAAM,CAAC,CAAC;QACT,CAAC;IACF,CAAC;IAGD,KAAK,CAAC,KAAK;QACV,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;YACxB,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE;YAChC,GAAG,EAAE,oBAAoB;SACzB,CAAC,CAAC,CAAC;QACJ,MAAM,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,CAAC;IAChC,CAAC;CACD"}
@@ -1,4 +1,4 @@
1
- import type { Logger } from "@prosopo/common";
1
+ import type { Logger } from "@prosopo/logger";
2
2
  import { MongoDatabase } from "./mongo.js";
3
3
  export declare class MongoMemoryDatabase extends MongoDatabase {
4
4
  protected _url: string;