@prosopo/types-database 5.3.3 → 5.4.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.
- package/.turbo/turbo-build$colon$cjs.log +11 -12
- package/.turbo/turbo-build$colon$tsc.log +15 -15
- package/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +115 -0
- package/dist/cjs/types/client.cjs +5 -21
- package/dist/cjs/types/provider.cjs +25 -0
- package/dist/types/bannedDomain.d.ts +25 -6
- package/dist/types/bannedDomain.d.ts.map +1 -1
- package/dist/types/captcha.d.ts +2 -2
- package/dist/types/captcha.d.ts.map +1 -1
- package/dist/types/captcha.js.map +1 -1
- package/dist/types/client.d.ts +482 -30
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/client.js +7 -21
- package/dist/types/client.js.map +1 -1
- package/dist/types/provider.d.ts +2585 -76
- package/dist/types/provider.d.ts.map +1 -1
- package/dist/types/provider.js +25 -0
- package/dist/types/provider.js.map +1 -1
- package/dist/types/schemas.test.js +1 -6
- package/dist/types/schemas.test.js.map +1 -1
- package/dist/types/spamEmailDomain.d.ts +25 -6
- package/dist/types/spamEmailDomain.d.ts.map +1 -1
- package/package.json +11 -11
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +0 -23
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/types-database@5.
|
|
2
|
+
> @prosopo/types-database@5.4.0 build:cjs
|
|
3
3
|
> NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
|
|
4
4
|
|
|
5
5
|
ViteCommonJSConfig: .
|
|
@@ -38,15 +38,14 @@ Bundle build started
|
|
|
38
38
|
✓ 10 modules transformed.
|
|
39
39
|
rendering chunks...
|
|
40
40
|
computing gzip size...
|
|
41
|
-
dist/cjs/types/mongo.cjs
|
|
42
|
-
dist/cjs/types/userAgent.cjs
|
|
43
|
-
dist/cjs/types/bannedDomain.cjs
|
|
44
|
-
dist/cjs/types/spamEmailDomain.cjs
|
|
45
|
-
dist/cjs/types/captcha.cjs
|
|
46
|
-
dist/cjs/
|
|
47
|
-
dist/cjs/
|
|
48
|
-
dist/cjs/
|
|
49
|
-
dist/cjs/types/
|
|
50
|
-
dist/cjs/types/provider.cjs 28.61 kB │ gzip: 4.50 kB
|
|
41
|
+
dist/cjs/types/mongo.cjs 0.00 kB │ gzip: 0.02 kB
|
|
42
|
+
dist/cjs/types/userAgent.cjs 0.00 kB │ gzip: 0.02 kB
|
|
43
|
+
dist/cjs/types/bannedDomain.cjs 0.23 kB │ gzip: 0.16 kB
|
|
44
|
+
dist/cjs/types/spamEmailDomain.cjs 0.25 kB │ gzip: 0.17 kB
|
|
45
|
+
dist/cjs/types/captcha.cjs 0.99 kB │ gzip: 0.27 kB
|
|
46
|
+
dist/cjs/types/index.cjs 2.42 kB │ gzip: 0.48 kB
|
|
47
|
+
dist/cjs/index.cjs 2.52 kB │ gzip: 0.53 kB
|
|
48
|
+
dist/cjs/types/client.cjs 6.94 kB │ gzip: 1.52 kB
|
|
49
|
+
dist/cjs/types/provider.cjs 28.98 kB │ gzip: 4.55 kB
|
|
51
50
|
|
|
52
|
-
[32m✓ built in
|
|
51
|
+
[32m✓ built in 67ms[39m
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/types-database@5.
|
|
2
|
+
> @prosopo/types-database@5.4.0 build:tsc
|
|
3
3
|
> tsc --build --verbose
|
|
4
4
|
|
|
5
|
-
10:
|
|
5
|
+
10:39:37 PM - Projects in this build:
|
|
6
6
|
* ../../dev/config/tsconfig.json
|
|
7
7
|
* ../locale/tsconfig.json
|
|
8
8
|
* ../util/tsconfig.json
|
|
@@ -16,29 +16,29 @@
|
|
|
16
16
|
* ../user-access-policy/tsconfig.json
|
|
17
17
|
* tsconfig.json
|
|
18
18
|
|
|
19
|
-
10:
|
|
19
|
+
10:39:37 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/vite/NodejsPolarsNativeFilePlugin.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
|
|
20
20
|
|
|
21
|
-
10:
|
|
21
|
+
10:39:37 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
|
|
22
22
|
|
|
23
|
-
10:
|
|
23
|
+
10:39:37 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
|
|
24
24
|
|
|
25
|
-
10:
|
|
25
|
+
10:39:37 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/logger.ts' is older than output '../logger/tsconfig.tsbuildinfo'
|
|
26
26
|
|
|
27
|
-
10:
|
|
27
|
+
10:39:37 PM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/tsconfig.tsbuildinfo'
|
|
28
28
|
|
|
29
|
-
10:
|
|
29
|
+
10:39:37 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/types.test-d.ts' is older than output '../types/tsconfig.tsbuildinfo'
|
|
30
30
|
|
|
31
|
-
10:
|
|
31
|
+
10:39:37 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/tests/utils/batches.unit.test.ts' is older than output '../common/tsconfig.tsbuildinfo'
|
|
32
32
|
|
|
33
|
-
10:
|
|
33
|
+
10:39:37 PM - Project '../api-route/tsconfig.json' is up to date because newest input '../api-route/src/index.ts' is older than output '../api-route/tsconfig.tsbuildinfo'
|
|
34
34
|
|
|
35
|
-
10:
|
|
35
|
+
10:39:37 PM - Project '../redis-client/tsconfig.json' is up to date because newest input '../redis-client/src/index.ts' is older than output '../redis-client/tsconfig.tsbuildinfo'
|
|
36
36
|
|
|
37
|
-
10:
|
|
37
|
+
10:39:37 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/tests/apiHarness.ts' is older than output '../api/tsconfig.tsbuildinfo'
|
|
38
38
|
|
|
39
|
-
10:
|
|
39
|
+
10:39:37 PM - Project '../user-access-policy/tsconfig.json' is up to date because newest input '../user-access-policy/src/ruleRecord.ts' is older than output '../user-access-policy/tsconfig.tsbuildinfo'
|
|
40
40
|
|
|
41
|
-
10:
|
|
41
|
+
10:39:37 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
|
|
42
42
|
|
|
43
|
-
10:
|
|
43
|
+
10:39:37 PM - Building project '/home/runner/work/captcha/captcha/packages/types-database/tsconfig.json'...
|
|
44
44
|
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/types-database@5.
|
|
2
|
+
> @prosopo/types-database@5.4.0 build
|
|
3
3
|
> npm run build:cross-env -- --mode ${NODE_ENV:-development}
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @prosopo/types-database@5.
|
|
6
|
+
> @prosopo/types-database@5.4.0 build:cross-env
|
|
7
7
|
> vite build --config vite.esm.config.ts --mode production
|
|
8
8
|
|
|
9
9
|
ViteEsmConfig: .
|
|
@@ -50,7 +50,7 @@ dist/types/spamEmailDomain.js 0.23 kB │ gzip: 0.17 kB
|
|
|
50
50
|
dist/types/captcha.js 0.82 kB │ gzip: 0.25 kB
|
|
51
51
|
dist/types/index.js 1.60 kB │ gzip: 0.38 kB
|
|
52
52
|
dist/index.js 1.67 kB │ gzip: 0.40 kB
|
|
53
|
-
dist/types/client.js
|
|
54
|
-
dist/types/provider.js 27.
|
|
53
|
+
dist/types/client.js 6.79 kB │ gzip: 1.56 kB
|
|
54
|
+
dist/types/provider.js 27.83 kB │ gzip: 4.52 kB
|
|
55
55
|
|
|
56
|
-
[32m✓ built in
|
|
56
|
+
[32m✓ built in 169ms[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,120 @@
|
|
|
1
1
|
# @prosopo/types-database
|
|
2
2
|
|
|
3
|
+
## 5.4.0
|
|
4
|
+
### Minor Changes
|
|
5
|
+
|
|
6
|
+
- 8a670d3: Remove the provider-side context validation path.
|
|
7
|
+
|
|
8
|
+
The provider read a per-context baseline out of `clientcontextentropies` on the frictionless path and compared a session's head hash against it. The task that wrote that collection was removed from the provider on 2026-08-21, so the read has returned `undefined` ever since and the branch has been dead in every deployment since then. Computing and applying the baseline now happens off-provider.
|
|
9
|
+
|
|
10
|
+
Removed: `contextAwareValidation.ts`, the decision-machine branch that used it, `getClientContextEntropy` on the provider and its database method, the `clientContextEntropy` table registration, the unused `getRoundsFromSimScore` helper, and the `contextAwareEnabled` parameter threaded into image verification — which logged and then did nothing, its return commented out.
|
|
11
|
+
|
|
12
|
+
Also removes the per-site `settings.contextAware` block that configured it, along with `ContextAwareSchema`, `IContextAware`, `IContexts`, `ContextConfigSchema`, `contextAwareThresholdDefault` and `expandContexts`, the legacy `default`/`webview` context keys and their helpers, and `FrictionlessReason.CONTEXT_AWARE_VALIDATION_FAILED`. The site-key registration CLI no longer writes a `contextAware` default into new sites.
|
|
13
|
+
|
|
14
|
+
`ContextType`, `contextTypeFromSession` and `deviceContextTypes` stay — the off-provider work keys on them. `ClientContextEntropyRecord` and its schema stay for the same reason; only the provider's use of them goes.
|
|
15
|
+
|
|
16
|
+
No behaviour change: every path removed here was already inert.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 89dd38a: chore(deps): batch the outstanding dependabot bumps into one upgrade
|
|
21
|
+
|
|
22
|
+
Rolls up dependabot PRs #3112, #3127-#3134 and #3159. Majors: `mongoose`
|
|
23
|
+
8 -> 9, `bson` 6 -> 7, `@noble/curves` 1 -> 2, `@polkadot/util-crypto`
|
|
24
|
+
13 -> 14, `@typegoose/auto-increment` 4 -> 5, `@babel/preset-env` 7 -> 8,
|
|
25
|
+
`@types/jsdom` 21 -> 30, `@types/bcrypt` 5 -> 6, `@actions/github` 6 -> 9,
|
|
26
|
+
`testcontainers` 11 -> 12. The rest are minor/patch.
|
|
27
|
+
|
|
28
|
+
Code changes the majors forced:
|
|
29
|
+
- `@noble/curves` v2 requires `.js` specifiers and renamed the point API,
|
|
30
|
+
so `secp256k1.ProjectivePoint.fromHex(...).toRawBytes()` becomes
|
|
31
|
+
`secp256k1.Point.fromBytes(...).toBytes()`, `RistrettoPoint` becomes
|
|
32
|
+
`ristretto255.Point`, and `abstract/utils` moves to `utils.js`.
|
|
33
|
+
- mongoose 9 drops `RootFilterQuery` (now `QueryFilter`), no longer sets
|
|
34
|
+
`background: true` on schema indexes by default, and no longer declares
|
|
35
|
+
`id` on `Document`, which un-hid a mismatch between
|
|
36
|
+
`updateDappUserCommitment`'s `Hash` parameter and the `string` `id` it
|
|
37
|
+
filters on.
|
|
38
|
+
- mongoose 9 rejects an aggregation-pipeline update (an array) unless the
|
|
39
|
+
call passes `updatePipeline: true`, so the six pipeline writes in
|
|
40
|
+
`ProviderDatabase` now opt in explicitly.
|
|
41
|
+
- mongoose 9's `castUpdate` throws on a `$setOnInsert` key inside `$set`.
|
|
42
|
+
`storeUserImageCaptchaSolution` passed its record straight in as the
|
|
43
|
+
update, and mongoose's `moveImmutableProperties` mutates that object on
|
|
44
|
+
an upsert -- adding the very `$setOnInsert` key the record then carried
|
|
45
|
+
into `CentralDbStreamer.streamImageRecord`. Image records stopped
|
|
46
|
+
reaching the central DB (the streamer is fire-and-forget, so it only
|
|
47
|
+
logged) and signup verification returned 500. The update is now an
|
|
48
|
+
explicit `$set` over a shallow copy.
|
|
49
|
+
- `@prosopo/database` moves from mongodb 6.20 to 7.5 to match the driver
|
|
50
|
+
mongoose 9 pulls, so bson 7 is the only copy resolvable in the package.
|
|
51
|
+
- `vitest`/`@vitest/coverage-v8` go to 4.1.11 alongside dependabot's
|
|
52
|
+
`@vitest/spy` bump; leaving them at 4.1.10 installed a second copy of
|
|
53
|
+
`@vitest/spy` and broke type inference in the provider test utils.
|
|
54
|
+
- Updated dependencies [7fd6eb2]
|
|
55
|
+
- Updated dependencies [89dd38a]
|
|
56
|
+
- Updated dependencies [80f73c1]
|
|
57
|
+
- Updated dependencies [8a670d3]
|
|
58
|
+
- @prosopo/user-access-policy@3.12.33
|
|
59
|
+
- @prosopo/common@3.1.53
|
|
60
|
+
- @prosopo/locale@3.4.1
|
|
61
|
+
- @prosopo/logger@2.0.8
|
|
62
|
+
- @prosopo/types@5.6.0
|
|
63
|
+
|
|
64
|
+
## 5.3.4
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- a62b994: Context-aware validation buckets by device type, not just webview.
|
|
68
|
+
|
|
69
|
+
Context-aware validation compares a session's head SimHash against a baseline
|
|
70
|
+
for its context. That context was `default | webview`, which puts a phone and
|
|
71
|
+
a desktop in the same bucket — and those two emit genuinely different
|
|
72
|
+
`<head>`s, so the blended baseline matches neither well. Contexts are now the
|
|
73
|
+
device family crossed with the webview flag: `desktop`, `desktop-webview`,
|
|
74
|
+
`mobile`, `mobile-webview`, `tablet`, `tablet-webview`.
|
|
75
|
+
|
|
76
|
+
`desktop-webview` is included deliberately. Desktop webviews are a real and
|
|
77
|
+
notably fraudulent population here (see the Twickets desktop-webview rules),
|
|
78
|
+
and folding them into the plain `desktop` baseline would let exactly the
|
|
79
|
+
traffic we want excluded define what "normal desktop" looks like.
|
|
80
|
+
|
|
81
|
+
**Classification.** `deviceTypeFromUserAgent` in `@prosopo/types` is a
|
|
82
|
+
dependency-free UA classifier, deliberately not ua-parser-js: this module is
|
|
83
|
+
imported by the browser bundles, and the off-provider entropy sweep has to
|
|
84
|
+
bucket stored sessions *identically* or it writes baselines the decision
|
|
85
|
+
machine never looks up. One shared function keeps the two sides in lockstep.
|
|
86
|
+
Tablets are matched before phones because an iPad's UA carries a
|
|
87
|
+
`Mobile/<build>` token and an Android tablet is exactly "Android without
|
|
88
|
+
Mobile". Known gap, documented at the call site: an iPadOS 13+ Safari in
|
|
89
|
+
desktop mode identifies as a Mac and lands in `desktop` — nothing in the UA
|
|
90
|
+
separates it from a real Mac, and both sides make the same call, which is
|
|
91
|
+
what matters for the lookup.
|
|
92
|
+
|
|
93
|
+
**Back-compat.** `default` and `webview` remain valid `ContextType` members,
|
|
94
|
+
so settings already stored against them keep parsing. `expandContexts` maps a
|
|
95
|
+
legacy `default` onto the three non-webview families and a legacy `webview`
|
|
96
|
+
onto the three webview families, at the threshold they were saved with; an
|
|
97
|
+
explicit device entry always wins over the legacy entry covering it. Nothing
|
|
98
|
+
downstream of settings parsing branches on the legacy keys, and no data
|
|
99
|
+
migration is required.
|
|
100
|
+
|
|
101
|
+
**Behaviour change.** A request whose context is not configured now skips
|
|
102
|
+
context validation instead of borrowing another context's baseline.
|
|
103
|
+
Previously, configuring a single context validated *every* request against it
|
|
104
|
+
— with six contexts that would measure desktop traffic against a tablet
|
|
105
|
+
baseline and reject real users wholesale. `isContextConfigured` is the new
|
|
106
|
+
guard; `determineContextType` now takes the raw request UA alongside the
|
|
107
|
+
webview flag.
|
|
108
|
+
|
|
109
|
+
New site-key registrations default to all six device contexts.
|
|
110
|
+
- a447afa: Per-sitekey `imageMinRounds` alongside the existing `imageMaxRounds`.
|
|
111
|
+
|
|
112
|
+
Every source of an image round count — access-policy rules, traffic-filter categories, routing machines, the staleness curve, and the provider's own heuristics — is now clamped into `[imageMinRounds, imageMaxRounds]` via `clampImageRounds`, so the sitekey's settings override its rules in both directions rather than only capping them. `imageMinRounds` defaults to 2, matching the floor that was previously hard-coded, so existing sitekeys are unaffected.
|
|
113
|
+
- Updated dependencies [a62b994]
|
|
114
|
+
- Updated dependencies [a447afa]
|
|
115
|
+
- @prosopo/types@5.5.3
|
|
116
|
+
- @prosopo/user-access-policy@3.12.32
|
|
117
|
+
|
|
3
118
|
## 5.3.3
|
|
4
119
|
### Patch Changes
|
|
5
120
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
2
1
|
let _prosopo_types = require("@prosopo/types");
|
|
3
2
|
let mongoose = require("mongoose");
|
|
4
|
-
mongoose = require_runtime.__toESM(mongoose, 1);
|
|
5
3
|
//#region src/types/client.ts
|
|
6
4
|
var IPValidationRulesSchema = new mongoose.Schema({
|
|
7
5
|
enabled: {
|
|
@@ -140,6 +138,11 @@ var UserSettingsSchema = new mongoose.Schema({
|
|
|
140
138
|
default: _prosopo_types.imageMaxRoundsDefault,
|
|
141
139
|
required: false
|
|
142
140
|
},
|
|
141
|
+
imageMinRounds: {
|
|
142
|
+
type: Number,
|
|
143
|
+
default: _prosopo_types.imageMinRoundsDefault,
|
|
144
|
+
required: false
|
|
145
|
+
},
|
|
143
146
|
puzzleTolerance: {
|
|
144
147
|
type: Number,
|
|
145
148
|
required: false
|
|
@@ -153,25 +156,6 @@ var UserSettingsSchema = new mongoose.Schema({
|
|
|
153
156
|
type: Boolean,
|
|
154
157
|
default: false
|
|
155
158
|
},
|
|
156
|
-
contextAware: {
|
|
157
|
-
enabled: {
|
|
158
|
-
type: Boolean,
|
|
159
|
-
default: false
|
|
160
|
-
},
|
|
161
|
-
contexts: {
|
|
162
|
-
type: mongoose.default.Schema.Types.Mixed,
|
|
163
|
-
default: {
|
|
164
|
-
[_prosopo_types.ContextType.Default]: {
|
|
165
|
-
type: _prosopo_types.ContextType.Default,
|
|
166
|
-
threshold: _prosopo_types.contextAwareThresholdDefault
|
|
167
|
-
},
|
|
168
|
-
[_prosopo_types.ContextType.Webview]: {
|
|
169
|
-
type: _prosopo_types.ContextType.Webview,
|
|
170
|
-
threshold: _prosopo_types.contextAwareThresholdDefault
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
159
|
spamEmailDomainCheckEnabled: {
|
|
176
160
|
type: Boolean,
|
|
177
161
|
default: false,
|
|
@@ -1399,6 +1399,31 @@ var ClientContextEntropyRecordSchema = new mongoose.Schema({
|
|
|
1399
1399
|
entropy: {
|
|
1400
1400
|
type: String,
|
|
1401
1401
|
required: true
|
|
1402
|
+
},
|
|
1403
|
+
totalSessions: {
|
|
1404
|
+
type: Number,
|
|
1405
|
+
required: false
|
|
1406
|
+
},
|
|
1407
|
+
distinctHashes: {
|
|
1408
|
+
type: Number,
|
|
1409
|
+
required: false
|
|
1410
|
+
},
|
|
1411
|
+
urls: {
|
|
1412
|
+
type: [new mongoose.Schema({
|
|
1413
|
+
url: {
|
|
1414
|
+
type: String,
|
|
1415
|
+
required: true
|
|
1416
|
+
},
|
|
1417
|
+
sessions: {
|
|
1418
|
+
type: Number,
|
|
1419
|
+
required: true
|
|
1420
|
+
},
|
|
1421
|
+
entropy: {
|
|
1422
|
+
type: String,
|
|
1423
|
+
required: true
|
|
1424
|
+
}
|
|
1425
|
+
}, { _id: false })],
|
|
1426
|
+
required: false
|
|
1402
1427
|
}
|
|
1403
1428
|
}, { timestamps: {
|
|
1404
1429
|
createdAt: true,
|
|
@@ -3,13 +3,32 @@ export type BannedDomain = {
|
|
|
3
3
|
domain: string;
|
|
4
4
|
};
|
|
5
5
|
export type BannedDomainRecord = mongoose.Document & BannedDomain;
|
|
6
|
-
export declare const BannedDomainRecordSchema: mongoose.Schema<BannedDomainRecord, mongoose.Model<BannedDomainRecord, any, any, any,
|
|
6
|
+
export declare const BannedDomainRecordSchema: mongoose.Schema<BannedDomainRecord, mongoose.Model<BannedDomainRecord, any, any, any, any, any, BannedDomainRecord>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, BannedDomainRecord, mongoose.Document<unknown, {}, BannedDomainRecord, {
|
|
7
|
+
id: string;
|
|
8
|
+
}, mongoose.DefaultSchemaOptions> & Omit<mongoose.Document<mongoose.Types.ObjectId, any, any, Record<string, any>, {}> & BannedDomain & Required<{
|
|
7
9
|
_id: mongoose.Types.ObjectId;
|
|
8
10
|
}> & {
|
|
9
11
|
__v: number;
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
}, "id"> & mongoose.HydratedDocumentOverrides<{
|
|
13
|
+
id: string;
|
|
14
|
+
}>, {
|
|
15
|
+
_id?: mongoose.SchemaDefinitionProperty<mongoose.Types.ObjectId, BannedDomainRecord, mongoose.Document<unknown, {}, BannedDomainRecord, {
|
|
16
|
+
id: string;
|
|
17
|
+
}, mongoose.DefaultSchemaOptions> & Omit<mongoose.Document<mongoose.Types.ObjectId, any, any, Record<string, any>, {}> & BannedDomain & Required<{
|
|
18
|
+
_id: mongoose.Types.ObjectId;
|
|
19
|
+
}> & {
|
|
20
|
+
__v: number;
|
|
21
|
+
}, "id"> & mongoose.HydratedDocumentOverrides<{
|
|
22
|
+
id: string;
|
|
23
|
+
}>> | undefined;
|
|
24
|
+
domain?: mongoose.SchemaDefinitionProperty<string, BannedDomainRecord, mongoose.Document<unknown, {}, BannedDomainRecord, {
|
|
25
|
+
id: string;
|
|
26
|
+
}, mongoose.DefaultSchemaOptions> & Omit<mongoose.Document<mongoose.Types.ObjectId, any, any, Record<string, any>, {}> & BannedDomain & Required<{
|
|
27
|
+
_id: mongoose.Types.ObjectId;
|
|
28
|
+
}> & {
|
|
29
|
+
__v: number;
|
|
30
|
+
}, "id"> & mongoose.HydratedDocumentOverrides<{
|
|
31
|
+
id: string;
|
|
32
|
+
}>> | undefined;
|
|
33
|
+
}, BannedDomainRecord>;
|
|
15
34
|
//# sourceMappingURL=bannedDomain.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bannedDomain.d.ts","sourceRoot":"","sources":["../../src/types/bannedDomain.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAGrC,MAAM,MAAM,YAAY,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,QAAQ,GAAG,YAAY,CAAC;AAElE,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"bannedDomain.d.ts","sourceRoot":"","sources":["../../src/types/bannedDomain.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAGrC,MAAM,MAAM,YAAY,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,QAAQ,GAAG,YAAY,CAAC;AAElE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAKnC,CAAC"}
|
package/dist/types/captcha.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PoWCaptcha, UserCommitment } from "@prosopo/types";
|
|
2
|
-
import { type
|
|
2
|
+
import { type QueryFilter, Schema } from "mongoose";
|
|
3
3
|
import type { IDatabase } from "./mongo.js";
|
|
4
4
|
import { type PoWCaptchaRecord, type PuzzleCaptchaRecord, type SessionRecord, type UserCommitmentRecord } from "./provider.js";
|
|
5
5
|
export type StoredSession = SessionRecord;
|
|
@@ -9,7 +9,7 @@ export declare const StoredPoWCaptchaRecordSchema: Schema;
|
|
|
9
9
|
export declare const StoredPuzzleCaptchaRecordSchema: Schema;
|
|
10
10
|
export interface ICaptchaDatabase extends IDatabase {
|
|
11
11
|
saveCaptchas(sessionEvents: StoredSession[], imageCaptchaEvents: UserCommitmentRecord[], powCaptchaEvents: PoWCaptchaRecord[], puzzleCaptchaEvents?: PuzzleCaptchaRecord[]): Promise<void>;
|
|
12
|
-
getCaptchas(filter:
|
|
12
|
+
getCaptchas(filter: QueryFilter<CaptchaProperties>, limit: number): Promise<{
|
|
13
13
|
userCommitmentRecords: UserCommitmentRecord[];
|
|
14
14
|
powCaptchaRecords: PoWCaptchaRecord[];
|
|
15
15
|
puzzleCaptchaRecords: PuzzleCaptchaRecord[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"captcha.d.ts","sourceRoot":"","sources":["../../src/types/captcha.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"captcha.d.ts","sourceRoot":"","sources":["../../src/types/captcha.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EACN,KAAK,gBAAgB,EAErB,KAAK,mBAAmB,EAExB,KAAK,aAAa,EAElB,KAAK,oBAAoB,EAEzB,MAAM,eAAe,CAAC;AAGvB,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC;AAE1C,eAAO,MAAM,yBAAyB,EAAE,MAA4B,CAAC;AAErE,eAAO,MAAM,gCAAgC,EAAE,MAE7C,CAAC;AAGH,eAAO,MAAM,4BAA4B,EAAE,MAEzC,CAAC;AAGH,eAAO,MAAM,+BAA+B,EAAE,MAE5C,CAAC;AAGH,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IAClD,YAAY,CACX,aAAa,EAAE,aAAa,EAAE,EAC9B,kBAAkB,EAAE,oBAAoB,EAAE,EAC1C,gBAAgB,EAAE,gBAAgB,EAAE,EACpC,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,GACzC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,WAAW,CACV,MAAM,EAAE,WAAW,CAAC,iBAAiB,CAAC,EACtC,KAAK,EAAE,MAAM,GACX,OAAO,CAAC;QACV,qBAAqB,EAAE,oBAAoB,EAAE,CAAC;QAC9C,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;QACtC,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;KAC5C,CAAC,CAAC;CACH;AAED,MAAM,WAAW,iBAChB,SAAQ,OAAO,CAAC,cAAc,GAAG,UAAU,CAAC;CAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"captcha.js","sourceRoot":"","sources":["../../src/types/captcha.ts"],"names":[],"mappings":"AAeA,OAAO,
|
|
1
|
+
{"version":3,"file":"captcha.js","sourceRoot":"","sources":["../../src/types/captcha.ts"],"names":[],"mappings":"AAeA,OAAO,EAAoB,MAAM,EAAE,MAAM,UAAU,CAAC;AAEpD,OAAO,EAEN,sBAAsB,EAEtB,yBAAyB,EAEzB,mBAAmB,EAEnB,0BAA0B,GAC1B,MAAM,eAAe,CAAC;AAKvB,MAAM,CAAC,MAAM,yBAAyB,GAAW,mBAAmB,CAAC;AAErE,MAAM,CAAC,MAAM,gCAAgC,GAAW,IAAI,MAAM,CAAC;IAClE,GAAG,0BAA0B,CAAC,GAAG;CACjC,CAAC,CAAC;AACH,gCAAgC,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;AAEzD,MAAM,CAAC,MAAM,4BAA4B,GAAW,IAAI,MAAM,CAAC;IAC9D,GAAG,sBAAsB,CAAC,GAAG;CAC7B,CAAC,CAAC;AACH,4BAA4B,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;AAErD,MAAM,CAAC,MAAM,+BAA+B,GAAW,IAAI,MAAM,CAAC;IACjE,GAAG,yBAAyB,CAAC,GAAG;CAChC,CAAC,CAAC;AACH,+BAA+B,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC"}
|