@prosopo/database 3.6.6 → 3.13.8

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 +612 -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,617 @@
1
1
  # @prosopo/database
2
2
 
3
+ ## 3.13.8
4
+ ### Patch Changes
5
+
6
+ - Updated dependencies [b03dad1]
7
+ - @prosopo/types@4.3.1
8
+ - @prosopo/types-database@4.8.1
9
+ - @prosopo/user-access-policy@3.7.12
10
+
11
+ ## 3.13.7
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [a1d60db]
15
+ - Updated dependencies [2392aaf]
16
+ - Updated dependencies [97cf7bd]
17
+ - Updated dependencies [6ca1125]
18
+ - Updated dependencies [32a591b]
19
+ - @prosopo/types@4.3.0
20
+ - @prosopo/types-database@4.8.0
21
+ - @prosopo/logger@1.0.2
22
+ - @prosopo/util@3.2.15
23
+ - @prosopo/common@3.1.38
24
+ - @prosopo/user-access-policy@3.7.11
25
+ - @prosopo/redis-client@1.0.23
26
+
27
+ ## 3.13.6
28
+ ### Patch Changes
29
+
30
+ - Updated dependencies [6c26669]
31
+ - Updated dependencies [f7f9ec5]
32
+ - @prosopo/types@4.2.1
33
+ - @prosopo/types-database@4.7.8
34
+ - @prosopo/user-access-policy@3.7.10
35
+
36
+ ## 3.13.5
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/redis-client@1.0.22
44
+ - @prosopo/types-database@4.7.7
45
+ - @prosopo/user-access-policy@3.7.9
46
+
47
+ ## 3.13.4
48
+ ### Patch Changes
49
+
50
+ - b2e1a5d: fix(database/provider): don't flag image-captcha placeholder records as `pendingStage`
51
+
52
+ #2596 set `pendingStage: true` on every commitment write, including
53
+ `storePendingImageCommitment` which inserts placeholder records with
54
+ `id: ""` while waiting for the user to submit a solution. The sweep
55
+ then picked those up via `pendingStage_partial` (fast) and called
56
+ `markDappUserCommitmentsStored(["", "", ...], ts)` (slow) — Mongo
57
+ dedupes the `$in` array to a single empty-string bound and the
58
+ `IXSCAN { id: -1 }` walks every empty-id document on the node (~102K
59
+ on production). On pronode11 that meant 2–8 s per sweep cycle of
60
+ unnecessary index scan on `usercommitments`, replacing the old
61
+ WT-cache-thrash with a different one.
62
+
63
+ Two-part fix:
64
+
65
+ - `storePendingImageCommitment` no longer sets `pendingStage`. The
66
+ real commitment record only gets the flag once `approve` /
67
+ `disapprove` runs, at which point `id` is populated and staging is
68
+ meaningful.
69
+ - `storeCommitmentsExternal` defensively skips any batch entry whose
70
+ `id` is empty before calling `markDappUserCommitmentsStored`, so a
71
+ stray placeholder slipping into the partial index can never
72
+ re-introduce the bug.
73
+
74
+ For nodes already running #2596, the existing flagged placeholders
75
+ need clearing once (otherwise they sit at `pendingStage: true`
76
+ forever, since `markDappUserCommitmentsStored`'s
77
+ `lastUpdatedTimestamp <= ts` guard never matches them after their
78
+ last update). One-shot per node:
79
+
80
+ ```js
81
+ db.usercommitments.updateMany(
82
+ { pendingStage: true, id: "" },
83
+ { $unset: { pendingStage: 1 } }
84
+ );
85
+ ```
86
+ - Updated dependencies [cdbc5ed]
87
+ - Updated dependencies [4d9923e]
88
+ - Updated dependencies [20cae63]
89
+ - Updated dependencies [4d9923e]
90
+ - @prosopo/types-database@4.7.6
91
+ - @prosopo/types@4.2.0
92
+ - @prosopo/user-access-policy@3.7.8
93
+
94
+ ## 3.13.3
95
+ ### Patch Changes
96
+
97
+ - d351362: fix: replace `$or + $expr` unstored-records sweep with a `pendingStage` sentinel
98
+
99
+ The `StoreCommitmentsExternal` background job fetches "records that still
100
+ need to be shipped to the central DB" via
101
+ `{ $or: [ { storedAtTimestamp: { $exists: false } }, { $expr: { $lt: [$storedAtTimestamp, $lastUpdatedTimestamp] } } ] }`.
102
+ `$expr` is unindexable (per-doc computation) and combined with `$or`
103
+ defeats the planner entirely — production was running this every sweep
104
+ as a `IXSCAN { _id: 1 }` collection scan, examining ~673K powcaptcha
105
+ docs, ~240K usercommitments docs, and ~60K sessions docs per pass. On
106
+ the worst-affected nodes this thrashed the WiredTiger cache (10h of
107
+ cumulative app-thread blocking on disk reads in 43h of uptime) and made
108
+ every other Mongo lookup (including the frictionless session dedup
109
+ queries) slow by eviction — manifesting as traffic-correlated provider
110
+ latency starting 2026-05-26.
111
+
112
+ Replace the query semantics with a `pendingStage: true` sentinel:
113
+
114
+ - New optional `pendingStage` field on `StoredCaptcha` and `Session`
115
+ (Zod + TS + Mongoose schemas).
116
+ - New tiny partial index per collection:
117
+ `{ pendingStage: 1 }` with `partialFilterExpression: { pendingStage: true }`.
118
+ Indexes only the rows that need staging — typically a tiny rolling set,
119
+ ~20 KB for a 700K-row collection with 100 pending rows in local tests.
120
+ - Write paths (`storeXxx`, `updateXxx`, `markXxxChecked`, approve /
121
+ disapprove, `checkAndRemoveSession`, `recordSessionSimdReadingsIfAbsent`,
122
+ `storePendingImageCommitment`) set `pendingStage: true` alongside the
123
+ existing `lastUpdatedTimestamp` bump.
124
+ - `markXxxStored` and the per-record streamer mark-stored callbacks
125
+ `$unset: { pendingStage: 1 }` alongside the `storedAtTimestamp` write,
126
+ guarded by `lastUpdatedTimestamp: { $lte: ts }` so an in-flight update
127
+ doesn't get its pending flag cleared by an older stage completion.
128
+ - `markXxxStored` bulk methods accept an `asOfTimestamp` argument; the
129
+ sweep passes the time it fetched the batch so the guard is correct
130
+ across the full ship-then-mark round trip.
131
+ - `getUnstoredXxx` queries become `{ pendingStage: true }` sorted by
132
+ `_id` — uses the new partial index, examines only pending docs.
133
+
134
+ Local verification on a 700,100-doc test collection: old query ~549 ms
135
+ examining 700,100 docs; new query 0 ms examining 100 docs. Index storage
136
+ ~20 KB.
137
+ - Updated dependencies [d351362]
138
+ - @prosopo/types@4.1.4
139
+ - @prosopo/types-database@4.7.5
140
+ - @prosopo/user-access-policy@3.7.7
141
+
142
+ ## 3.13.2
143
+ ### Patch Changes
144
+
145
+ - Updated dependencies [6567ce0]
146
+ - Updated dependencies [e2711ae]
147
+ - Updated dependencies [5786629]
148
+ - Updated dependencies [7e8cbb7]
149
+ - @prosopo/util@3.2.14
150
+ - @prosopo/types@4.1.3
151
+ - @prosopo/types-database@4.7.4
152
+ - @prosopo/user-access-policy@3.7.6
153
+ - @prosopo/common@3.1.36
154
+ - @prosopo/redis-client@1.0.21
155
+
156
+ ## 3.13.1
157
+ ### Patch Changes
158
+
159
+ - Updated dependencies [72a1218]
160
+ - @prosopo/util@3.2.13
161
+ - @prosopo/types@4.1.2
162
+ - @prosopo/user-access-policy@3.7.5
163
+ - @prosopo/types-database@4.7.3
164
+
165
+ ## 3.13.0
166
+ ### Minor Changes
167
+
168
+ - 91958da: Puzzle captcha + maintenance mode hardening, plus a refactor of the
169
+ frictionless handler into focused modules.
170
+
171
+ - **Puzzle captcha now records checkbox-click coordinates like POW.** Adds an
172
+ optional `salt` field to `SubmitPuzzleCaptchaSolutionBody`; the puzzle
173
+ widget hashes the click coords into the salt and the server decodes them
174
+ into the puzzle record's `coords` field on submit. New `start(x, y)`
175
+ parameters on `procaptcha-puzzle` Manager + widget.
176
+ - **Fix puzzle "No session found" caused by stale Redis dedup.** The
177
+ `/frictionless` dedup path is now Mongo-authoritative — Redis is no
178
+ longer consulted as a session source. A concurrent `/captcha/{type}`
179
+ invalidation could previously race a fire-and-forget Redis repopulation
180
+ in the `/frictionless` dedup branch, leaving Redis pointing at a
181
+ Mongo-deleted session for the full 1-hour TTL. Stale pointers are now
182
+ evicted lazily.
183
+ - **Maintenance mode operates without MongoDB.** `/frictionless` and
184
+ `/captcha/{pow,puzzle}` short-circuit to dummy responses before any DB
185
+ call, and `Environment.isReady()` tolerates a Mongo connect failure when
186
+ `MAINTENANCE_MODE=true` so the provider can start with Mongo down.
187
+ - **Refactor `getFrictionlessCaptchaChallenge.ts` into focused modules** under
188
+ `getFrictionlessCaptchaChallenge/` (handler, sessionDedup, shortCircuit,
189
+ accessPolicy, decisionMachine, decryptSimdReadings, constants). Original
190
+ import path preserved via a re-export shim.
191
+ - **Move `RedisWriteQueue` from `@prosopo/provider` to `@prosopo/database`**
192
+ (where the Redis connection itself lives), and clear residual Redis
193
+ session keys at provider startup via `Environment.cleanup()` so a
194
+ previously-crashed run can't leak stale dedup pointers.
195
+ - Adds puzzle-type branch to access-policy handling in `/frictionless`.
196
+
197
+ ### Patch Changes
198
+
199
+ - Updated dependencies [91958da]
200
+ - @prosopo/types@4.1.1
201
+ - @prosopo/common@3.1.35
202
+ - @prosopo/types-database@4.7.2
203
+ - @prosopo/user-access-policy@3.7.4
204
+ - @prosopo/redis-client@1.0.20
205
+
206
+ ## 3.12.1
207
+ ### Patch Changes
208
+
209
+ - 6a741ce: Move `FrictionlessReason` into `@prosopo/types` and add a new
210
+ `ResultReason` enum covering the values previously inlined as string
211
+ literals on `result.reason` (API.CAPTCHA_PASSED, API.VPN_BLOCKED,
212
+ EMAIL_INVALID, etc.). Provider task code now references the enums so the
213
+ canonical list of selection/result reasons lives in one place and can be
214
+ imported by non-server packages (portal, audit tooling) without pulling
215
+ in `@prosopo/provider`. The previous `FrictionlessReason` export from
216
+ `@prosopo/provider` is preserved as a re-export for backwards
217
+ compatibility.
218
+
219
+ `CaptchaResult.reason`, `StoredCaptcha.result.reason`, `Session.result.reason`
220
+ are now typed `ResultReason | undefined`; `Session.reason` is typed
221
+ `FrictionlessReason | undefined`. The runtime zod schema stays permissive
222
+ (`string().optional().transform(v => v as ResultReason | undefined)`) so
223
+ operator-authored decision-machine output and old MongoDB records still
224
+ parse without throwing; the strict enum is preserved on the TS surface
225
+ via the transform.
226
+ - Updated dependencies [6a741ce]
227
+ - @prosopo/types@4.1.0
228
+ - @prosopo/types-database@4.7.1
229
+ - @prosopo/user-access-policy@3.7.3
230
+
231
+ ## 3.12.0
232
+ ### Minor Changes
233
+
234
+ - d865319: Add puzzle captcha (drag-to-target challenge) as a new captcha type:
235
+ provider endpoints, manager + widget package, types, demo pages, and
236
+ a `puzzleTolerance` site setting.
237
+
238
+ ### Patch Changes
239
+
240
+ - f9ea09d: Stop re-looking up the IP in `checkTrafficFilter` — read `record.ipInfo` instead
241
+
242
+ 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.
243
+
244
+ - `checkTrafficFilter(ip, trafficFilter, ipInfoService, logger)` → `checkTrafficFilter(ipInfo, trafficFilter)`.
245
+ - `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.
246
+ - 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.
247
+
248
+ Paired with [captcha-private#3339](https://github.com/prosopo/captcha-private/pull/3339).
249
+ - f9ea09d: Drop flat ipinfo fields (`vpn`, `countryCode`, `tor`, `proxy`, `datacenter`, `abuser`, `geolocation`) from captcha records — persist the full `IPInfoResponse` payload as `ipInfo` instead
250
+
251
+ 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.
252
+
253
+ - `StoredCaptcha` interface: removed `vpn`, `countryCode`, `geolocation`. Keeps `ipInfo?: IPInfoResponse`.
254
+ - `PoWCaptchaStoredSchema` zod validator: same removals, adds `ipInfo` (validated as `any()` since `IPInfoResponse` is a discriminated union narrowed at read time).
255
+ - 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 }`.
256
+ - `IProviderDatabase` interface: `storePowCaptchaRecord` / `storePuzzleCaptchaRecord` / `storePendingImageCommitment` now take `ipInfo?: IPInfoResponse` in place of `countryCode?: string`.
257
+ - 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.
258
+ - 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.
259
+ - Lean projections in `provider.ts` switched from `countryCode: 1` to `ipInfo: 1`.
260
+
261
+ 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.
262
+ - 4aae4e6: Plumb the WASM SIMD CPU fingerprint readings (collected by the catcher
263
+ client per https://blog.azerpas.com/writing/wasm-simd-fingerprinting/)
264
+ through the captcha flow and onto the linked `Session` record.
265
+ Collection-only — no scoring or classification yet.
266
+
267
+ The readings are sent at the earliest moment they're available so the
268
+ signal lands on the session as soon as possible:
269
+
270
+ 1. **Captcha-challenge GET** (PoW / Puzzle / Image) — the procaptcha
271
+ Manager calls `frictionlessState.getSimdReadings(0)` (non-blocking
272
+ cache check) and attaches it to the challenge-request body. The
273
+ provider handler decodes and patches the linked session via
274
+ `updateSessionRecord`.
275
+ 2. **Solution submission** (PoW / Puzzle / Image) — same non-blocking
276
+ check on the submit body. Acts as a backup if the benchmark wasn't
277
+ ready in time for the challenge GET.
278
+
279
+ Frictionless init itself stays SIMD-free (benchmark is too slow to gate
280
+ the first hop).
281
+
282
+ Surface area:
283
+
284
+ - `SimdReadings` discriminated union + `SimdOpReadingRecord` /
285
+ `SimdOpCategory` in `@prosopo/types`, plus `simdReadingsCodec` shared
286
+ encode/decode helpers so the browser SDK and the provider use the same
287
+ pipe-safe wire format.
288
+ - Optional `simdReadings: string()` on `CaptchaRequestBody`,
289
+ `GetPowCaptchaChallengeRequestBody`, `GetPuzzleCaptchaChallengeRequestBody`,
290
+ `CaptchaSolutionBody`, `SubmitPowCaptchaSolutionBody`, and
291
+ `SubmitPuzzleCaptchaSolutionBody`.
292
+ - `FrictionlessState.getSimdReadings` + `BotDetectionFunctionResult.getSimdReadings`
293
+ so the catcher's prefetched benchmark is consumed at the request sites.
294
+ - `ProcaptchaApiInterface.{getCaptchaChallenge, submitCaptchaSolution}` and
295
+ the `ProviderApi.{getCaptchaChallenge, getPowCaptchaChallenge, getPuzzleCaptchaChallenge,
296
+ submitCaptchaSolution, submitPowCaptchaSolution, submitPuzzleCaptchaSolution}`
297
+ client methods accept the field.
298
+ - Provider challenge + solution handlers decode via `decodeSimdReadings`
299
+ and `updateSessionRecord` (Mongoose `Mixed`, Zod discriminated-union
300
+ validation at the edge). The challenge-GET patch is fire-and-forget.
301
+
302
+ Backward-compatible: older catcher clients omit the field at every layer;
303
+ the session record omits it in turn.
304
+ - Updated dependencies [3c0be68]
305
+ - Updated dependencies [f9ea09d]
306
+ - Updated dependencies [4aae4e6]
307
+ - Updated dependencies [d865319]
308
+ - Updated dependencies [753304b]
309
+ - Updated dependencies [8bb7286]
310
+ - Updated dependencies [f9ea09d]
311
+ - Updated dependencies [4aae4e6]
312
+ - Updated dependencies [4993813]
313
+ - Updated dependencies [72a0483]
314
+ - @prosopo/types@4.0.0
315
+ - @prosopo/types-database@4.7.0
316
+ - @prosopo/locale@3.2.2
317
+ - @prosopo/util@3.2.12
318
+ - @prosopo/common@3.1.34
319
+ - @prosopo/user-access-policy@3.7.2
320
+ - @prosopo/redis-client@1.0.19
321
+
322
+ ## 3.11.0
323
+ ### Minor Changes
324
+
325
+ - 33a6c57: Provider speed ups
326
+
327
+ ### Patch Changes
328
+
329
+ - Updated dependencies [819ed95]
330
+ - @prosopo/types-database@4.6.2
331
+ - @prosopo/types@3.16.1
332
+ - @prosopo/user-access-policy@3.7.1
333
+
334
+ ## 3.10.2
335
+ ### Patch Changes
336
+
337
+ - Updated dependencies [60ba3b1]
338
+ - @prosopo/user-access-policy@3.7.0
339
+ - @prosopo/types-database@4.6.1
340
+
341
+ ## 3.10.1
342
+ ### Patch Changes
343
+
344
+ - 942701b: Connection drop fix
345
+
346
+ ## 3.10.0
347
+ ### Minor Changes
348
+
349
+ - 74092d0: Stream data back to central for decisions
350
+
351
+ ### Patch Changes
352
+
353
+ - Updated dependencies [74092d0]
354
+ - @prosopo/types-database@4.6.0
355
+
356
+ ## 3.9.18
357
+ ### Patch Changes
358
+
359
+ - f6a4402: API endpoint for removing site keys
360
+ - Updated dependencies [f6a4402]
361
+ - Updated dependencies [99dfb44]
362
+ - @prosopo/types-database@4.5.3
363
+ - @prosopo/types@3.16.0
364
+ - @prosopo/user-access-policy@3.6.24
365
+
366
+ ## 3.9.17
367
+ ### Patch Changes
368
+
369
+ - Updated dependencies [3e54c0a]
370
+ - @prosopo/types@3.15.0
371
+ - @prosopo/types-database@4.5.2
372
+ - @prosopo/user-access-policy@3.6.23
373
+
374
+ ## 3.9.16
375
+ ### Patch Changes
376
+
377
+ - Updated dependencies [946a8ba]
378
+ - Updated dependencies [5614814]
379
+ - Updated dependencies [b94890c]
380
+ - @prosopo/types-database@4.5.1
381
+ - @prosopo/types@3.14.1
382
+ - @prosopo/locale@3.2.1
383
+ - @prosopo/common@3.1.33
384
+ - @prosopo/user-access-policy@3.6.22
385
+ - @prosopo/redis-client@1.0.18
386
+
387
+ ## 3.9.15
388
+ ### Patch Changes
389
+
390
+ - Updated dependencies [fc514dd]
391
+ - Updated dependencies [42650db]
392
+ - @prosopo/types-database@4.5.0
393
+ - @prosopo/locale@3.2.0
394
+ - @prosopo/types@3.14.0
395
+ - @prosopo/common@3.1.32
396
+ - @prosopo/user-access-policy@3.6.21
397
+ - @prosopo/redis-client@1.0.17
398
+
399
+ ## 3.9.14
400
+ ### Patch Changes
401
+
402
+ - Updated dependencies [4a9c518]
403
+ - @prosopo/common@3.1.31
404
+ - @prosopo/redis-client@1.0.16
405
+ - @prosopo/types-database@4.4.14
406
+ - @prosopo/user-access-policy@3.6.20
407
+
408
+ ## 3.9.13
409
+ ### Patch Changes
410
+
411
+ - Updated dependencies [a25dffa]
412
+ - @prosopo/util@3.2.11
413
+ - @prosopo/types@3.13.3
414
+ - @prosopo/user-access-policy@3.6.19
415
+ - @prosopo/types-database@4.4.13
416
+
417
+ ## 3.9.12
418
+ ### Patch Changes
419
+
420
+ - Updated dependencies [346edd7]
421
+ - @prosopo/util@3.2.10
422
+ - @prosopo/types@3.13.2
423
+ - @prosopo/user-access-policy@3.6.18
424
+ - @prosopo/types-database@4.4.12
425
+
426
+ ## 3.9.11
427
+ ### Patch Changes
428
+
429
+ - Updated dependencies [22bfee7]
430
+ - @prosopo/util@3.2.9
431
+ - @prosopo/types@3.13.1
432
+ - @prosopo/user-access-policy@3.6.17
433
+ - @prosopo/types-database@4.4.11
434
+
435
+ ## 3.9.10
436
+ ### Patch Changes
437
+
438
+ - Updated dependencies [e0fb3d6]
439
+ - Updated dependencies [e6d9553]
440
+ - Updated dependencies [f3f23e3]
441
+ - @prosopo/util@3.2.8
442
+ - @prosopo/types@3.13.0
443
+ - @prosopo/user-access-policy@3.6.16
444
+ - @prosopo/types-database@4.4.10
445
+
446
+ ## 3.9.9
447
+ ### Patch Changes
448
+
449
+ - e1ea65f: Better spam email domain checking
450
+ - c316257: Adding sync fo sessions wrt captcha status
451
+ - Updated dependencies [d5082a9]
452
+ - Updated dependencies [e1ea65f]
453
+ - Updated dependencies [c316257]
454
+ - @prosopo/types@3.12.3
455
+ - @prosopo/types-database@4.4.9
456
+ - @prosopo/util@3.2.7
457
+ - @prosopo/user-access-policy@3.6.15
458
+
459
+ ## 3.9.8
460
+ ### Patch Changes
461
+
462
+ - adb89a6: Disposable email checking
463
+ - Updated dependencies [adb89a6]
464
+ - @prosopo/types-database@4.4.8
465
+ - @prosopo/locale@3.1.29
466
+ - @prosopo/types@3.12.2
467
+ - @prosopo/common@3.1.30
468
+ - @prosopo/user-access-policy@3.6.14
469
+ - @prosopo/redis-client@1.0.15
470
+
471
+ ## 3.9.7
472
+ ### Patch Changes
473
+
474
+ - Updated dependencies [c5ee492]
475
+ - Updated dependencies [a90eb54]
476
+ - @prosopo/common@3.1.29
477
+ - @prosopo/types-database@4.4.7
478
+ - @prosopo/types@3.12.1
479
+ - @prosopo/redis-client@1.0.14
480
+ - @prosopo/user-access-policy@3.6.13
481
+
482
+ ## 3.9.6
483
+ ### Patch Changes
484
+
485
+ - Updated dependencies [676c5f2]
486
+ - Updated dependencies [feaca02]
487
+ - @prosopo/types@3.12.0
488
+ - @prosopo/types-database@4.4.6
489
+ - @prosopo/user-access-policy@3.6.12
490
+
491
+ ## 3.9.5
492
+ ### Patch Changes
493
+
494
+ - Updated dependencies [8148587]
495
+ - @prosopo/types-database@4.4.5
496
+ - @prosopo/types@3.11.1
497
+ - @prosopo/user-access-policy@3.6.11
498
+
499
+ ## 3.9.4
500
+ ### Patch Changes
501
+
502
+ - Updated dependencies [90033e9]
503
+ - @prosopo/types-database@4.4.4
504
+
505
+ ## 3.9.3
506
+ ### Patch Changes
507
+
508
+ - Updated dependencies [7f6ffc5]
509
+ - @prosopo/types@3.11.0
510
+ - @prosopo/types-database@4.4.3
511
+ - @prosopo/user-access-policy@3.6.10
512
+
513
+ ## 3.9.2
514
+ ### Patch Changes
515
+
516
+ - 93fa086: Add decision engine endpoints
517
+ - Updated dependencies [93fa086]
518
+ - @prosopo/types-database@4.4.2
519
+ - @prosopo/types@3.10.2
520
+ - @prosopo/user-access-policy@3.6.9
521
+
522
+ ## 3.9.1
523
+ ### Patch Changes
524
+
525
+ - Updated dependencies [cde7550]
526
+ - @prosopo/types-database@4.4.1
527
+ - @prosopo/types@3.10.1
528
+ - @prosopo/user-access-policy@3.6.8
529
+
530
+ ## 3.9.0
531
+ ### Minor Changes
532
+
533
+ - ad6d622: Separate types from mongoose schemas to avoid bundling mongoose in frontend
534
+
535
+ ### Patch Changes
536
+
537
+ - ced9f41: Fix incorrect projection
538
+ - fa95c5f: zod types for db records
539
+ - Updated dependencies [ad6d622]
540
+ - Updated dependencies [fa95c5f]
541
+ - @prosopo/types-database@4.4.0
542
+ - @prosopo/types@3.10.0
543
+ - @prosopo/user-access-policy@3.6.7
544
+
545
+ ## 3.8.0
546
+ ### Minor Changes
547
+
548
+ - d329e63: Use projections to speed up queries
549
+
550
+ ### Patch Changes
551
+
552
+ - Updated dependencies [ff58a70]
553
+ - @prosopo/types@3.9.0
554
+ - @prosopo/types-database@4.3.1
555
+ - @prosopo/user-access-policy@3.6.6
556
+
557
+ ## 3.7.0
558
+ ### Minor Changes
559
+
560
+ - 3feeea4: Store geolocation. Remove pending image captcha collection
561
+
562
+ ### Patch Changes
563
+
564
+ - Updated dependencies [3feeea4]
565
+ - @prosopo/types-database@4.3.0
566
+
567
+ ## 3.6.12
568
+ ### Patch Changes
569
+
570
+ - Updated dependencies [4c08158]
571
+ - Updated dependencies [d2431cd]
572
+ - @prosopo/types-database@4.2.4
573
+ - @prosopo/types@3.8.4
574
+ - @prosopo/user-access-policy@3.6.5
575
+
576
+ ## 3.6.11
577
+ ### Patch Changes
578
+
579
+ - Updated dependencies [8dad7f3]
580
+ - @prosopo/types-database@4.2.3
581
+
582
+ ## 3.6.10
583
+ ### Patch Changes
584
+
585
+ - Updated dependencies [bd6995b]
586
+ - @prosopo/user-access-policy@3.6.4
587
+ - @prosopo/types@3.8.3
588
+ - @prosopo/types-database@4.2.2
589
+
590
+ ## 3.6.9
591
+ ### Patch Changes
592
+
593
+ - Updated dependencies [9633e58]
594
+ - @prosopo/types-database@4.2.1
595
+ - @prosopo/types@3.8.2
596
+ - @prosopo/user-access-policy@3.6.3
597
+
598
+ ## 3.6.8
599
+ ### Patch Changes
600
+
601
+ - f52a5c1: Adding decision machine to provider for behavior detection
602
+ - Updated dependencies [f52a5c1]
603
+ - Updated dependencies [4299cae]
604
+ - @prosopo/types-database@4.2.0
605
+ - @prosopo/types@3.8.1
606
+ - @prosopo/user-access-policy@3.6.2
607
+
608
+ ## 3.6.7
609
+ ### Patch Changes
610
+
611
+ - Updated dependencies [ed87b6f]
612
+ - @prosopo/user-access-policy@3.6.1
613
+ - @prosopo/types-database@4.1.6
614
+
3
615
  ## 3.6.6
4
616
  ### Patch Changes
5
617
 
@@ -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,E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AAC,CAAC;gBACL,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC;YAEH,OAAO,IAAI,CAAC,UAAU,CAAC;QACxB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,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;