@prosopo/types 3.8.0 → 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 +19 -14
- package/.turbo/turbo-build$colon$tsc.log +8 -8
- package/.turbo/turbo-build.log +49 -44
- package/.turbo/turbo-typecheck.log +1 -1
- package/CHANGELOG.md +515 -0
- package/dist/api/api.d.ts +23 -5
- package/dist/api/api.d.ts.map +1 -1
- package/dist/api/ipapi.d.ts +2 -1
- package/dist/api/ipapi.d.ts.map +1 -1
- package/dist/api/params.d.ts +24 -1
- package/dist/api/params.d.ts.map +1 -1
- package/dist/api/params.js +23 -0
- package/dist/api/params.js.map +1 -1
- package/dist/cjs/api/params.cjs +23 -0
- package/dist/cjs/client/captchaType/captchaType.cjs +16 -0
- package/dist/cjs/client/index.cjs +17 -0
- package/dist/cjs/client/settings.cjs +83 -1
- package/dist/cjs/client/testSiteKeys.cjs +22 -0
- package/dist/cjs/config/config.cjs +25 -18
- 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/provider/api.cjs +261 -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 +4 -2
- package/dist/client/captchaType/captchaType.d.ts.map +1 -1
- package/dist/client/captchaType/captchaType.js +17 -1
- package/dist/client/captchaType/captchaType.js.map +1 -1
- 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 -1
- package/dist/client/settings.d.ts +276 -0
- package/dist/client/settings.d.ts.map +1 -1
- package/dist/client/settings.js +84 -2
- package/dist/client/settings.js.map +1 -1
- 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/config/config.d.ts +371 -27
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +25 -18
- package/dist/config/config.js.map +1 -1
- 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 -1
- 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/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 -1
- package/dist/datasets/captcha.d.ts +2 -2
- package/dist/datasets/captcha.d.ts.map +1 -1
- package/dist/datasets/captcha.js.map +1 -1
- 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 -1
- package/dist/procaptcha/api.d.ts +3 -2
- package/dist/procaptcha/api.d.ts.map +1 -1
- package/dist/procaptcha/behavioral.d.ts +13 -1
- package/dist/procaptcha/behavioral.d.ts.map +1 -1
- package/dist/procaptcha/props.d.ts +5 -0
- package/dist/procaptcha/props.d.ts.map +1 -1
- package/dist/procaptcha-bundle/index.d.ts +0 -3
- package/dist/procaptcha-bundle/index.d.ts.map +1 -1
- package/dist/procaptcha-frictionless/props.d.ts +1 -0
- package/dist/procaptcha-frictionless/props.d.ts.map +1 -1
- package/dist/provider/api.d.ts +1662 -122
- package/dist/provider/api.d.ts.map +1 -1
- package/dist/provider/api.js +261 -9
- package/dist/provider/api.js.map +1 -1
- 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/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 -1
- 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 -1
- package/package.json +6 -5
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const z = require("zod");
|
|
4
|
+
require("../client/index.cjs");
|
|
5
|
+
const mode = require("../config/mode.cjs");
|
|
6
|
+
require("../datasets/index.cjs");
|
|
7
|
+
const captcha = require("../datasets/captcha.cjs");
|
|
8
|
+
const captchaType = require("../client/captchaType/captchaType.cjs");
|
|
9
|
+
var IpAddressType = /* @__PURE__ */ ((IpAddressType2) => {
|
|
10
|
+
IpAddressType2["v4"] = "v4";
|
|
11
|
+
IpAddressType2["v6"] = "v6";
|
|
12
|
+
return IpAddressType2;
|
|
13
|
+
})(IpAddressType || {});
|
|
14
|
+
const CompositeIpAddressSchema = z.object({
|
|
15
|
+
lower: z.bigint(),
|
|
16
|
+
upper: z.bigint().optional(),
|
|
17
|
+
type: z.nativeEnum(IpAddressType)
|
|
18
|
+
});
|
|
19
|
+
const parseMongooseCompositeIpAddress = (ip) => {
|
|
20
|
+
return {
|
|
21
|
+
lower: BigInt(ip.lower.$numberDecimal ?? ip.lower),
|
|
22
|
+
upper: ip.upper ? BigInt(ip.upper?.$numberDecimal ?? ip.upper) : void 0,
|
|
23
|
+
type: ip.type
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
var CaptchaLabel = /* @__PURE__ */ ((CaptchaLabel2) => {
|
|
27
|
+
CaptchaLabel2["human"] = "human";
|
|
28
|
+
CaptchaLabel2["bot"] = "bot";
|
|
29
|
+
CaptchaLabel2["suspicious"] = "suspicious";
|
|
30
|
+
CaptchaLabel2["unknown"] = "unknown";
|
|
31
|
+
return CaptchaLabel2;
|
|
32
|
+
})(CaptchaLabel || {});
|
|
33
|
+
const CaptchaLabelSchema = z.nativeEnum(CaptchaLabel);
|
|
34
|
+
const CaptchaResultSchema = z.object({
|
|
35
|
+
status: z.nativeEnum(captcha.CaptchaStatus),
|
|
36
|
+
reason: z.string().optional().transform((v) => v),
|
|
37
|
+
error: z.string().optional()
|
|
38
|
+
});
|
|
39
|
+
const BehavioralDataPackedSchema = z.object({
|
|
40
|
+
c1: z.array(z.any()),
|
|
41
|
+
c2: z.array(z.any()),
|
|
42
|
+
c3: z.array(z.any()),
|
|
43
|
+
d: z.string()
|
|
44
|
+
});
|
|
45
|
+
const StoredCaptchaMetadataSchema = z.object({
|
|
46
|
+
email: z.string().optional()
|
|
47
|
+
});
|
|
48
|
+
const ClientMetaDataDbSchema = z.object({
|
|
49
|
+
hp: z.string().optional()
|
|
50
|
+
});
|
|
51
|
+
const UserCommitmentSchema = z.object({
|
|
52
|
+
userAccount: z.string(),
|
|
53
|
+
dappAccount: z.string(),
|
|
54
|
+
datasetId: z.string(),
|
|
55
|
+
providerAccount: z.string(),
|
|
56
|
+
id: z.string(),
|
|
57
|
+
result: CaptchaResultSchema,
|
|
58
|
+
userSignature: z.string(),
|
|
59
|
+
ipAddress: CompositeIpAddressSchema,
|
|
60
|
+
providedIp: CompositeIpAddressSchema.optional(),
|
|
61
|
+
metadata: StoredCaptchaMetadataSchema.optional(),
|
|
62
|
+
clientMetaData: ClientMetaDataDbSchema.optional(),
|
|
63
|
+
headers: z.object({}).catchall(z.string()),
|
|
64
|
+
ja4: z.string(),
|
|
65
|
+
userSubmitted: z.boolean(),
|
|
66
|
+
serverChecked: z.boolean(),
|
|
67
|
+
storedAtTimestamp: z.date().optional(),
|
|
68
|
+
requestedAtTimestamp: z.date(),
|
|
69
|
+
lastUpdatedTimestamp: z.date().optional(),
|
|
70
|
+
pendingStage: z.boolean().optional(),
|
|
71
|
+
sessionId: z.string().optional(),
|
|
72
|
+
coords: z.array(z.array(z.tuple([z.number(), z.number()]))).optional(),
|
|
73
|
+
// Pending request fields for image captcha workflow
|
|
74
|
+
pending: z.boolean(),
|
|
75
|
+
salt: z.string(),
|
|
76
|
+
requestHash: z.string(),
|
|
77
|
+
deadlineTimestamp: z.date(),
|
|
78
|
+
threshold: z.number(),
|
|
79
|
+
// Behavioral data fields
|
|
80
|
+
deviceCapability: z.string().optional(),
|
|
81
|
+
behavioralDataPacked: BehavioralDataPackedSchema.optional(),
|
|
82
|
+
// Internal ML labelling (see StoredCaptcha.label)
|
|
83
|
+
label: CaptchaLabelSchema.optional(),
|
|
84
|
+
labelReason: z.string().optional(),
|
|
85
|
+
labelledBy: z.string().optional(),
|
|
86
|
+
labelledAt: z.date().optional()
|
|
87
|
+
});
|
|
88
|
+
const ScoreComponentsSchema = z.object({
|
|
89
|
+
baseScore: z.number(),
|
|
90
|
+
lScore: z.number().optional(),
|
|
91
|
+
timeout: z.number().optional(),
|
|
92
|
+
accessPolicy: z.number().optional(),
|
|
93
|
+
unverifiedHost: z.number().optional(),
|
|
94
|
+
webView: z.number().optional(),
|
|
95
|
+
triggeredDetectors: z.array(z.number()).optional()
|
|
96
|
+
});
|
|
97
|
+
const SimdOpReadingRecordSchema = z.object({
|
|
98
|
+
name: z.string(),
|
|
99
|
+
category: z.nativeEnum({
|
|
100
|
+
FP: "FP",
|
|
101
|
+
INT: "INT",
|
|
102
|
+
BIT: "BIT",
|
|
103
|
+
PERM: "PERM"
|
|
104
|
+
}),
|
|
105
|
+
bestNs: z.number(),
|
|
106
|
+
medianNs: z.number(),
|
|
107
|
+
iters: z.number(),
|
|
108
|
+
resultLane: z.number()
|
|
109
|
+
});
|
|
110
|
+
const SimdReadingsSchema = z.union([
|
|
111
|
+
z.object({
|
|
112
|
+
supported: z.literal(false),
|
|
113
|
+
reason: z.string()
|
|
114
|
+
}),
|
|
115
|
+
z.object({
|
|
116
|
+
supported: z.literal(true),
|
|
117
|
+
schema: z.number(),
|
|
118
|
+
timerResolutionMs: z.number(),
|
|
119
|
+
runsPerOp: z.number(),
|
|
120
|
+
durationMs: z.number(),
|
|
121
|
+
ops: z.array(SimdOpReadingRecordSchema)
|
|
122
|
+
})
|
|
123
|
+
]);
|
|
124
|
+
var SimdReadingsStage = /* @__PURE__ */ ((SimdReadingsStage2) => {
|
|
125
|
+
SimdReadingsStage2["frictionless"] = "frictionless";
|
|
126
|
+
SimdReadingsStage2["challenge"] = "challenge";
|
|
127
|
+
SimdReadingsStage2["submit"] = "submit";
|
|
128
|
+
return SimdReadingsStage2;
|
|
129
|
+
})(SimdReadingsStage || {});
|
|
130
|
+
const SimdReadingsStageSchema = z.nativeEnum(SimdReadingsStage);
|
|
131
|
+
const SessionSchema = z.object({
|
|
132
|
+
sessionId: z.string(),
|
|
133
|
+
createdAt: z.date(),
|
|
134
|
+
token: z.string(),
|
|
135
|
+
score: z.number(),
|
|
136
|
+
threshold: z.number(),
|
|
137
|
+
scoreComponents: ScoreComponentsSchema,
|
|
138
|
+
providerSelectEntropy: z.number(),
|
|
139
|
+
ipAddress: CompositeIpAddressSchema,
|
|
140
|
+
captchaType: z.nativeEnum(captchaType.CaptchaType),
|
|
141
|
+
mode: z.nativeEnum(mode.ModeEnum).optional(),
|
|
142
|
+
solvedImagesCount: z.number().optional(),
|
|
143
|
+
powDifficulty: z.number().optional(),
|
|
144
|
+
storedAtTimestamp: z.date().optional(),
|
|
145
|
+
lastUpdatedTimestamp: z.date().optional(),
|
|
146
|
+
pendingStage: z.boolean().optional(),
|
|
147
|
+
deleted: z.boolean().optional(),
|
|
148
|
+
userSitekeyIpHash: z.string().optional(),
|
|
149
|
+
webView: z.boolean(),
|
|
150
|
+
iFrame: z.boolean(),
|
|
151
|
+
decryptedHeadHash: z.string(),
|
|
152
|
+
siteKey: z.string().optional(),
|
|
153
|
+
// Selection reason: writes go through `FrictionlessReason`, but the
|
|
154
|
+
// schema accepts any string at runtime so old records (or unforeseen
|
|
155
|
+
// values) still parse. Output type is cast back to the enum so the
|
|
156
|
+
// TS surface stays strict.
|
|
157
|
+
reason: z.string().optional().transform((v) => v),
|
|
158
|
+
blocked: z.boolean().optional(),
|
|
159
|
+
// Full ipinfo payload from ipInfoMiddleware at session-creation
|
|
160
|
+
// time. Replaces the flat `countryCode` / `geolocation` fields —
|
|
161
|
+
// consumers narrow on `ipInfo.isValid` and read whichever sub-field
|
|
162
|
+
// they need (countryCode, isVPN, etc.). Mirrors what's stored on
|
|
163
|
+
// captcha records (PoW / Puzzle / UserCommitment).
|
|
164
|
+
ipInfo: z.any().optional(),
|
|
165
|
+
headers: z.object({}).catchall(z.string()),
|
|
166
|
+
result: z.object({
|
|
167
|
+
status: z.nativeEnum(captcha.CaptchaStatus),
|
|
168
|
+
// See the comment on `CaptchaResultSchema.reason`: permissive at
|
|
169
|
+
// runtime, cast back to `ResultReason` on the TS surface.
|
|
170
|
+
reason: z.string().optional().transform((v) => v),
|
|
171
|
+
error: z.string().optional()
|
|
172
|
+
}).optional(),
|
|
173
|
+
userSubmitted: z.boolean().optional(),
|
|
174
|
+
serverChecked: z.boolean().optional(),
|
|
175
|
+
// WASM SIMD CPU fingerprint readings. Collection-only — used to build the
|
|
176
|
+
// training dataset for later classification. Absent on older clients.
|
|
177
|
+
simdReadings: SimdReadingsSchema.optional(),
|
|
178
|
+
// Stage at which the readings first arrived. First-hop-wins so the
|
|
179
|
+
// indicator reflects when the catcher's CPU fingerprint became
|
|
180
|
+
// available relative to the user's journey.
|
|
181
|
+
simdReadingsStage: SimdReadingsStageSchema.optional(),
|
|
182
|
+
dnsEvent: z.object({
|
|
183
|
+
resolverIp: z.string().optional(),
|
|
184
|
+
peerIp: z.string().optional(),
|
|
185
|
+
pathValid: z.boolean().optional(),
|
|
186
|
+
receivedAt: z.date()
|
|
187
|
+
}).optional()
|
|
188
|
+
});
|
|
189
|
+
const PoWCaptchaStoredSchema = z.object({
|
|
190
|
+
// From PoWCaptchaUser (extends PoWCaptcha)
|
|
191
|
+
challenge: captcha.PowChallengeIdSchema,
|
|
192
|
+
difficulty: z.number(),
|
|
193
|
+
providerSignature: z.string(),
|
|
194
|
+
userSignature: z.string().optional(),
|
|
195
|
+
score: z.number().optional(),
|
|
196
|
+
userAccount: z.string(),
|
|
197
|
+
dappAccount: z.string(),
|
|
198
|
+
// From StoredCaptcha
|
|
199
|
+
result: CaptchaResultSchema,
|
|
200
|
+
requestedAtTimestamp: z.date(),
|
|
201
|
+
ipAddress: CompositeIpAddressSchema,
|
|
202
|
+
providedIp: CompositeIpAddressSchema.optional(),
|
|
203
|
+
metadata: StoredCaptchaMetadataSchema.optional(),
|
|
204
|
+
clientMetaData: ClientMetaDataDbSchema.optional(),
|
|
205
|
+
headers: z.object({}).catchall(z.string()),
|
|
206
|
+
ja4: z.string(),
|
|
207
|
+
userSubmitted: z.boolean(),
|
|
208
|
+
serverChecked: z.boolean(),
|
|
209
|
+
// The full ipinfo payload — optional and not validated nominally
|
|
210
|
+
// because IPInfoResponse is a discriminated union and consumers
|
|
211
|
+
// only need to narrow at read time.
|
|
212
|
+
ipInfo: z.any().optional(),
|
|
213
|
+
parsedUserAgentInfo: z.any().optional(),
|
|
214
|
+
storedAtTimestamp: z.date().optional(),
|
|
215
|
+
lastUpdatedTimestamp: z.date().optional(),
|
|
216
|
+
sessionId: z.string().optional(),
|
|
217
|
+
coords: z.array(z.array(z.tuple([z.number(), z.number()]))).optional(),
|
|
218
|
+
mouseEvents: z.array(z.object({}).catchall(z.any())).optional(),
|
|
219
|
+
touchEvents: z.array(z.object({}).catchall(z.any())).optional(),
|
|
220
|
+
clickEvents: z.array(z.object({}).catchall(z.any())).optional(),
|
|
221
|
+
deviceCapability: z.string().optional(),
|
|
222
|
+
behavioralDataPacked: BehavioralDataPackedSchema.optional(),
|
|
223
|
+
// Internal ML labelling (see StoredCaptcha.label)
|
|
224
|
+
label: CaptchaLabelSchema.optional(),
|
|
225
|
+
labelReason: z.string().optional(),
|
|
226
|
+
labelledBy: z.string().optional(),
|
|
227
|
+
labelledAt: z.date().optional()
|
|
228
|
+
});
|
|
229
|
+
const UserSolutionSchema = captcha.CaptchaSolutionSchema.extend({
|
|
230
|
+
processed: z.boolean(),
|
|
231
|
+
checked: z.boolean(),
|
|
232
|
+
commitmentId: z.string(),
|
|
233
|
+
createdAt: z.date()
|
|
234
|
+
});
|
|
235
|
+
const UserCommitmentWithSolutionsSchema = UserCommitmentSchema.extend({
|
|
236
|
+
captchas: z.array(UserSolutionSchema)
|
|
237
|
+
});
|
|
238
|
+
exports.CaptchaLabel = CaptchaLabel;
|
|
239
|
+
exports.CaptchaLabelSchema = CaptchaLabelSchema;
|
|
240
|
+
exports.ClientMetaDataDbSchema = ClientMetaDataDbSchema;
|
|
241
|
+
exports.CompositeIpAddressSchema = CompositeIpAddressSchema;
|
|
242
|
+
exports.IpAddressType = IpAddressType;
|
|
243
|
+
exports.PoWCaptchaStoredSchema = PoWCaptchaStoredSchema;
|
|
244
|
+
exports.ScoreComponentsSchema = ScoreComponentsSchema;
|
|
245
|
+
exports.SessionSchema = SessionSchema;
|
|
246
|
+
exports.SimdReadingsSchema = SimdReadingsSchema;
|
|
247
|
+
exports.SimdReadingsStage = SimdReadingsStage;
|
|
248
|
+
exports.SimdReadingsStageSchema = SimdReadingsStageSchema;
|
|
249
|
+
exports.StoredCaptchaMetadataSchema = StoredCaptchaMetadataSchema;
|
|
250
|
+
exports.UserCommitmentSchema = UserCommitmentSchema;
|
|
251
|
+
exports.UserCommitmentWithSolutionsSchema = UserCommitmentWithSolutionsSchema;
|
|
252
|
+
exports.UserSolutionSchema = UserSolutionSchema;
|
|
253
|
+
exports.parseMongooseCompositeIpAddress = parseMongooseCompositeIpAddress;
|
|
@@ -4,6 +4,8 @@ require("./accounts.cjs");
|
|
|
4
4
|
const api = require("./api.cjs");
|
|
5
5
|
const scheduler = require("./scheduler.cjs");
|
|
6
6
|
require("./detection.cjs");
|
|
7
|
+
const database = require("./database.cjs");
|
|
8
|
+
const reasons = require("./reasons.cjs");
|
|
7
9
|
exports.AdminApiPaths = api.AdminApiPaths;
|
|
8
10
|
exports.ApiPathRateLimits = api.ApiPathRateLimits;
|
|
9
11
|
exports.ApiPrefix = api.ApiPrefix;
|
|
@@ -11,23 +13,64 @@ exports.BlockRuleSpec = api.BlockRuleSpec;
|
|
|
11
13
|
exports.BlockRuleType = api.BlockRuleType;
|
|
12
14
|
exports.CaptchaRequestBody = api.CaptchaRequestBody;
|
|
13
15
|
exports.CaptchaSolutionBody = api.CaptchaSolutionBody;
|
|
16
|
+
exports.ClearAllCountersBody = api.ClearAllCountersBody;
|
|
17
|
+
exports.ClearAllCountersResponse = api.ClearAllCountersResponse;
|
|
14
18
|
exports.ClientApiPaths = api.ClientApiPaths;
|
|
19
|
+
exports.ClientMetaDataSchema = api.ClientMetaDataSchema;
|
|
15
20
|
exports.DEFAULT_SOLVED_COUNT = api.DEFAULT_SOLVED_COUNT;
|
|
16
21
|
exports.DEFAULT_UNSOLVED_COUNT = api.DEFAULT_UNSOLVED_COUNT;
|
|
17
22
|
exports.DappDomainRequestBody = api.DappDomainRequestBody;
|
|
23
|
+
exports.DecisionMachineSummarySchema = api.DecisionMachineSummarySchema;
|
|
24
|
+
exports.DnsEventBatchSchema = api.DnsEventBatchSchema;
|
|
25
|
+
exports.DnsEventKindSchema = api.DnsEventKindSchema;
|
|
26
|
+
exports.DnsEventSchema = api.DnsEventSchema;
|
|
27
|
+
exports.GetAllDecisionMachinesBody = api.GetAllDecisionMachinesBody;
|
|
28
|
+
exports.GetAllDecisionMachinesResponse = api.GetAllDecisionMachinesResponse;
|
|
29
|
+
exports.GetDecisionMachineBody = api.GetDecisionMachineBody;
|
|
30
|
+
exports.GetDecisionMachineResponse = api.GetDecisionMachineResponse;
|
|
18
31
|
exports.GetFrictionlessCaptchaChallengeRequestBody = api.GetFrictionlessCaptchaChallengeRequestBody;
|
|
19
32
|
exports.GetPowCaptchaChallengeRequestBody = api.GetPowCaptchaChallengeRequestBody;
|
|
33
|
+
exports.GetPuzzleCaptchaChallengeRequestBody = api.GetPuzzleCaptchaChallengeRequestBody;
|
|
20
34
|
exports.ProsopoCaptchaCountConfigSchema = api.ProsopoCaptchaCountConfigSchema;
|
|
21
35
|
exports.ProviderDefaultRateLimits = api.ProviderDefaultRateLimits;
|
|
22
36
|
exports.PublicApiPaths = api.PublicApiPaths;
|
|
37
|
+
exports.PuzzleEventSchema = api.PuzzleEventSchema;
|
|
23
38
|
exports.RegisterSitekeyBody = api.RegisterSitekeyBody;
|
|
39
|
+
exports.RegisterSitekeysBody = api.RegisterSitekeysBody;
|
|
40
|
+
exports.RemoveAllDecisionMachinesBody = api.RemoveAllDecisionMachinesBody;
|
|
41
|
+
exports.RemoveAllDecisionMachinesResponse = api.RemoveAllDecisionMachinesResponse;
|
|
42
|
+
exports.RemoveDecisionMachineBody = api.RemoveDecisionMachineBody;
|
|
43
|
+
exports.RemoveDecisionMachineResponse = api.RemoveDecisionMachineResponse;
|
|
24
44
|
exports.RemoveDetectorKeyBodySpec = api.RemoveDetectorKeyBodySpec;
|
|
45
|
+
exports.RemoveSitekeyBody = api.RemoveSitekeyBody;
|
|
46
|
+
exports.RemoveSitekeysBody = api.RemoveSitekeysBody;
|
|
25
47
|
exports.ServerPowCaptchaVerifyRequestBody = api.ServerPowCaptchaVerifyRequestBody;
|
|
48
|
+
exports.ServerPuzzleCaptchaVerifyRequestBody = api.ServerPuzzleCaptchaVerifyRequestBody;
|
|
26
49
|
exports.SubmitPowCaptchaSolutionBody = api.SubmitPowCaptchaSolutionBody;
|
|
50
|
+
exports.SubmitPuzzleCaptchaSolutionBody = api.SubmitPuzzleCaptchaSolutionBody;
|
|
27
51
|
exports.ToggleMaintenanceModeBody = api.ToggleMaintenanceModeBody;
|
|
52
|
+
exports.UpdateDecisionMachineBody = api.UpdateDecisionMachineBody;
|
|
28
53
|
exports.UpdateDetectorKeyBody = api.UpdateDetectorKeyBody;
|
|
29
54
|
exports.VerifyPowCaptchaSolutionBody = api.VerifyPowCaptchaSolutionBody;
|
|
30
55
|
exports.VerifySolutionBody = api.VerifySolutionBody;
|
|
31
56
|
exports.providerDetailsSchema = api.providerDetailsSchema;
|
|
32
57
|
exports.ScheduledTaskNames = scheduler.ScheduledTaskNames;
|
|
33
58
|
exports.ScheduledTaskStatus = scheduler.ScheduledTaskStatus;
|
|
59
|
+
exports.CaptchaLabel = database.CaptchaLabel;
|
|
60
|
+
exports.CaptchaLabelSchema = database.CaptchaLabelSchema;
|
|
61
|
+
exports.ClientMetaDataDbSchema = database.ClientMetaDataDbSchema;
|
|
62
|
+
exports.CompositeIpAddressSchema = database.CompositeIpAddressSchema;
|
|
63
|
+
exports.IpAddressType = database.IpAddressType;
|
|
64
|
+
exports.PoWCaptchaStoredSchema = database.PoWCaptchaStoredSchema;
|
|
65
|
+
exports.ScoreComponentsSchema = database.ScoreComponentsSchema;
|
|
66
|
+
exports.SessionSchema = database.SessionSchema;
|
|
67
|
+
exports.SimdReadingsSchema = database.SimdReadingsSchema;
|
|
68
|
+
exports.SimdReadingsStage = database.SimdReadingsStage;
|
|
69
|
+
exports.SimdReadingsStageSchema = database.SimdReadingsStageSchema;
|
|
70
|
+
exports.StoredCaptchaMetadataSchema = database.StoredCaptchaMetadataSchema;
|
|
71
|
+
exports.UserCommitmentSchema = database.UserCommitmentSchema;
|
|
72
|
+
exports.UserCommitmentWithSolutionsSchema = database.UserCommitmentWithSolutionsSchema;
|
|
73
|
+
exports.UserSolutionSchema = database.UserSolutionSchema;
|
|
74
|
+
exports.parseMongooseCompositeIpAddress = database.parseMongooseCompositeIpAddress;
|
|
75
|
+
exports.FrictionlessReason = reasons.FrictionlessReason;
|
|
76
|
+
exports.ResultReason = reasons.ResultReason;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
var FrictionlessReason = /* @__PURE__ */ ((FrictionlessReason2) => {
|
|
4
|
+
FrictionlessReason2["CONTEXT_AWARE_VALIDATION_FAILED"] = "CONTEXT_AWARE_VALIDATION_FAILED";
|
|
5
|
+
FrictionlessReason2["USER_ACCESS_POLICY"] = "USER_ACCESS_POLICY";
|
|
6
|
+
FrictionlessReason2["ACCESS_POLICY_BLOCK"] = "ACCESS_POLICY_BLOCK";
|
|
7
|
+
FrictionlessReason2["USER_AGENT_MISMATCH"] = "USER_AGENT_MISMATCH";
|
|
8
|
+
FrictionlessReason2["OLD_TIMESTAMP"] = "OLD_TIMESTAMP";
|
|
9
|
+
FrictionlessReason2["BOT_SCORE_ABOVE_THRESHOLD"] = "BOT_SCORE_ABOVE_THRESHOLD";
|
|
10
|
+
FrictionlessReason2["WEBVIEW_DETECTED"] = "WEBVIEW_DETECTED";
|
|
11
|
+
FrictionlessReason2["AUTO_BAN_SCORE"] = "AUTO_BAN_SCORE";
|
|
12
|
+
return FrictionlessReason2;
|
|
13
|
+
})(FrictionlessReason || {});
|
|
14
|
+
var ResultReason = /* @__PURE__ */ ((ResultReason2) => {
|
|
15
|
+
ResultReason2["CAPTCHA_PASSED"] = "API.CAPTCHA_PASSED";
|
|
16
|
+
ResultReason2["CAPTCHA_FAILED"] = "API.CAPTCHA_FAILED";
|
|
17
|
+
ResultReason2["ABUSER_BLOCKED"] = "API.ABUSER_BLOCKED";
|
|
18
|
+
ResultReason2["ACCESS_POLICY_BLOCK"] = "API.ACCESS_POLICY_BLOCK";
|
|
19
|
+
ResultReason2["CRAWLER_BLOCKED"] = "API.CRAWLER_BLOCKED";
|
|
20
|
+
ResultReason2["DATACENTER_BLOCKED"] = "API.DATACENTER_BLOCKED";
|
|
21
|
+
ResultReason2["FAILED_IP_VALIDATION"] = "API.FAILED_IP_VALIDATION";
|
|
22
|
+
ResultReason2["INCORRECT_CAPTCHA_TYPE"] = "API.INCORRECT_CAPTCHA_TYPE";
|
|
23
|
+
ResultReason2["MOBILE_BLOCKED"] = "API.MOBILE_BLOCKED";
|
|
24
|
+
ResultReason2["PROXY_BLOCKED"] = "API.PROXY_BLOCKED";
|
|
25
|
+
ResultReason2["SATELLITE_BLOCKED"] = "API.SATELLITE_BLOCKED";
|
|
26
|
+
ResultReason2["SPAM_EMAIL_DOMAIN"] = "API.SPAM_EMAIL_DOMAIN";
|
|
27
|
+
ResultReason2["SPAM_EMAIL_RULE"] = "API.SPAM_EMAIL_RULE";
|
|
28
|
+
ResultReason2["TIMESTAMP_TOO_OLD"] = "API.TIMESTAMP_TOO_OLD";
|
|
29
|
+
ResultReason2["TOR_BLOCKED"] = "API.TOR_BLOCKED";
|
|
30
|
+
ResultReason2["VPN_BLOCKED"] = "API.VPN_BLOCKED";
|
|
31
|
+
ResultReason2["CAPTCHA_INVALID_SOLUTION"] = "CAPTCHA.INVALID_SOLUTION";
|
|
32
|
+
ResultReason2["CAPTCHA_INVALID_TIMESTAMP"] = "CAPTCHA.INVALID_TIMESTAMP";
|
|
33
|
+
ResultReason2["CAPTCHA_NO_SESSION_FOUND"] = "CAPTCHA.NO_SESSION_FOUND";
|
|
34
|
+
ResultReason2["CAPTCHA_DECISION_MACHINE_DENIED"] = "CAPTCHA.DECISION_MACHINE_DENIED";
|
|
35
|
+
ResultReason2["DISALLOWED_WEBVIEW"] = "API.DISALLOWED_WEBVIEW";
|
|
36
|
+
ResultReason2["USER_NOT_VERIFIED"] = "API.USER_NOT_VERIFIED";
|
|
37
|
+
ResultReason2["USER_VERIFIED"] = "API.USER_VERIFIED";
|
|
38
|
+
ResultReason2["EMAIL_INVALID"] = "EMAIL_INVALID";
|
|
39
|
+
ResultReason2["EMAIL_MATCHED_CUSTOM_PATTERN"] = "EMAIL_MATCHED_CUSTOM_PATTERN";
|
|
40
|
+
ResultReason2["EMAIL_MATCHED_DEFAULT_PATTERN"] = "EMAIL_MATCHED_DEFAULT_PATTERN";
|
|
41
|
+
ResultReason2["EMAIL_TOO_MANY_DOTS"] = "EMAIL_TOO_MANY_DOTS";
|
|
42
|
+
return ResultReason2;
|
|
43
|
+
})(ResultReason || {});
|
|
44
|
+
exports.FrictionlessReason = FrictionlessReason;
|
|
45
|
+
exports.ResultReason = ResultReason;
|
|
@@ -6,6 +6,7 @@ var ScheduledTaskNames = /* @__PURE__ */ ((ScheduledTaskNames2) => {
|
|
|
6
6
|
ScheduledTaskNames2["StoreCommitmentsExternal"] = "StoreCommitmentsExternal";
|
|
7
7
|
ScheduledTaskNames2["GetClientList"] = "GetClientList";
|
|
8
8
|
ScheduledTaskNames2["SetClientEntropy"] = "SetClientEntropy";
|
|
9
|
+
ScheduledTaskNames2["UpdateSpamEmailDomains"] = "UpdateSpamEmailDomains";
|
|
9
10
|
return ScheduledTaskNames2;
|
|
10
11
|
})(ScheduledTaskNames || {});
|
|
11
12
|
var ScheduledTaskStatus = /* @__PURE__ */ ((ScheduledTaskStatus2) => {
|
|
@@ -2,8 +2,10 @@ import { z } from "zod";
|
|
|
2
2
|
declare enum CaptchaType {
|
|
3
3
|
image = "image",
|
|
4
4
|
pow = "pow",
|
|
5
|
-
frictionless = "frictionless"
|
|
5
|
+
frictionless = "frictionless",
|
|
6
|
+
puzzle = "puzzle"
|
|
6
7
|
}
|
|
7
8
|
declare const CaptchaTypeSchema: z.ZodNativeEnum<typeof CaptchaType>;
|
|
8
|
-
|
|
9
|
+
declare const DecisionMachineCaptchaTypeSchema: z.ZodUnion<[z.ZodLiteral<CaptchaType.pow>, z.ZodLiteral<CaptchaType.image>, z.ZodLiteral<CaptchaType.puzzle>]>;
|
|
10
|
+
export { CaptchaType, CaptchaTypeSchema, DecisionMachineCaptchaTypeSchema };
|
|
9
11
|
//# sourceMappingURL=captchaType.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"captchaType.d.ts","sourceRoot":"","sources":["../../../src/client/captchaType/captchaType.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,aAAK,WAAW;IACf,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,YAAY,iBAAiB;
|
|
1
|
+
{"version":3,"file":"captchaType.d.ts","sourceRoot":"","sources":["../../../src/client/captchaType/captchaType.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,aAAK,WAAW;IACf,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,YAAY,iBAAiB;IAC7B,MAAM,WAAW;CACjB;AAED,QAAA,MAAM,iBAAiB,qCAA4B,CAAC;AAGpD,QAAA,MAAM,gCAAgC,gHAIpC,CAAC;AAEH,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,gCAAgC,EAAE,CAAC"}
|
|
@@ -3,10 +3,26 @@ var CaptchaType = /* @__PURE__ */ ((CaptchaType2) => {
|
|
|
3
3
|
CaptchaType2["image"] = "image";
|
|
4
4
|
CaptchaType2["pow"] = "pow";
|
|
5
5
|
CaptchaType2["frictionless"] = "frictionless";
|
|
6
|
+
CaptchaType2["puzzle"] = "puzzle";
|
|
6
7
|
return CaptchaType2;
|
|
7
8
|
})(CaptchaType || {});
|
|
8
9
|
const CaptchaTypeSchema = z.nativeEnum(CaptchaType);
|
|
10
|
+
const DecisionMachineCaptchaTypeSchema = z.union([
|
|
11
|
+
z.literal(
|
|
12
|
+
"pow"
|
|
13
|
+
/* pow */
|
|
14
|
+
),
|
|
15
|
+
z.literal(
|
|
16
|
+
"image"
|
|
17
|
+
/* image */
|
|
18
|
+
),
|
|
19
|
+
z.literal(
|
|
20
|
+
"puzzle"
|
|
21
|
+
/* puzzle */
|
|
22
|
+
)
|
|
23
|
+
]);
|
|
9
24
|
export {
|
|
10
25
|
CaptchaType,
|
|
11
|
-
CaptchaTypeSchema
|
|
26
|
+
CaptchaTypeSchema,
|
|
27
|
+
DecisionMachineCaptchaTypeSchema
|
|
12
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"captchaType.js","sourceRoot":"","sources":["../../../src/client/captchaType/captchaType.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,IAAK,
|
|
1
|
+
{"version":3,"file":"captchaType.js","sourceRoot":"","sources":["../../../src/client/captchaType/captchaType.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,IAAK,WAKJ;AALD,WAAK,WAAW;IACf,8BAAe,CAAA;IACf,0BAAW,CAAA;IACX,4CAA6B,CAAA;IAC7B,gCAAiB,CAAA;AAClB,CAAC,EALI,WAAW,KAAX,WAAW,QAKf;AAED,MAAM,iBAAiB,GAAG,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAGpD,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC;IAChD,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC;IAC1B,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC;IAC5B,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC;CAC7B,CAAC,CAAC;AAEH,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,gCAAgC,EAAE,CAAC"}
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAaA,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAaA,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC"}
|
package/dist/client/index.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { Tier, TierMonthlyLimits, TierSchema } from "./user.js";
|
|
2
|
-
import { ClientSettingsSchema, ContextConfigSchema, ContextType, ContextTypeSchema, IPValidationAction, IPValidationActionSchema, IPValidationRulesSchema, abuseScoreThresholdDefault, abuseScoreThresholdExceedActionDefault, captchaTypeDefault, cityChangeActionDefault, contextAwareThresholdDefault, countryChangeActionDefault, distanceExceedActionDefault, distanceThresholdKmDefault, domainsDefault, frictionlessThresholdDefault, imageThresholdDefault, ispChangeActionDefault, powDifficultyDefault, requireAllConditionsDefault } from "./settings.js";
|
|
3
|
-
import {
|
|
2
|
+
import { ClientSettingsSchema, ContextConfigSchema, ContextType, ContextTypeSchema, EmailSpamRulesSchema, EncodingType, EncodingTypeSchema, HoneypotSettingsSchema, IPValidationAction, IPValidationActionSchema, IPValidationRulesSchema, SpamFilterRulesSchema, TrafficFilterSchema, abuseScoreThresholdDefault, abuseScoreThresholdExceedActionDefault, captchaTypeDefault, cityChangeActionDefault, contextAwareThresholdDefault, countryChangeActionDefault, distanceExceedActionDefault, distanceThresholdKmDefault, domainsDefault, frictionlessThresholdDefault, honeypotEncodingTypeDefault, imageMaxRoundsDefault, imageThresholdDefault, ispChangeActionDefault, maxLocalPartDotsDefault, powDifficultyDefault, puzzleToleranceDefault, requireAllConditionsDefault, trafficFilterAbuserScoreThresholdDefault } from "./settings.js";
|
|
3
|
+
import { ALWAYS_FAIL_SITE_KEY, ALWAYS_PASS_SITE_KEY, TestSiteKeyMode, getTestSiteKeyMode } from "./testSiteKeys.js";
|
|
4
|
+
import { CaptchaType, CaptchaTypeSchema, DecisionMachineCaptchaTypeSchema } from "./captchaType/captchaType.js";
|
|
4
5
|
import { CaptchaTypeSpec } from "./captchaType/captchaTypeSpec.js";
|
|
5
6
|
export {
|
|
7
|
+
ALWAYS_FAIL_SITE_KEY,
|
|
8
|
+
ALWAYS_PASS_SITE_KEY,
|
|
6
9
|
CaptchaType,
|
|
7
10
|
CaptchaTypeSchema,
|
|
8
11
|
CaptchaTypeSpec,
|
|
@@ -10,12 +13,20 @@ export {
|
|
|
10
13
|
ContextConfigSchema,
|
|
11
14
|
ContextType,
|
|
12
15
|
ContextTypeSchema,
|
|
16
|
+
DecisionMachineCaptchaTypeSchema,
|
|
17
|
+
EmailSpamRulesSchema,
|
|
18
|
+
EncodingType,
|
|
19
|
+
EncodingTypeSchema,
|
|
20
|
+
HoneypotSettingsSchema,
|
|
13
21
|
IPValidationAction,
|
|
14
22
|
IPValidationActionSchema,
|
|
15
23
|
IPValidationRulesSchema,
|
|
24
|
+
SpamFilterRulesSchema,
|
|
25
|
+
TestSiteKeyMode,
|
|
16
26
|
Tier,
|
|
17
27
|
TierMonthlyLimits,
|
|
18
28
|
TierSchema,
|
|
29
|
+
TrafficFilterSchema,
|
|
19
30
|
abuseScoreThresholdDefault,
|
|
20
31
|
abuseScoreThresholdExceedActionDefault,
|
|
21
32
|
captchaTypeDefault,
|
|
@@ -26,8 +37,14 @@ export {
|
|
|
26
37
|
distanceThresholdKmDefault,
|
|
27
38
|
domainsDefault,
|
|
28
39
|
frictionlessThresholdDefault,
|
|
40
|
+
getTestSiteKeyMode,
|
|
41
|
+
honeypotEncodingTypeDefault,
|
|
42
|
+
imageMaxRoundsDefault,
|
|
29
43
|
imageThresholdDefault,
|
|
30
44
|
ispChangeActionDefault,
|
|
45
|
+
maxLocalPartDotsDefault,
|
|
31
46
|
powDifficultyDefault,
|
|
32
|
-
|
|
47
|
+
puzzleToleranceDefault,
|
|
48
|
+
requireAllConditionsDefault,
|
|
49
|
+
trafficFilterAbuserScoreThresholdDefault
|
|
33
50
|
};
|
package/dist/client/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAaA,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAaA,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC"}
|