@prosopo/types 3.6.4 → 4.3.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 +48 -42
- package/.turbo/turbo-build$colon$tsc.log +23 -0
- package/.turbo/turbo-build.log +53 -43
- package/.turbo/turbo-typecheck.log +1 -1
- package/CHANGELOG.md +566 -0
- package/dist/api/api.d.ts +26 -8
- package/dist/api/api.d.ts.map +1 -1
- package/dist/api/api.js.map +1 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/ipapi.d.ts +2 -1
- package/dist/api/ipapi.d.ts.map +1 -1
- package/dist/api/ipapi.js.map +1 -0
- package/dist/api/params.d.ts +26 -1
- package/dist/api/params.d.ts.map +1 -1
- package/dist/api/params.js +25 -0
- package/dist/api/params.js.map +1 -0
- package/dist/cjs/api/params.cjs +25 -0
- package/dist/cjs/client/captchaType/captchaType.cjs +16 -1
- package/dist/cjs/client/index.cjs +17 -0
- package/dist/cjs/client/settings.cjs +88 -6
- package/dist/cjs/client/testSiteKeys.cjs +22 -0
- package/dist/cjs/config/config.cjs +25 -19
- package/dist/cjs/config/index.cjs +6 -2
- package/dist/cjs/config/mode.cjs +15 -0
- package/dist/cjs/config/timeouts.cjs +6 -0
- package/dist/cjs/decisionMachine/index.cjs +85 -0
- package/dist/cjs/index.cjs +81 -2
- package/dist/cjs/procaptcha/behavioral.cjs +1 -0
- package/dist/cjs/procaptcha/index.cjs +1 -0
- package/dist/cjs/provider/api.cjs +263 -9
- package/dist/cjs/provider/database.cjs +253 -0
- package/dist/cjs/provider/index.cjs +43 -0
- package/dist/cjs/provider/reasons.cjs +45 -0
- package/dist/cjs/provider/scheduler.cjs +1 -0
- package/dist/client/captchaType/captchaType.d.ts +3 -2
- package/dist/client/captchaType/captchaType.d.ts.map +1 -1
- package/dist/client/captchaType/captchaType.js +17 -2
- package/dist/client/captchaType/captchaType.js.map +1 -0
- package/dist/client/captchaType/captchaTypeSpec.js.map +1 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +20 -3
- package/dist/client/index.js.map +1 -0
- package/dist/client/settings.d.ts +278 -2
- package/dist/client/settings.d.ts.map +1 -1
- package/dist/client/settings.js +89 -7
- package/dist/client/settings.js.map +1 -0
- package/dist/client/testSiteKeys.d.ts +8 -0
- package/dist/client/testSiteKeys.d.ts.map +1 -0
- package/dist/client/testSiteKeys.js +22 -0
- package/dist/client/testSiteKeys.js.map +1 -0
- package/dist/client/user.js.map +1 -0
- package/dist/config/config.d.ts +371 -30
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +25 -19
- package/dist/config/config.js.map +1 -0
- package/dist/config/enumMap.js +6 -0
- package/dist/config/enumMap.js.map +1 -0
- package/dist/config/frictionless.js.map +1 -0
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +6 -2
- package/dist/config/index.js.map +1 -0
- package/dist/config/mode.d.ts +8 -0
- package/dist/config/mode.d.ts.map +1 -0
- package/dist/config/mode.js +15 -0
- package/dist/config/mode.js.map +1 -0
- package/dist/config/network.js.map +1 -0
- package/dist/config/timeouts.d.ts +3 -0
- package/dist/config/timeouts.d.ts.map +1 -1
- package/dist/config/timeouts.js +7 -1
- package/dist/config/timeouts.js.map +1 -0
- package/dist/datasets/assets.js.map +1 -0
- package/dist/datasets/captcha.d.ts +2 -2
- package/dist/datasets/captcha.d.ts.map +1 -1
- package/dist/datasets/captcha.js.map +1 -0
- package/dist/datasets/dataset.js.map +1 -0
- package/dist/datasets/index.js.map +1 -0
- package/dist/datasets/merkle.js.map +1 -0
- package/dist/decisionMachine/index.d.ts +174 -0
- package/dist/decisionMachine/index.d.ts.map +1 -0
- package/dist/decisionMachine/index.js +85 -0
- package/dist/decisionMachine/index.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +85 -6
- package/dist/index.js.map +1 -0
- package/dist/keyring/index.js.map +1 -0
- package/dist/keyring/keyring/types.d.ts +8 -1
- package/dist/keyring/keyring/types.d.ts.map +1 -1
- package/dist/keyring/keyring/types.js.map +1 -0
- package/dist/keyring/pair/types.js.map +1 -0
- package/dist/procaptcha/api.d.ts +3 -2
- package/dist/procaptcha/api.d.ts.map +1 -1
- package/dist/procaptcha/api.js.map +1 -0
- package/dist/procaptcha/behavioral.d.ts +49 -0
- package/dist/procaptcha/behavioral.d.ts.map +1 -0
- package/dist/procaptcha/behavioral.js +1 -0
- package/dist/procaptcha/behavioral.js.map +1 -0
- package/dist/procaptcha/client.js.map +1 -0
- package/dist/procaptcha/collector.js.map +1 -0
- package/dist/procaptcha/index.d.ts +1 -0
- package/dist/procaptcha/index.d.ts.map +1 -1
- package/dist/procaptcha/index.js +1 -0
- package/dist/procaptcha/index.js.map +1 -0
- package/dist/procaptcha/manager.js.map +1 -0
- package/dist/procaptcha/props.d.ts +27 -0
- package/dist/procaptcha/props.d.ts.map +1 -1
- package/dist/procaptcha/props.js.map +1 -0
- package/dist/procaptcha/token.js.map +1 -0
- package/dist/procaptcha/utils.js.map +1 -0
- package/dist/procaptcha-bundle/index.d.ts +0 -3
- package/dist/procaptcha-bundle/index.d.ts.map +1 -1
- package/dist/procaptcha-bundle/index.js.map +1 -0
- package/dist/procaptcha-frictionless/index.js.map +1 -0
- package/dist/procaptcha-frictionless/props.d.ts +23 -0
- package/dist/procaptcha-frictionless/props.d.ts.map +1 -1
- package/dist/procaptcha-frictionless/props.js.map +1 -0
- package/dist/provider/accounts.js.map +1 -0
- package/dist/provider/api.d.ts +1663 -116
- package/dist/provider/api.d.ts.map +1 -1
- package/dist/provider/api.js +263 -9
- package/dist/provider/api.js.map +1 -0
- package/dist/provider/database.d.ts +1376 -0
- package/dist/provider/database.d.ts.map +1 -0
- package/dist/provider/database.js +253 -0
- package/dist/provider/database.js.map +1 -0
- package/dist/provider/detection.d.ts +21 -0
- package/dist/provider/detection.d.ts.map +1 -1
- package/dist/provider/detection.js.map +1 -0
- package/dist/provider/index.d.ts +2 -0
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +44 -1
- package/dist/provider/index.js.map +1 -0
- package/dist/provider/reasons.d.ts +40 -0
- package/dist/provider/reasons.d.ts.map +1 -0
- package/dist/provider/reasons.js +45 -0
- package/dist/provider/reasons.js.map +1 -0
- package/dist/provider/scheduler.d.ts +2 -1
- package/dist/provider/scheduler.d.ts.map +1 -1
- package/dist/provider/scheduler.js +1 -0
- package/dist/provider/scheduler.js.map +1 -0
- package/package.json +9 -7
- package/vite.cjs.config.ts +1 -1
- package/vite.esm.config.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,571 @@
|
|
|
1
1
|
# @prosopo/types
|
|
2
2
|
|
|
3
|
+
## 4.3.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 [6ca1125]
|
|
18
|
+
- @prosopo/util@3.2.15
|
|
19
|
+
|
|
20
|
+
## 4.2.1
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- 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.
|
|
24
|
+
- f7f9ec5: feat(provider,widget): reserved always-pass / always-fail test site keys
|
|
25
|
+
|
|
26
|
+
Add two fixed, well-known reserved site keys (`ALWAYS_PASS_SITE_KEY` /
|
|
27
|
+
`ALWAYS_FAIL_SITE_KEY`) that force a deterministic captcha verdict for CI/CD and
|
|
28
|
+
integration testing, constant across production, staging and development.
|
|
29
|
+
|
|
30
|
+
- `@prosopo/types`: shared constants + `getTestSiteKeyMode`, imported by both the
|
|
31
|
+
provider and the widget.
|
|
32
|
+
- `@prosopo/provider`: short-circuits the `submit*` and `verify` endpoints (verify
|
|
33
|
+
runs before the signature check, so no dapp secret is needed), serves an
|
|
34
|
+
invisible PoW session from the frictionless handler, and bypasses domain
|
|
35
|
+
middleware. Works in every environment with no DB record.
|
|
36
|
+
- `@prosopo/procaptcha-common` / `-react` / `-frictionless`: render a prominent
|
|
37
|
+
`TestModeBanner` warning (always pass/fail) plus a console warning so a test key
|
|
38
|
+
can never ship to production unnoticed.
|
|
39
|
+
|
|
40
|
+
always-pass verifies at both the submit and verify layers; always-fail fails at
|
|
41
|
+
both. Safe in production by design: the override only weakens protection for a
|
|
42
|
+
dapp that deliberately opts in, mirroring reCAPTCHA's public test keys.
|
|
43
|
+
|
|
44
|
+
## 4.2.0
|
|
45
|
+
### Minor Changes
|
|
46
|
+
|
|
47
|
+
- 20cae63: feat(provider): re-route after PoW using decrypted behavioural data
|
|
48
|
+
|
|
49
|
+
PoW solutions are now re-evaluated by the routing machine after submission.
|
|
50
|
+
Previously the routing decision was made up-front on a thin set of signals;
|
|
51
|
+
behavioural data only becomes available (decrypted server-side) once the
|
|
52
|
+
user submits their PoW solution, so a user with weak behavioural signals
|
|
53
|
+
could still earn a token by solving PoW alone.
|
|
54
|
+
|
|
55
|
+
The submit endpoint now runs the routing machine a second time in a new
|
|
56
|
+
`postPow` phase, feeding in the decrypted behavioural data, the originating
|
|
57
|
+
session's score, request headers, JA4, and IP info. If the router escalates,
|
|
58
|
+
the provider mints a fresh session (carrying the original session's risk
|
|
59
|
+
profile) and returns `escalation: { captchaType, sessionId }` on the
|
|
60
|
+
`PowCaptchaSolutionResponse`. The `verified` flag is forced to `false` on
|
|
61
|
+
escalation — the user isn't done until they clear the follow-up.
|
|
62
|
+
|
|
63
|
+
On the client, `ProcaptchaFrictionless` accepts the escalation via a new
|
|
64
|
+
internal `onEscalate` prop on the PoW widget and mounts the chosen image
|
|
65
|
+
or puzzle widget in place, splicing the new sessionId into the
|
|
66
|
+
`FrictionlessState`. The handoff is internal to the frictionless → pow
|
|
67
|
+
flow — dapps integrating Procaptcha see no API change.
|
|
68
|
+
|
|
69
|
+
`RoutingMachineInputBase.phase` widens from `"route"` to
|
|
70
|
+
`"route" | "postPow"` so decision-machine configs can distinguish the two
|
|
71
|
+
passes.
|
|
72
|
+
|
|
73
|
+
### Patch Changes
|
|
74
|
+
|
|
75
|
+
- 4d9923e: feat: optional `storeMetadata` site setting persists `/verify` metadata
|
|
76
|
+
|
|
77
|
+
Adds a per-site-key boolean `storeMetadata` (default `false`) to
|
|
78
|
+
`ClientSettingsSchema` / `UserSettingsSchema`. When enabled, the provider
|
|
79
|
+
writes the dapp-server-forwarded metadata that arrives on the image, PoW
|
|
80
|
+
and puzzle `/verify` endpoints onto the corresponding captcha record under
|
|
81
|
+
a new `metadata` sub-document (`{ email?: string }` today; more fields
|
|
82
|
+
will be added here as the verify payload grows).
|
|
83
|
+
|
|
84
|
+
`providedIp` stays top-level — existing data and indexes already use it,
|
|
85
|
+
and it predates this setting.
|
|
86
|
+
|
|
87
|
+
Off by default. Existing spam-email checks still inspect the submitted
|
|
88
|
+
email unconditionally — this setting only gates **storage** of metadata
|
|
89
|
+
so the submitted values can be sampled later to judge whether traffic is
|
|
90
|
+
mostly spam.
|
|
91
|
+
|
|
92
|
+
## 4.1.4
|
|
93
|
+
### Patch Changes
|
|
94
|
+
|
|
95
|
+
- d351362: fix: replace `$or + $expr` unstored-records sweep with a `pendingStage` sentinel
|
|
96
|
+
|
|
97
|
+
The `StoreCommitmentsExternal` background job fetches "records that still
|
|
98
|
+
need to be shipped to the central DB" via
|
|
99
|
+
`{ $or: [ { storedAtTimestamp: { $exists: false } }, { $expr: { $lt: [$storedAtTimestamp, $lastUpdatedTimestamp] } } ] }`.
|
|
100
|
+
`$expr` is unindexable (per-doc computation) and combined with `$or`
|
|
101
|
+
defeats the planner entirely — production was running this every sweep
|
|
102
|
+
as a `IXSCAN { _id: 1 }` collection scan, examining ~673K powcaptcha
|
|
103
|
+
docs, ~240K usercommitments docs, and ~60K sessions docs per pass. On
|
|
104
|
+
the worst-affected nodes this thrashed the WiredTiger cache (10h of
|
|
105
|
+
cumulative app-thread blocking on disk reads in 43h of uptime) and made
|
|
106
|
+
every other Mongo lookup (including the frictionless session dedup
|
|
107
|
+
queries) slow by eviction — manifesting as traffic-correlated provider
|
|
108
|
+
latency starting 2026-05-26.
|
|
109
|
+
|
|
110
|
+
Replace the query semantics with a `pendingStage: true` sentinel:
|
|
111
|
+
|
|
112
|
+
- New optional `pendingStage` field on `StoredCaptcha` and `Session`
|
|
113
|
+
(Zod + TS + Mongoose schemas).
|
|
114
|
+
- New tiny partial index per collection:
|
|
115
|
+
`{ pendingStage: 1 }` with `partialFilterExpression: { pendingStage: true }`.
|
|
116
|
+
Indexes only the rows that need staging — typically a tiny rolling set,
|
|
117
|
+
~20 KB for a 700K-row collection with 100 pending rows in local tests.
|
|
118
|
+
- Write paths (`storeXxx`, `updateXxx`, `markXxxChecked`, approve /
|
|
119
|
+
disapprove, `checkAndRemoveSession`, `recordSessionSimdReadingsIfAbsent`,
|
|
120
|
+
`storePendingImageCommitment`) set `pendingStage: true` alongside the
|
|
121
|
+
existing `lastUpdatedTimestamp` bump.
|
|
122
|
+
- `markXxxStored` and the per-record streamer mark-stored callbacks
|
|
123
|
+
`$unset: { pendingStage: 1 }` alongside the `storedAtTimestamp` write,
|
|
124
|
+
guarded by `lastUpdatedTimestamp: { $lte: ts }` so an in-flight update
|
|
125
|
+
doesn't get its pending flag cleared by an older stage completion.
|
|
126
|
+
- `markXxxStored` bulk methods accept an `asOfTimestamp` argument; the
|
|
127
|
+
sweep passes the time it fetched the batch so the guard is correct
|
|
128
|
+
across the full ship-then-mark round trip.
|
|
129
|
+
- `getUnstoredXxx` queries become `{ pendingStage: true }` sorted by
|
|
130
|
+
`_id` — uses the new partial index, examines only pending docs.
|
|
131
|
+
|
|
132
|
+
Local verification on a 700,100-doc test collection: old query ~549 ms
|
|
133
|
+
examining 700,100 docs; new query 0 ms examining 100 docs. Index storage
|
|
134
|
+
~20 KB.
|
|
135
|
+
|
|
136
|
+
## 4.1.3
|
|
137
|
+
### Patch Changes
|
|
138
|
+
|
|
139
|
+
- e2711ae: feat(provider): add `autoBanScoreThreshold` client setting and frictionless auto-ban
|
|
140
|
+
|
|
141
|
+
Adds an optional `autoBanScoreThreshold` to `ClientSettingsSchema`. When set,
|
|
142
|
+
the frictionless decision machine blocks any request whose detector score is
|
|
143
|
+
at or above the threshold with HTTP 401 instead of issuing an image or PoW
|
|
144
|
+
challenge — useful for clients receiving floods of image solves from sessions
|
|
145
|
+
scoring at or above 1.
|
|
146
|
+
|
|
147
|
+
The check runs first in `runDecisionMachine`, before the existing
|
|
148
|
+
user-agent / context-aware / webview / timestamp / threshold gates, so score
|
|
149
|
+
bumps applied by those gates cannot bypass it. Blocked sessions are persisted
|
|
150
|
+
via `registerBlockedSession` with the new `FrictionlessReason.AUTO_BAN_SCORE`
|
|
151
|
+
reason.
|
|
152
|
+
|
|
153
|
+
Undefined threshold = disabled; existing clients are unaffected.
|
|
154
|
+
- 5786629: fix(provider): persist DISALLOWED_WEBVIEW outcome and broaden detection in image captcha verify
|
|
155
|
+
|
|
156
|
+
The webview check in `verifyImageCaptchaSolution` did an early return that
|
|
157
|
+
left the commitment stuck at `Approved` in the database and never marked
|
|
158
|
+
the session as `serverChecked` / `disapproved`, even though the API
|
|
159
|
+
correctly returned `verified: false`. This made the DB state misleading
|
|
160
|
+
and broke any downstream consumer reading commitment status directly.
|
|
161
|
+
|
|
162
|
+
The check also only fired when `scoreComponents.webView > 0`, which is
|
|
163
|
+
only set when the frictionless flow took the webview branch. Webview
|
|
164
|
+
users who reached the image captcha via another branch (UA mismatch,
|
|
165
|
+
context-aware failure, timestamp, bot score) had `session.webView: true`
|
|
166
|
+
but no `scoreComponents.webView`, so the verify-time block missed them.
|
|
167
|
+
|
|
168
|
+
- Convert the early return to the same `failStatus` /
|
|
169
|
+
`commitmentUpdates.result` pattern used by every other check in the
|
|
170
|
+
function, so the commitment and session are properly persisted as
|
|
171
|
+
disapproved with reason `DISALLOWED_WEBVIEW`.
|
|
172
|
+
- Trigger on `session.webView === true` OR `scoreComponents.webView > 0`.
|
|
173
|
+
- Add `ResultReason.DISALLOWED_WEBVIEW` and the English locale entry.
|
|
174
|
+
- Add unit tests for score-based detection, boolean-only detection, and
|
|
175
|
+
the `disallowWebView=false` passthrough.
|
|
176
|
+
|
|
177
|
+
Closes #3396.
|
|
178
|
+
- Updated dependencies [6567ce0]
|
|
179
|
+
- Updated dependencies [5786629]
|
|
180
|
+
- @prosopo/util@3.2.14
|
|
181
|
+
- @prosopo/locale@3.2.4
|
|
182
|
+
|
|
183
|
+
## 4.1.2
|
|
184
|
+
### Patch Changes
|
|
185
|
+
|
|
186
|
+
- Updated dependencies [72a1218]
|
|
187
|
+
- @prosopo/util@3.2.13
|
|
188
|
+
|
|
189
|
+
## 4.1.1
|
|
190
|
+
### Patch Changes
|
|
191
|
+
|
|
192
|
+
- 91958da: Puzzle captcha + maintenance mode hardening, plus a refactor of the
|
|
193
|
+
frictionless handler into focused modules.
|
|
194
|
+
|
|
195
|
+
- **Puzzle captcha now records checkbox-click coordinates like POW.** Adds an
|
|
196
|
+
optional `salt` field to `SubmitPuzzleCaptchaSolutionBody`; the puzzle
|
|
197
|
+
widget hashes the click coords into the salt and the server decodes them
|
|
198
|
+
into the puzzle record's `coords` field on submit. New `start(x, y)`
|
|
199
|
+
parameters on `procaptcha-puzzle` Manager + widget.
|
|
200
|
+
- **Fix puzzle "No session found" caused by stale Redis dedup.** The
|
|
201
|
+
`/frictionless` dedup path is now Mongo-authoritative — Redis is no
|
|
202
|
+
longer consulted as a session source. A concurrent `/captcha/{type}`
|
|
203
|
+
invalidation could previously race a fire-and-forget Redis repopulation
|
|
204
|
+
in the `/frictionless` dedup branch, leaving Redis pointing at a
|
|
205
|
+
Mongo-deleted session for the full 1-hour TTL. Stale pointers are now
|
|
206
|
+
evicted lazily.
|
|
207
|
+
- **Maintenance mode operates without MongoDB.** `/frictionless` and
|
|
208
|
+
`/captcha/{pow,puzzle}` short-circuit to dummy responses before any DB
|
|
209
|
+
call, and `Environment.isReady()` tolerates a Mongo connect failure when
|
|
210
|
+
`MAINTENANCE_MODE=true` so the provider can start with Mongo down.
|
|
211
|
+
- **Refactor `getFrictionlessCaptchaChallenge.ts` into focused modules** under
|
|
212
|
+
`getFrictionlessCaptchaChallenge/` (handler, sessionDedup, shortCircuit,
|
|
213
|
+
accessPolicy, decisionMachine, decryptSimdReadings, constants). Original
|
|
214
|
+
import path preserved via a re-export shim.
|
|
215
|
+
- **Move `RedisWriteQueue` from `@prosopo/provider` to `@prosopo/database`**
|
|
216
|
+
(where the Redis connection itself lives), and clear residual Redis
|
|
217
|
+
session keys at provider startup via `Environment.cleanup()` so a
|
|
218
|
+
previously-crashed run can't leak stale dedup pointers.
|
|
219
|
+
- Adds puzzle-type branch to access-policy handling in `/frictionless`.
|
|
220
|
+
- Updated dependencies [53bfd45]
|
|
221
|
+
- @prosopo/locale@3.2.3
|
|
222
|
+
|
|
223
|
+
## 4.1.0
|
|
224
|
+
### Minor Changes
|
|
225
|
+
|
|
226
|
+
- 6a741ce: Move `FrictionlessReason` into `@prosopo/types` and add a new
|
|
227
|
+
`ResultReason` enum covering the values previously inlined as string
|
|
228
|
+
literals on `result.reason` (API.CAPTCHA_PASSED, API.VPN_BLOCKED,
|
|
229
|
+
EMAIL_INVALID, etc.). Provider task code now references the enums so the
|
|
230
|
+
canonical list of selection/result reasons lives in one place and can be
|
|
231
|
+
imported by non-server packages (portal, audit tooling) without pulling
|
|
232
|
+
in `@prosopo/provider`. The previous `FrictionlessReason` export from
|
|
233
|
+
`@prosopo/provider` is preserved as a re-export for backwards
|
|
234
|
+
compatibility.
|
|
235
|
+
|
|
236
|
+
`CaptchaResult.reason`, `StoredCaptcha.result.reason`, `Session.result.reason`
|
|
237
|
+
are now typed `ResultReason | undefined`; `Session.reason` is typed
|
|
238
|
+
`FrictionlessReason | undefined`. The runtime zod schema stays permissive
|
|
239
|
+
(`string().optional().transform(v => v as ResultReason | undefined)`) so
|
|
240
|
+
operator-authored decision-machine output and old MongoDB records still
|
|
241
|
+
parse without throwing; the strict enum is preserved on the TS surface
|
|
242
|
+
via the transform.
|
|
243
|
+
|
|
244
|
+
## 4.0.0
|
|
245
|
+
### Major Changes
|
|
246
|
+
|
|
247
|
+
- 8bb7286: Move `captchaType` from client (`data-captcha-type` / render-options prop)
|
|
248
|
+
to a server-side site-key setting; the bundle now calls `/frictionless`
|
|
249
|
+
for all flows. Renames the bundle's universal mount component from
|
|
250
|
+
`FrictionlessCaptcha` to `BundleCaptcha` to reflect that it is no longer
|
|
251
|
+
frictionless-specific — the server decides which concrete challenge type
|
|
252
|
+
to render.
|
|
253
|
+
|
|
254
|
+
### Minor Changes
|
|
255
|
+
|
|
256
|
+
- d865319: Add puzzle captcha (drag-to-target challenge) as a new captcha type:
|
|
257
|
+
provider endpoints, manager + widget package, types, demo pages, and
|
|
258
|
+
a `puzzleTolerance` site setting.
|
|
259
|
+
- 753304b: Extend the existing decision-machine artifact with a new `route` phase that
|
|
260
|
+
selects the concrete captcha type during the frictionless flow. Per-sitekey
|
|
261
|
+
JS sources (Dapp > Global priority) can now override the ladder's image/pow
|
|
262
|
+
baseline based on Redis-backed usage counters keyed by IP and userAccount.
|
|
263
|
+
|
|
264
|
+
Adds:
|
|
265
|
+
|
|
266
|
+
- `RoutingMachineInput`, `RoutingMachineOutput`, `CounterSpec`,
|
|
267
|
+
`CounterWindow` etc. in `@prosopo/types`.
|
|
268
|
+
- A `usageCounters` primitive in the provider (Lua INCR + TTL-on-first;
|
|
269
|
+
bulk MGET) and fire-and-forget served/solved counter writes at the
|
|
270
|
+
three captcha types.
|
|
271
|
+
- `DecisionMachineRunner.route()` and `.getRequiredCounters()` alongside
|
|
272
|
+
the existing `decide()` veto. Artifact cache is now shared across all
|
|
273
|
+
runner instances and busted on admin PUT for immediate propagation.
|
|
274
|
+
- `applyRouter` helper in the frictionless flow which falls back to the
|
|
275
|
+
ladder baseline on any machine/Redis failure.
|
|
276
|
+
|
|
277
|
+
Back-compat: existing post-PoW verify-phase machines keep working
|
|
278
|
+
unchanged. A single artifact can export both `route` and `verify` /
|
|
279
|
+
`decide`.
|
|
280
|
+
|
|
281
|
+
### Patch Changes
|
|
282
|
+
|
|
283
|
+
- 3c0be68: Add a new admin-only endpoint `POST /v1/prosopo/provider/admin/counters/clear-all`
|
|
284
|
+
for deleting per-sitekey usage counters from Redis. Intended for manual
|
|
285
|
+
testing of routing decision machines and staging-environment resets — not
|
|
286
|
+
part of the hot path.
|
|
287
|
+
|
|
288
|
+
- `ClearAllCountersBody` (optional `dapp`) and `ClearAllCountersResponse`
|
|
289
|
+
(`success`, `deletedCount`, `scope`) zod schemas in `@prosopo/types`,
|
|
290
|
+
plus `AdminApiPaths.ClearAllCounters` and a 10/60s rate limit.
|
|
291
|
+
- `UsageCounters.clearAll(dappAccount?)` in the provider, using Redis
|
|
292
|
+
`SCAN` + `DEL` in 500-key batches. Returns null on Redis failure so
|
|
293
|
+
callers can surface the underlying error.
|
|
294
|
+
- `ApiClearAllCountersEndpoint` wired through `ApiAdminRoutesProvider`.
|
|
295
|
+
- `ProviderApi.clearAllCounters(jwt, dappAccount?)` client method.
|
|
296
|
+
- f9ea09d: Drop flat ipinfo fields (`vpn`, `countryCode`, `tor`, `proxy`, `datacenter`, `abuser`, `geolocation`) from captcha records — persist the full `IPInfoResponse` payload as `ipInfo` instead
|
|
297
|
+
|
|
298
|
+
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.
|
|
299
|
+
|
|
300
|
+
- `StoredCaptcha` interface: removed `vpn`, `countryCode`, `geolocation`. Keeps `ipInfo?: IPInfoResponse`.
|
|
301
|
+
- `PoWCaptchaStoredSchema` zod validator: same removals, adds `ipInfo` (validated as `any()` since `IPInfoResponse` is a discriminated union narrowed at read time).
|
|
302
|
+
- 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 }`.
|
|
303
|
+
- `IProviderDatabase` interface: `storePowCaptchaRecord` / `storePuzzleCaptchaRecord` / `storePendingImageCommitment` now take `ipInfo?: IPInfoResponse` in place of `countryCode?: string`.
|
|
304
|
+
- 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.
|
|
305
|
+
- 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.
|
|
306
|
+
- Lean projections in `provider.ts` switched from `countryCode: 1` to `ipInfo: 1`.
|
|
307
|
+
|
|
308
|
+
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.
|
|
309
|
+
- f9ea09d: Drop flat `countryCode` / `geolocation` fields from Session records — persist the full `IPInfoResponse` payload as `session.ipInfo` instead
|
|
310
|
+
|
|
311
|
+
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, ...).
|
|
312
|
+
|
|
313
|
+
- `Session` interface + `SessionSchema` zod (`@prosopo/types`): replace `countryCode?: string` / `geolocation?: string` with `ipInfo?: IPInfoResponse`.
|
|
314
|
+
- `SessionRecordSchema` mongoose (`@prosopo/types-database`): same.
|
|
315
|
+
- `FrictionlessManager.setSessionParams` / `createSession`: accept `ipInfo` instead of `countryCode`.
|
|
316
|
+
- `getFrictionlessCaptchaChallenge.ts` call sites (10 of them — `sendImageCaptcha`, `sendPowCaptcha`, `registerBlockedSession`, etc.) pass `req.ipInfo` instead of `countryCode`.
|
|
317
|
+
- `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.
|
|
318
|
+
- 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.
|
|
319
|
+
|
|
320
|
+
`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.
|
|
321
|
+
|
|
322
|
+
Paired with [captcha-private#3339](https://github.com/prosopo/captcha-private/pull/3339).
|
|
323
|
+
- 4aae4e6: Plumb the WASM SIMD CPU fingerprint readings (collected by the catcher
|
|
324
|
+
client per https://blog.azerpas.com/writing/wasm-simd-fingerprinting/)
|
|
325
|
+
through the captcha flow and onto the linked `Session` record.
|
|
326
|
+
Collection-only — no scoring or classification yet.
|
|
327
|
+
|
|
328
|
+
The readings are sent at the earliest moment they're available so the
|
|
329
|
+
signal lands on the session as soon as possible:
|
|
330
|
+
|
|
331
|
+
1. **Captcha-challenge GET** (PoW / Puzzle / Image) — the procaptcha
|
|
332
|
+
Manager calls `frictionlessState.getSimdReadings(0)` (non-blocking
|
|
333
|
+
cache check) and attaches it to the challenge-request body. The
|
|
334
|
+
provider handler decodes and patches the linked session via
|
|
335
|
+
`updateSessionRecord`.
|
|
336
|
+
2. **Solution submission** (PoW / Puzzle / Image) — same non-blocking
|
|
337
|
+
check on the submit body. Acts as a backup if the benchmark wasn't
|
|
338
|
+
ready in time for the challenge GET.
|
|
339
|
+
|
|
340
|
+
Frictionless init itself stays SIMD-free (benchmark is too slow to gate
|
|
341
|
+
the first hop).
|
|
342
|
+
|
|
343
|
+
Surface area:
|
|
344
|
+
|
|
345
|
+
- `SimdReadings` discriminated union + `SimdOpReadingRecord` /
|
|
346
|
+
`SimdOpCategory` in `@prosopo/types`, plus `simdReadingsCodec` shared
|
|
347
|
+
encode/decode helpers so the browser SDK and the provider use the same
|
|
348
|
+
pipe-safe wire format.
|
|
349
|
+
- Optional `simdReadings: string()` on `CaptchaRequestBody`,
|
|
350
|
+
`GetPowCaptchaChallengeRequestBody`, `GetPuzzleCaptchaChallengeRequestBody`,
|
|
351
|
+
`CaptchaSolutionBody`, `SubmitPowCaptchaSolutionBody`, and
|
|
352
|
+
`SubmitPuzzleCaptchaSolutionBody`.
|
|
353
|
+
- `FrictionlessState.getSimdReadings` + `BotDetectionFunctionResult.getSimdReadings`
|
|
354
|
+
so the catcher's prefetched benchmark is consumed at the request sites.
|
|
355
|
+
- `ProcaptchaApiInterface.{getCaptchaChallenge, submitCaptchaSolution}` and
|
|
356
|
+
the `ProviderApi.{getCaptchaChallenge, getPowCaptchaChallenge, getPuzzleCaptchaChallenge,
|
|
357
|
+
submitCaptchaSolution, submitPowCaptchaSolution, submitPuzzleCaptchaSolution}`
|
|
358
|
+
client methods accept the field.
|
|
359
|
+
- Provider challenge + solution handlers decode via `decodeSimdReadings`
|
|
360
|
+
and `updateSessionRecord` (Mongoose `Mixed`, Zod discriminated-union
|
|
361
|
+
validation at the edge). The challenge-GET patch is fire-and-forget.
|
|
362
|
+
|
|
363
|
+
Backward-compatible: older catcher clients omit the field at every layer;
|
|
364
|
+
the session record omits it in turn.
|
|
365
|
+
- Updated dependencies [4aae4e6]
|
|
366
|
+
- @prosopo/locale@3.2.2
|
|
367
|
+
- @prosopo/util@3.2.12
|
|
368
|
+
|
|
369
|
+
## 3.16.1
|
|
370
|
+
### Patch Changes
|
|
371
|
+
|
|
372
|
+
- 819ed95: Adding invisible mode to session data
|
|
373
|
+
|
|
374
|
+
## 3.16.0
|
|
375
|
+
### Minor Changes
|
|
376
|
+
|
|
377
|
+
- 99dfb44: Pass back reason via verify calls
|
|
378
|
+
|
|
379
|
+
### Patch Changes
|
|
380
|
+
|
|
381
|
+
- f6a4402: API endpoint for removing site keys
|
|
382
|
+
|
|
383
|
+
## 3.15.0
|
|
384
|
+
### Minor Changes
|
|
385
|
+
|
|
386
|
+
- 3e54c0a: Rate limits by client
|
|
387
|
+
|
|
388
|
+
## 3.14.1
|
|
389
|
+
### Patch Changes
|
|
390
|
+
|
|
391
|
+
- 946a8ba: Abuser score threshold
|
|
392
|
+
- 5614814: Small config changes
|
|
393
|
+
- Updated dependencies [b94890c]
|
|
394
|
+
- @prosopo/locale@3.2.1
|
|
395
|
+
|
|
396
|
+
## 3.14.0
|
|
397
|
+
### Minor Changes
|
|
398
|
+
|
|
399
|
+
- 42650db: Add better spam rules and move ipinfo service to local instead of external
|
|
400
|
+
|
|
401
|
+
### Patch Changes
|
|
402
|
+
|
|
403
|
+
- fc514dd: ability to block different types of traffic
|
|
404
|
+
- Updated dependencies [fc514dd]
|
|
405
|
+
- Updated dependencies [42650db]
|
|
406
|
+
- @prosopo/locale@3.2.0
|
|
407
|
+
|
|
408
|
+
## 3.13.3
|
|
409
|
+
### Patch Changes
|
|
410
|
+
|
|
411
|
+
- Updated dependencies [a25dffa]
|
|
412
|
+
- @prosopo/util@3.2.11
|
|
413
|
+
|
|
414
|
+
## 3.13.2
|
|
415
|
+
### Patch Changes
|
|
416
|
+
|
|
417
|
+
- Updated dependencies [346edd7]
|
|
418
|
+
- @prosopo/util@3.2.10
|
|
419
|
+
|
|
420
|
+
## 3.13.1
|
|
421
|
+
### Patch Changes
|
|
422
|
+
|
|
423
|
+
- Updated dependencies [22bfee7]
|
|
424
|
+
- @prosopo/util@3.2.9
|
|
425
|
+
|
|
426
|
+
## 3.13.0
|
|
427
|
+
### Minor Changes
|
|
428
|
+
|
|
429
|
+
- e6d9553: Add `registerSiteKeys` bulk endpoint (`POST /v1/prosopo/provider/admin/sitekeys/register`) that accepts an array of site key records, allowing multiple client records to be registered in a single request.
|
|
430
|
+
|
|
431
|
+
### Patch Changes
|
|
432
|
+
|
|
433
|
+
- Updated dependencies [e0fb3d6]
|
|
434
|
+
- Updated dependencies [f3f23e3]
|
|
435
|
+
- @prosopo/util@3.2.8
|
|
436
|
+
|
|
437
|
+
## 3.12.3
|
|
438
|
+
### Patch Changes
|
|
439
|
+
|
|
440
|
+
- d5082a9: Don't require email type
|
|
441
|
+
- e1ea65f: Better spam email domain checking
|
|
442
|
+
- c316257: Adding sync fo sessions wrt captcha status
|
|
443
|
+
- Updated dependencies [e1ea65f]
|
|
444
|
+
- @prosopo/util@3.2.7
|
|
445
|
+
|
|
446
|
+
## 3.12.2
|
|
447
|
+
### Patch Changes
|
|
448
|
+
|
|
449
|
+
- adb89a6: Disposable email checking
|
|
450
|
+
- Updated dependencies [adb89a6]
|
|
451
|
+
- @prosopo/locale@3.1.29
|
|
452
|
+
- @prosopo/util@3.2.6
|
|
453
|
+
|
|
454
|
+
## 3.12.1
|
|
455
|
+
### Patch Changes
|
|
456
|
+
|
|
457
|
+
- a90eb54: We know WHAT happens but we don't know WHY happens
|
|
458
|
+
|
|
459
|
+
## 3.12.0
|
|
460
|
+
### Minor Changes
|
|
461
|
+
|
|
462
|
+
- feaca02: Max image rounds
|
|
463
|
+
|
|
464
|
+
### Patch Changes
|
|
465
|
+
|
|
466
|
+
- 676c5f2: Use HTTPS in developmentwq
|
|
467
|
+
|
|
468
|
+
## 3.11.1
|
|
469
|
+
### Patch Changes
|
|
470
|
+
|
|
471
|
+
- 8148587: Clustering
|
|
472
|
+
|
|
473
|
+
## 3.11.0
|
|
474
|
+
### Minor Changes
|
|
475
|
+
|
|
476
|
+
- 7f6ffc5: Store behavioural for image challenges
|
|
477
|
+
|
|
478
|
+
## 3.10.2
|
|
479
|
+
### Patch Changes
|
|
480
|
+
|
|
481
|
+
- 93fa086: Add decision engine endpoints
|
|
482
|
+
|
|
483
|
+
## 3.10.1
|
|
484
|
+
### Patch Changes
|
|
485
|
+
|
|
486
|
+
- cde7550: enhance/frictionless-headers-db-field
|
|
487
|
+
|
|
488
|
+
## 3.10.0
|
|
489
|
+
### Minor Changes
|
|
490
|
+
|
|
491
|
+
- ad6d622: Separate types from mongoose schemas to avoid bundling mongoose in frontend
|
|
492
|
+
|
|
493
|
+
## 3.9.0
|
|
494
|
+
### Minor Changes
|
|
495
|
+
|
|
496
|
+
- ff58a70: Load the geolocation service at startup only
|
|
497
|
+
|
|
498
|
+
## 3.8.4
|
|
499
|
+
### Patch Changes
|
|
500
|
+
|
|
501
|
+
- d2431cd: Allow IP validation rules to be disabled
|
|
502
|
+
|
|
503
|
+
## 3.8.3
|
|
504
|
+
### Patch Changes
|
|
505
|
+
|
|
506
|
+
- bd6995b: Adding UAP based geoblocking rules
|
|
507
|
+
|
|
508
|
+
## 3.8.2
|
|
509
|
+
### Patch Changes
|
|
510
|
+
|
|
511
|
+
- 9633e58: Add captcha type to decision machine and run on image verification"
|
|
512
|
+
|
|
513
|
+
## 3.8.1
|
|
514
|
+
### Patch Changes
|
|
515
|
+
|
|
516
|
+
- f52a5c1: Adding decision machine to provider for behavior detection
|
|
517
|
+
|
|
518
|
+
## 3.8.0
|
|
519
|
+
### Minor Changes
|
|
520
|
+
|
|
521
|
+
- 1ee3d80: More API fixes
|
|
522
|
+
|
|
523
|
+
### Patch Changes
|
|
524
|
+
|
|
525
|
+
- 3acc333: Add JWT issuance to keypairs
|
|
526
|
+
- 0a38892: feat/cross-os-testing
|
|
527
|
+
- a8faa9a: bump license year
|
|
528
|
+
- 7543d17: mouse movements bot stopping
|
|
529
|
+
- 3acc333: Release 3.3.0
|
|
530
|
+
- Updated dependencies [a53526b]
|
|
531
|
+
- Updated dependencies [3acc333]
|
|
532
|
+
- Updated dependencies [0a38892]
|
|
533
|
+
- Updated dependencies [a8faa9a]
|
|
534
|
+
- Updated dependencies [fe9fe22]
|
|
535
|
+
- Updated dependencies [3acc333]
|
|
536
|
+
- @prosopo/util@3.2.5
|
|
537
|
+
- @prosopo/util-crypto@13.5.29
|
|
538
|
+
- @prosopo/locale@3.1.28
|
|
539
|
+
|
|
540
|
+
## 3.7.2
|
|
541
|
+
### Patch Changes
|
|
542
|
+
|
|
543
|
+
- 141e462: Capture correct event
|
|
544
|
+
|
|
545
|
+
## 3.7.1
|
|
546
|
+
### Patch Changes
|
|
547
|
+
|
|
548
|
+
- 345b25b: pow coord
|
|
549
|
+
|
|
550
|
+
## 3.7.0
|
|
551
|
+
### Minor Changes
|
|
552
|
+
|
|
553
|
+
- ce70a2b: Add context-aware entropy calculation for WebView and default contexts
|
|
554
|
+
|
|
555
|
+
- Added ContextType enum to distinguish between WebView and default browser contexts
|
|
556
|
+
- Implemented context-specific entropy calculation and storage
|
|
557
|
+
- Created clientContextEntropy collection with automatic timestamp management
|
|
558
|
+
- Removed legacy clientEntropy table in favor of context-specific approach
|
|
559
|
+
- Added helper functions for context determination and threshold retrieval
|
|
560
|
+
- Included comprehensive unit tests for context validation logic
|
|
561
|
+
|
|
562
|
+
### Patch Changes
|
|
563
|
+
|
|
564
|
+
- c2b940f: Properly save context type settings
|
|
565
|
+
- f6b5094: Allow different context to override default
|
|
566
|
+
- Updated dependencies [e01227b]
|
|
567
|
+
- @prosopo/locale@3.1.27
|
|
568
|
+
|
|
3
569
|
## 3.6.4
|
|
4
570
|
### Patch Changes
|
|
5
571
|
|
package/dist/api/api.d.ts
CHANGED
|
@@ -1,18 +1,36 @@
|
|
|
1
|
+
import type { RegisterSitekeysBodyTypeOutput, RemoveSitekeysBodyTypeOutput } from "@prosopo/types";
|
|
1
2
|
import type { IUserSettings, Tier } from "../client/index.js";
|
|
2
3
|
import type { CaptchaSolution } from "../datasets/index.js";
|
|
4
|
+
import type { DecisionMachineCaptchaType, DecisionMachineLanguage, DecisionMachineRuntime, DecisionMachineScope } from "../decisionMachine/index.js";
|
|
3
5
|
import type { ProcaptchaToken, StoredEvents } from "../procaptcha/index.js";
|
|
4
|
-
import type {
|
|
6
|
+
import type { ClientMetaData } from "../provider/database.js";
|
|
7
|
+
import type { ApiResponse, CaptchaResponseBody, CaptchaSolutionResponse, GetPowCaptchaResponse, GetPuzzleCaptchaResponse, ImageVerificationResponse, PowCaptchaSolutionResponse, Provider, ProviderRegistered, PuzzleCaptchaSolutionResponse, RandomProvider, UpdateProviderClientsResponse, VerificationResponse } from "../provider/index.js";
|
|
5
8
|
export interface ProviderApiInterface {
|
|
6
|
-
getCaptchaChallenge(userAccount: string, randomProvider: RandomProvider): Promise<CaptchaResponseBody>;
|
|
7
|
-
submitCaptchaSolution(captchas: CaptchaSolution[], requestHash: string, userAccount: string, timestamp: string, providerRequestHashSignature: string, userRequestHashSignature: string): Promise<CaptchaSolutionResponse>;
|
|
9
|
+
getCaptchaChallenge(userAccount: string, randomProvider: RandomProvider, sessionId?: string, simdReadings?: string): Promise<CaptchaResponseBody>;
|
|
10
|
+
submitCaptchaSolution(captchas: CaptchaSolution[], requestHash: string, userAccount: string, timestamp: string, providerRequestHashSignature: string, userRequestHashSignature: string, behavioralData?: string, simdReadings?: string, clientMetaData?: ClientMetaData): Promise<CaptchaSolutionResponse>;
|
|
8
11
|
verifyDappUser(token: ProcaptchaToken, signature: string, userAccount: string, maxVerifiedTime?: number): Promise<ImageVerificationResponse>;
|
|
9
|
-
getPowCaptchaChallenge(userAccount: string, dappAccount: string): Promise<GetPowCaptchaResponse>;
|
|
10
|
-
submitPowCaptchaSolution(challenge: GetPowCaptchaResponse, userAccount: string, dappAccount: string, nonce: number, userTimestampSignature: string, timeout?: number): Promise<PowCaptchaSolutionResponse>;
|
|
12
|
+
getPowCaptchaChallenge(userAccount: string, dappAccount: string, sessionId?: string, simdReadings?: string): Promise<GetPowCaptchaResponse>;
|
|
13
|
+
submitPowCaptchaSolution(challenge: GetPowCaptchaResponse, userAccount: string, dappAccount: string, nonce: number, userTimestampSignature: string, timeout?: number, behavioralData?: string, salt?: string, simdReadings?: string, clientMetaData?: ClientMetaData): Promise<PowCaptchaSolutionResponse>;
|
|
14
|
+
getPuzzleCaptchaChallenge(userAccount: string, dappAccount: string, sessionId?: string, simdReadings?: string): Promise<GetPuzzleCaptchaResponse>;
|
|
15
|
+
submitPuzzleCaptchaSolution(challenge: GetPuzzleCaptchaResponse, userAccount: string, dappAccount: string, finalX: number, finalY: number, puzzleEvents: Array<{
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
t: number;
|
|
19
|
+
}>, userTimestampSignature: string, timeout?: number, behavioralData?: string, salt?: string, simdReadings?: string, clientMetaData?: ClientMetaData): Promise<PuzzleCaptchaSolutionResponse>;
|
|
20
|
+
submitPuzzleCaptchaVerify(token: string, signatureHex: string, recencyLimit: number, user: string, ip?: string, email?: string): Promise<VerificationResponse>;
|
|
11
21
|
submitUserEvents(events: StoredEvents, string: string): Promise<UpdateProviderClientsResponse>;
|
|
12
22
|
getProviderStatus(): Promise<ProviderRegistered>;
|
|
13
23
|
getProviderDetails(): Promise<Provider>;
|
|
14
|
-
registerSiteKey(siteKey: string, tier: Tier, settings: IUserSettings,
|
|
15
|
-
|
|
16
|
-
|
|
24
|
+
registerSiteKey(siteKey: string, tier: Tier, settings: IUserSettings, jwt: string): Promise<ApiResponse>;
|
|
25
|
+
registerSiteKeys(siteKeys: RegisterSitekeysBodyTypeOutput, jwt: string): Promise<ApiResponse>;
|
|
26
|
+
removeSiteKey(siteKey: string, jwt: string): Promise<ApiResponse>;
|
|
27
|
+
removeSiteKeys(siteKeys: RemoveSitekeysBodyTypeOutput, jwt: string): Promise<ApiResponse>;
|
|
28
|
+
updateDetectorKey(detectorKey: string, jwt: string): Promise<ApiResponse>;
|
|
29
|
+
removeDetectorKey(detectorKey: string, jwt: string, expirationInSeconds?: number): Promise<ApiResponse>;
|
|
30
|
+
updateDecisionMachine(scope: DecisionMachineScope, runtime: DecisionMachineRuntime, source: string, jwt: string, dappAccount?: string, language?: DecisionMachineLanguage, name?: string, version?: string, captchaType?: DecisionMachineCaptchaType): Promise<ApiResponse>;
|
|
31
|
+
getAllDecisionMachines(jwt: string): Promise<ApiResponse>;
|
|
32
|
+
getDecisionMachine(id: string, jwt: string): Promise<ApiResponse>;
|
|
33
|
+
removeDecisionMachine(id: string, jwt: string): Promise<ApiResponse>;
|
|
34
|
+
removeAllDecisionMachines(jwt: string): Promise<ApiResponse>;
|
|
17
35
|
}
|
|
18
36
|
//# sourceMappingURL=api.d.ts.map
|
package/dist/api/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api/api.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,KAAK,EACX,WAAW,EACX,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAC1B,QAAQ,EACR,kBAAkB,EAClB,cAAc,EACd,6BAA6B,EAC7B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,oBAAoB;IACpC,mBAAmB,CAClB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api/api.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACX,8BAA8B,EAC9B,4BAA4B,EAC5B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EACX,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EACX,WAAW,EACX,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,QAA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api/api.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
package/dist/api/ipapi.d.ts
CHANGED
|
@@ -79,7 +79,7 @@ export interface IPApiResponse {
|
|
|
79
79
|
is_bogon: boolean;
|
|
80
80
|
is_mobile: boolean;
|
|
81
81
|
is_satellite: boolean;
|
|
82
|
-
is_crawler: boolean
|
|
82
|
+
is_crawler: boolean;
|
|
83
83
|
is_datacenter: boolean;
|
|
84
84
|
is_tor: boolean;
|
|
85
85
|
is_proxy: boolean;
|
|
@@ -103,6 +103,7 @@ export interface IPInfoResult {
|
|
|
103
103
|
isAbuser: boolean;
|
|
104
104
|
isMobile: boolean;
|
|
105
105
|
isSatellite: boolean;
|
|
106
|
+
isCrawler: boolean;
|
|
106
107
|
providerName?: string;
|
|
107
108
|
providerType?: "hosting" | "education" | "government" | "banking" | "business" | "isp";
|
|
108
109
|
asnNumber?: number;
|