@prosopo/types 3.5.11 → 3.6.3
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/CHANGELOG.md +49 -0
- package/dist/api/api.js +1 -2
- package/dist/api/index.js +6 -4
- package/dist/api/ipapi.js +1 -2
- package/dist/api/params.js +46 -44
- package/dist/cjs/client/index.cjs +1 -0
- package/dist/cjs/client/settings.cjs +7 -1
- package/dist/cjs/config/config.cjs +5 -1
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/provider/scheduler.cjs +1 -0
- package/dist/client/captchaType/captchaType.js +11 -9
- package/dist/client/captchaType/captchaTypeSpec.js +3 -2
- package/dist/client/index.js +30 -5
- package/dist/client/settings.d.ts +21 -2
- package/dist/client/settings.d.ts.map +1 -1
- package/dist/client/settings.js +89 -66
- package/dist/client/user.js +31 -18
- package/dist/config/config.d.ts +22 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +185 -166
- package/dist/config/frictionless.js +17 -23
- package/dist/config/index.js +37 -5
- package/dist/config/network.js +9 -7
- package/dist/config/timeouts.js +19 -10
- package/dist/datasets/assets.js +1 -2
- package/dist/datasets/captcha.d.ts +14 -14
- package/dist/datasets/captcha.js +122 -94
- package/dist/datasets/dataset.d.ts +18 -18
- package/dist/datasets/dataset.js +28 -23
- package/dist/datasets/index.js +36 -5
- package/dist/datasets/merkle.js +1 -2
- package/dist/index.js +149 -10
- package/dist/keyring/index.js +2 -3
- package/dist/keyring/keyring/types.js +1 -2
- package/dist/keyring/pair/types.js +1 -2
- package/dist/procaptcha/api.js +1 -2
- package/dist/procaptcha/client.js +1 -2
- package/dist/procaptcha/collector.js +1 -2
- package/dist/procaptcha/index.js +19 -8
- package/dist/procaptcha/manager.js +7 -4
- package/dist/procaptcha/props.js +1 -2
- package/dist/procaptcha/token.js +77 -62
- package/dist/procaptcha/utils.js +1 -2
- package/dist/procaptcha-bundle/index.js +1 -2
- package/dist/procaptcha-frictionless/index.js +1 -2
- package/dist/procaptcha-frictionless/props.js +1 -2
- package/dist/provider/accounts.js +1 -2
- package/dist/provider/api.d.ts +29 -3
- package/dist/provider/api.d.ts.map +1 -1
- package/dist/provider/api.js +245 -176
- package/dist/provider/detection.js +1 -2
- package/dist/provider/index.js +33 -5
- package/dist/provider/scheduler.d.ts +2 -1
- package/dist/provider/scheduler.d.ts.map +1 -1
- package/dist/provider/scheduler.js +19 -15
- package/package.json +7 -7
- package/dist/api/api.js.map +0 -1
- package/dist/api/index.js.map +0 -1
- package/dist/api/ipapi.js.map +0 -1
- package/dist/api/params.js.map +0 -1
- package/dist/client/captchaType/captchaType.js.map +0 -1
- package/dist/client/captchaType/captchaTypeSpec.js.map +0 -1
- package/dist/client/index.js.map +0 -1
- package/dist/client/settings.js.map +0 -1
- package/dist/client/user.js.map +0 -1
- package/dist/config/config.js.map +0 -1
- package/dist/config/enumMap.js +0 -6
- package/dist/config/enumMap.js.map +0 -1
- package/dist/config/frictionless.js.map +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/config/network.js.map +0 -1
- package/dist/config/timeouts.js.map +0 -1
- package/dist/datasets/assets.js.map +0 -1
- package/dist/datasets/captcha.js.map +0 -1
- package/dist/datasets/dataset.js.map +0 -1
- package/dist/datasets/index.js.map +0 -1
- package/dist/datasets/merkle.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/keyring/index.js.map +0 -1
- package/dist/keyring/keyring/types.js.map +0 -1
- package/dist/keyring/pair/types.js.map +0 -1
- package/dist/procaptcha/api.js.map +0 -1
- package/dist/procaptcha/client.js.map +0 -1
- package/dist/procaptcha/collector.js.map +0 -1
- package/dist/procaptcha/index.js.map +0 -1
- package/dist/procaptcha/manager.js.map +0 -1
- package/dist/procaptcha/props.js.map +0 -1
- package/dist/procaptcha/token.js.map +0 -1
- package/dist/procaptcha/utils.js.map +0 -1
- package/dist/procaptcha-bundle/index.js.map +0 -1
- package/dist/procaptcha-frictionless/index.js.map +0 -1
- package/dist/procaptcha-frictionless/props.js.map +0 -1
- package/dist/provider/accounts.js.map +0 -1
- package/dist/provider/api.js.map +0 -1
- package/dist/provider/detection.js.map +0 -1
- package/dist/provider/index.js.map +0 -1
- package/dist/provider/scheduler.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# @prosopo/types
|
|
2
2
|
|
|
3
|
+
## 3.6.3
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- 93d92a7: little bump for publish all
|
|
7
|
+
- Updated dependencies [93d92a7]
|
|
8
|
+
- @prosopo/locale@3.1.25
|
|
9
|
+
- @prosopo/util@3.2.3
|
|
10
|
+
- @prosopo/util-crypto@13.5.27
|
|
11
|
+
|
|
12
|
+
## 3.6.2
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 8ee8434: bump node engines to 24 and npm version to 11
|
|
16
|
+
- cfee479: make @prosopo/config a dev dep
|
|
17
|
+
- Updated dependencies [8ee8434]
|
|
18
|
+
- Updated dependencies [cfee479]
|
|
19
|
+
- @prosopo/util-crypto@13.5.26
|
|
20
|
+
- @prosopo/locale@3.1.24
|
|
21
|
+
- @prosopo/util@3.2.2
|
|
22
|
+
|
|
23
|
+
## 3.6.1
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- e926831: mega mini bump for all to trigger publish all
|
|
27
|
+
- Updated dependencies [e926831]
|
|
28
|
+
- @prosopo/config@3.1.23
|
|
29
|
+
- @prosopo/locale@3.1.23
|
|
30
|
+
- @prosopo/util@3.2.1
|
|
31
|
+
- @prosopo/util-crypto@13.5.25
|
|
32
|
+
|
|
33
|
+
## 3.6.0
|
|
34
|
+
### Minor Changes
|
|
35
|
+
|
|
36
|
+
- bb5f41c: Context awareness
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- 15ae7cf: Change slider defaults
|
|
41
|
+
- 8ce9205: Change engine requirements
|
|
42
|
+
- b6e98b2: Run npm audit
|
|
43
|
+
- Updated dependencies [bb5f41c]
|
|
44
|
+
- Updated dependencies [8ce9205]
|
|
45
|
+
- Updated dependencies [df79c03]
|
|
46
|
+
- Updated dependencies [b6e98b2]
|
|
47
|
+
- @prosopo/util@3.2.0
|
|
48
|
+
- @prosopo/util-crypto@13.5.24
|
|
49
|
+
- @prosopo/locale@3.1.22
|
|
50
|
+
- @prosopo/config@3.1.22
|
|
51
|
+
|
|
3
52
|
## 3.5.11
|
|
4
53
|
### Patch Changes
|
|
5
54
|
|
package/dist/api/api.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=api.js.map
|
|
1
|
+
|
package/dist/api/index.js
CHANGED
package/dist/api/ipapi.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=ipapi.js.map
|
|
1
|
+
|
package/dist/api/params.js
CHANGED
|
@@ -1,44 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
})(ApiParams ||
|
|
44
|
-
|
|
1
|
+
var ApiParams = /* @__PURE__ */ ((ApiParams2) => {
|
|
2
|
+
ApiParams2["datasetId"] = "datasetId";
|
|
3
|
+
ApiParams2["user"] = "user";
|
|
4
|
+
ApiParams2["dapp"] = "dapp";
|
|
5
|
+
ApiParams2["provider"] = "provider";
|
|
6
|
+
ApiParams2["blockNumber"] = "blockNumber";
|
|
7
|
+
ApiParams2["requestHash"] = "requestHash";
|
|
8
|
+
ApiParams2["captchas"] = "captchas";
|
|
9
|
+
ApiParams2["commitmentId"] = "commitmentId";
|
|
10
|
+
ApiParams2["proof"] = "proof";
|
|
11
|
+
ApiParams2["dappSignature"] = "dappSignature";
|
|
12
|
+
ApiParams2["dappUserSignature"] = "dappUserSignature";
|
|
13
|
+
ApiParams2["providerUrl"] = "providerUrl";
|
|
14
|
+
ApiParams2["procaptchaResponse"] = "procaptcha-response";
|
|
15
|
+
ApiParams2["verifiedTimeout"] = "verifiedTimeout";
|
|
16
|
+
ApiParams2["maxVerifiedTime"] = "maxVerifiedTime";
|
|
17
|
+
ApiParams2["verified"] = "verified";
|
|
18
|
+
ApiParams2["status"] = "status";
|
|
19
|
+
ApiParams2["challenge"] = "challenge";
|
|
20
|
+
ApiParams2["difficulty"] = "difficulty";
|
|
21
|
+
ApiParams2["nonce"] = "nonce";
|
|
22
|
+
ApiParams2["timeouts"] = "timeouts";
|
|
23
|
+
ApiParams2["token"] = "token";
|
|
24
|
+
ApiParams2["secret"] = "secret";
|
|
25
|
+
ApiParams2["timestamp"] = "timestamp";
|
|
26
|
+
ApiParams2["signature"] = "signature";
|
|
27
|
+
ApiParams2["error"] = "error";
|
|
28
|
+
ApiParams2["siteKey"] = "siteKey";
|
|
29
|
+
ApiParams2["captchaType"] = "captchaType";
|
|
30
|
+
ApiParams2["sessionId"] = "sessionId";
|
|
31
|
+
ApiParams2["settings"] = "settings";
|
|
32
|
+
ApiParams2["domains"] = "domains";
|
|
33
|
+
ApiParams2["frictionlessThreshold"] = "frictionlessThreshold";
|
|
34
|
+
ApiParams2["powDifficulty"] = "powDifficulty";
|
|
35
|
+
ApiParams2["score"] = "score";
|
|
36
|
+
ApiParams2["tier"] = "tier";
|
|
37
|
+
ApiParams2["detectorKey"] = "detectorKey";
|
|
38
|
+
ApiParams2["ip"] = "ip";
|
|
39
|
+
ApiParams2["expirationInSeconds"] = "expirationInSeconds";
|
|
40
|
+
ApiParams2["enabled"] = "enabled";
|
|
41
|
+
ApiParams2["headHash"] = "headHash";
|
|
42
|
+
return ApiParams2;
|
|
43
|
+
})(ApiParams || {});
|
|
44
|
+
export {
|
|
45
|
+
ApiParams
|
|
46
|
+
};
|
|
@@ -15,6 +15,7 @@ exports.abuseScoreThresholdDefault = settings.abuseScoreThresholdDefault;
|
|
|
15
15
|
exports.abuseScoreThresholdExceedActionDefault = settings.abuseScoreThresholdExceedActionDefault;
|
|
16
16
|
exports.captchaTypeDefault = settings.captchaTypeDefault;
|
|
17
17
|
exports.cityChangeActionDefault = settings.cityChangeActionDefault;
|
|
18
|
+
exports.contextAwareThresholdDefault = settings.contextAwareThresholdDefault;
|
|
18
19
|
exports.countryChangeActionDefault = settings.countryChangeActionDefault;
|
|
19
20
|
exports.distanceExceedActionDefault = settings.distanceExceedActionDefault;
|
|
20
21
|
exports.distanceThresholdKmDefault = settings.distanceThresholdKmDefault;
|
|
@@ -8,6 +8,7 @@ const domainsDefault = [];
|
|
|
8
8
|
const frictionlessThresholdDefault = 0.5;
|
|
9
9
|
const powDifficultyDefault = 4;
|
|
10
10
|
const imageThresholdDefault = 0.8;
|
|
11
|
+
const contextAwareThresholdDefault = 0.7;
|
|
11
12
|
var IPValidationAction = /* @__PURE__ */ ((IPValidationAction2) => {
|
|
12
13
|
IPValidationAction2["Allow"] = "allow";
|
|
13
14
|
IPValidationAction2["Reject"] = "reject";
|
|
@@ -68,7 +69,11 @@ const ClientSettingsSchema = z.object({
|
|
|
68
69
|
powDifficulty: z.number().optional().default(powDifficultyDefault),
|
|
69
70
|
imageThreshold: z.number().optional().default(imageThresholdDefault),
|
|
70
71
|
ipValidationRules: IPValidationRulesSchema.optional(),
|
|
71
|
-
disallowWebView: z.boolean().optional().default(false)
|
|
72
|
+
disallowWebView: z.boolean().optional().default(false).optional(),
|
|
73
|
+
contextAware: z.z.object({
|
|
74
|
+
enabled: z.boolean().optional().default(false),
|
|
75
|
+
threshold: z.number().optional().default(contextAwareThresholdDefault)
|
|
76
|
+
}).optional()
|
|
72
77
|
});
|
|
73
78
|
exports.ClientSettingsSchema = ClientSettingsSchema;
|
|
74
79
|
exports.IPValidationAction = IPValidationAction;
|
|
@@ -78,6 +83,7 @@ exports.abuseScoreThresholdDefault = abuseScoreThresholdDefault;
|
|
|
78
83
|
exports.abuseScoreThresholdExceedActionDefault = abuseScoreThresholdExceedActionDefault;
|
|
79
84
|
exports.captchaTypeDefault = captchaTypeDefault;
|
|
80
85
|
exports.cityChangeActionDefault = cityChangeActionDefault;
|
|
86
|
+
exports.contextAwareThresholdDefault = contextAwareThresholdDefault;
|
|
81
87
|
exports.countryChangeActionDefault = countryChangeActionDefault;
|
|
82
88
|
exports.distanceExceedActionDefault = distanceExceedActionDefault;
|
|
83
89
|
exports.distanceThresholdKmDefault = distanceThresholdKmDefault;
|
|
@@ -162,7 +162,8 @@ const ProcaptchaConfigSchema = ProsopoClientConfigSchema.and(
|
|
|
162
162
|
mode: Mode.optional().default(
|
|
163
163
|
"visible"
|
|
164
164
|
/* visible */
|
|
165
|
-
)
|
|
165
|
+
),
|
|
166
|
+
contextAware: z.boolean().optional().default(false)
|
|
166
167
|
})
|
|
167
168
|
);
|
|
168
169
|
const IpApiServiceSpec = z.object({
|
|
@@ -188,6 +189,9 @@ const ProsopoConfigSchema = ProsopoBasicConfigSchema.merge(
|
|
|
188
189
|
}).optional(),
|
|
189
190
|
clientListScheduler: z.object({
|
|
190
191
|
schedule: z.string().optional()
|
|
192
|
+
}).optional(),
|
|
193
|
+
clientEntropyScheduler: z.object({
|
|
194
|
+
schedule: z.string().optional()
|
|
191
195
|
}).optional()
|
|
192
196
|
}).optional(),
|
|
193
197
|
server: ProsopoApiConfigSchema.optional(),
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -36,6 +36,7 @@ exports.abuseScoreThresholdDefault = settings.abuseScoreThresholdDefault;
|
|
|
36
36
|
exports.abuseScoreThresholdExceedActionDefault = settings.abuseScoreThresholdExceedActionDefault;
|
|
37
37
|
exports.captchaTypeDefault = settings.captchaTypeDefault;
|
|
38
38
|
exports.cityChangeActionDefault = settings.cityChangeActionDefault;
|
|
39
|
+
exports.contextAwareThresholdDefault = settings.contextAwareThresholdDefault;
|
|
39
40
|
exports.countryChangeActionDefault = settings.countryChangeActionDefault;
|
|
40
41
|
exports.distanceExceedActionDefault = settings.distanceExceedActionDefault;
|
|
41
42
|
exports.distanceThresholdKmDefault = settings.distanceThresholdKmDefault;
|
|
@@ -5,6 +5,7 @@ var ScheduledTaskNames = /* @__PURE__ */ ((ScheduledTaskNames2) => {
|
|
|
5
5
|
ScheduledTaskNames2["CalculateSolution"] = "CalculateSolution";
|
|
6
6
|
ScheduledTaskNames2["StoreCommitmentsExternal"] = "StoreCommitmentsExternal";
|
|
7
7
|
ScheduledTaskNames2["GetClientList"] = "GetClientList";
|
|
8
|
+
ScheduledTaskNames2["SetClientEntropy"] = "SetClientEntropy";
|
|
8
9
|
return ScheduledTaskNames2;
|
|
9
10
|
})(ScheduledTaskNames || {});
|
|
10
11
|
var ScheduledTaskStatus = /* @__PURE__ */ ((ScheduledTaskStatus2) => {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
var CaptchaType
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
})(CaptchaType ||
|
|
2
|
+
var CaptchaType = /* @__PURE__ */ ((CaptchaType2) => {
|
|
3
|
+
CaptchaType2["image"] = "image";
|
|
4
|
+
CaptchaType2["pow"] = "pow";
|
|
5
|
+
CaptchaType2["frictionless"] = "frictionless";
|
|
6
|
+
CaptchaType2["invisible"] = "invisible";
|
|
7
|
+
return CaptchaType2;
|
|
8
|
+
})(CaptchaType || {});
|
|
9
9
|
const CaptchaTypeSchema = z.nativeEnum(CaptchaType);
|
|
10
|
-
export {
|
|
11
|
-
|
|
10
|
+
export {
|
|
11
|
+
CaptchaType,
|
|
12
|
+
CaptchaTypeSchema
|
|
13
|
+
};
|
package/dist/client/index.js
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { Tier, TierMonthlyLimits, TierSchema } from "./user.js";
|
|
2
|
+
import { ClientSettingsSchema, IPValidationAction, IPValidationActionSchema, IPValidationRulesSchema, abuseScoreThresholdDefault, abuseScoreThresholdExceedActionDefault, captchaTypeDefault, cityChangeActionDefault, contextAwareThresholdDefault, countryChangeActionDefault, distanceExceedActionDefault, distanceThresholdKmDefault, domainsDefault, frictionlessThresholdDefault, imageThresholdDefault, ispChangeActionDefault, powDifficultyDefault, requireAllConditionsDefault } from "./settings.js";
|
|
3
|
+
import { CaptchaType, CaptchaTypeSchema } from "./captchaType/captchaType.js";
|
|
4
|
+
import { CaptchaTypeSpec } from "./captchaType/captchaTypeSpec.js";
|
|
5
|
+
export {
|
|
6
|
+
CaptchaType,
|
|
7
|
+
CaptchaTypeSchema,
|
|
8
|
+
CaptchaTypeSpec,
|
|
9
|
+
ClientSettingsSchema,
|
|
10
|
+
IPValidationAction,
|
|
11
|
+
IPValidationActionSchema,
|
|
12
|
+
IPValidationRulesSchema,
|
|
13
|
+
Tier,
|
|
14
|
+
TierMonthlyLimits,
|
|
15
|
+
TierSchema,
|
|
16
|
+
abuseScoreThresholdDefault,
|
|
17
|
+
abuseScoreThresholdExceedActionDefault,
|
|
18
|
+
captchaTypeDefault,
|
|
19
|
+
cityChangeActionDefault,
|
|
20
|
+
contextAwareThresholdDefault,
|
|
21
|
+
countryChangeActionDefault,
|
|
22
|
+
distanceExceedActionDefault,
|
|
23
|
+
distanceThresholdKmDefault,
|
|
24
|
+
domainsDefault,
|
|
25
|
+
frictionlessThresholdDefault,
|
|
26
|
+
imageThresholdDefault,
|
|
27
|
+
ispChangeActionDefault,
|
|
28
|
+
powDifficultyDefault,
|
|
29
|
+
requireAllConditionsDefault
|
|
30
|
+
};
|
|
@@ -5,6 +5,7 @@ export declare const domainsDefault: string[];
|
|
|
5
5
|
export declare const frictionlessThresholdDefault = 0.5;
|
|
6
6
|
export declare const powDifficultyDefault = 4;
|
|
7
7
|
export declare const imageThresholdDefault = 0.8;
|
|
8
|
+
export declare const contextAwareThresholdDefault = 0.7;
|
|
8
9
|
export declare enum IPValidationAction {
|
|
9
10
|
Allow = "allow",
|
|
10
11
|
Reject = "reject",
|
|
@@ -314,14 +315,23 @@ export declare const ClientSettingsSchema: z.ZodObject<{
|
|
|
314
315
|
}> | undefined;
|
|
315
316
|
forceConsistentIp?: boolean | undefined;
|
|
316
317
|
}>>;
|
|
317
|
-
disallowWebView: z.ZodDefault<z.ZodOptional<z.ZodBoolean
|
|
318
|
+
disallowWebView: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
319
|
+
contextAware: z.ZodOptional<z.ZodObject<{
|
|
320
|
+
enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
321
|
+
threshold: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
322
|
+
}, "strip", z.ZodTypeAny, {
|
|
323
|
+
enabled: boolean;
|
|
324
|
+
threshold: number;
|
|
325
|
+
}, {
|
|
326
|
+
enabled?: boolean | undefined;
|
|
327
|
+
threshold?: number | undefined;
|
|
328
|
+
}>>;
|
|
318
329
|
}, "strip", z.ZodTypeAny, {
|
|
319
330
|
captchaType: CaptchaType;
|
|
320
331
|
domains: string[];
|
|
321
332
|
frictionlessThreshold: number;
|
|
322
333
|
powDifficulty: number;
|
|
323
334
|
imageThreshold: number;
|
|
324
|
-
disallowWebView: boolean;
|
|
325
335
|
ipValidationRules?: {
|
|
326
336
|
actions: {
|
|
327
337
|
countryChangeAction: IPValidationAction;
|
|
@@ -347,6 +357,11 @@ export declare const ClientSettingsSchema: z.ZodObject<{
|
|
|
347
357
|
requireAllConditions?: boolean | undefined;
|
|
348
358
|
}> | undefined;
|
|
349
359
|
} | undefined;
|
|
360
|
+
disallowWebView?: boolean | undefined;
|
|
361
|
+
contextAware?: {
|
|
362
|
+
enabled: boolean;
|
|
363
|
+
threshold: number;
|
|
364
|
+
} | undefined;
|
|
350
365
|
}, {
|
|
351
366
|
captchaType?: CaptchaType | undefined;
|
|
352
367
|
domains?: string[] | undefined;
|
|
@@ -379,6 +394,10 @@ export declare const ClientSettingsSchema: z.ZodObject<{
|
|
|
379
394
|
forceConsistentIp?: boolean | undefined;
|
|
380
395
|
} | undefined;
|
|
381
396
|
disallowWebView?: boolean | undefined;
|
|
397
|
+
contextAware?: {
|
|
398
|
+
enabled?: boolean | undefined;
|
|
399
|
+
threshold?: number | undefined;
|
|
400
|
+
} | undefined;
|
|
382
401
|
}>;
|
|
383
402
|
export type IUserSettings = output<typeof ClientSettingsSchema>;
|
|
384
403
|
export type IIPValidationRules = output<typeof IPValidationRulesSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/client/settings.ts"],"names":[],"mappings":"AAaA,OAAO,EAAkC,KAAK,MAAM,EAAU,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,eAAO,MAAM,kBAAkB,2BAA2B,CAAC;AAC3D,eAAO,MAAM,cAAc,EAAE,MAAM,EAAO,CAAC;AAC3C,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAChD,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,qBAAqB,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/client/settings.ts"],"names":[],"mappings":"AAaA,OAAO,EAAkC,KAAK,MAAM,EAAU,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,eAAO,MAAM,kBAAkB,2BAA2B,CAAC;AAC3D,eAAO,MAAM,cAAc,EAAE,MAAM,EAAO,CAAC;AAC3C,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAChD,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAGhD,oBAAY,kBAAkB;IAC7B,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,IAAI,SAAS;CACb;AAED,MAAM,MAAM,mBAAmB,GAAG;IACjC,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,wBAAwB,4CAAmC,CAAC;AAGzE,eAAO,MAAM,0BAA0B,2BAA2B,CAAC;AACnE,eAAO,MAAM,uBAAuB,2BAA2B,CAAC;AAChE,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAC/D,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAC/C,eAAO,MAAM,0BAA0B,QAAQ,CAAC;AAChD,eAAO,MAAM,2BAA2B,4BAA4B,CAAC;AACrE,eAAO,MAAM,sCAAsC,4BAA4B,CAAC;AAChF,eAAO,MAAM,2BAA2B,QAAQ,CAAC;AAEjD,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYtB,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiClC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkB/B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
package/dist/client/settings.js
CHANGED
|
@@ -1,72 +1,95 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z, object, boolean, number, string, array } from "zod";
|
|
2
2
|
import { CaptchaType } from "./captchaType/captchaType.js";
|
|
3
3
|
import { CaptchaTypeSpec } from "./captchaType/captchaTypeSpec.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
4
|
+
const captchaTypeDefault = CaptchaType.frictionless;
|
|
5
|
+
const domainsDefault = [];
|
|
6
|
+
const frictionlessThresholdDefault = 0.5;
|
|
7
|
+
const powDifficultyDefault = 4;
|
|
8
|
+
const imageThresholdDefault = 0.8;
|
|
9
|
+
const contextAwareThresholdDefault = 0.7;
|
|
10
|
+
var IPValidationAction = /* @__PURE__ */ ((IPValidationAction2) => {
|
|
11
|
+
IPValidationAction2["Allow"] = "allow";
|
|
12
|
+
IPValidationAction2["Reject"] = "reject";
|
|
13
|
+
IPValidationAction2["Flag"] = "flag";
|
|
14
|
+
return IPValidationAction2;
|
|
15
|
+
})(IPValidationAction || {});
|
|
16
|
+
const IPValidationActionSchema = z.nativeEnum(IPValidationAction);
|
|
17
|
+
const countryChangeActionDefault = "allow";
|
|
18
|
+
const cityChangeActionDefault = "allow";
|
|
19
|
+
const ispChangeActionDefault = "allow";
|
|
20
|
+
const distanceThresholdKmDefault = 1e3;
|
|
21
|
+
const abuseScoreThresholdDefault = 5e-3;
|
|
22
|
+
const distanceExceedActionDefault = "reject";
|
|
23
|
+
const abuseScoreThresholdExceedActionDefault = "reject";
|
|
24
|
+
const requireAllConditionsDefault = false;
|
|
24
25
|
const IPValidationSchema = object({
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
actions: object({
|
|
27
|
+
countryChangeAction: IPValidationActionSchema.optional(),
|
|
28
|
+
cityChangeAction: IPValidationActionSchema.optional(),
|
|
29
|
+
ispChangeAction: IPValidationActionSchema.optional(),
|
|
30
|
+
distanceExceedAction: IPValidationActionSchema.optional(),
|
|
31
|
+
abuseScoreExceedAction: IPValidationActionSchema.optional()
|
|
32
|
+
}).partial(),
|
|
33
|
+
// all optional, so you can just override what you need
|
|
34
|
+
distanceThresholdKm: number().positive().optional(),
|
|
35
|
+
abuseScoreThreshold: number().positive().optional(),
|
|
36
|
+
requireAllConditions: boolean().optional()
|
|
35
37
|
});
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
38
|
+
const IPValidationRulesSchema = object({
|
|
39
|
+
actions: object({
|
|
40
|
+
countryChangeAction: IPValidationActionSchema.optional().default(
|
|
41
|
+
countryChangeActionDefault
|
|
42
|
+
),
|
|
43
|
+
cityChangeAction: IPValidationActionSchema.optional().default(
|
|
44
|
+
cityChangeActionDefault
|
|
45
|
+
),
|
|
46
|
+
ispChangeAction: IPValidationActionSchema.optional().default(
|
|
47
|
+
ispChangeActionDefault
|
|
48
|
+
),
|
|
49
|
+
distanceExceedAction: IPValidationActionSchema.optional().default(
|
|
50
|
+
distanceExceedActionDefault
|
|
51
|
+
),
|
|
52
|
+
abuseScoreExceedAction: IPValidationActionSchema.optional().default(
|
|
53
|
+
abuseScoreThresholdExceedActionDefault
|
|
54
|
+
)
|
|
55
|
+
}),
|
|
56
|
+
distanceThresholdKm: number().positive().optional().default(distanceThresholdKmDefault),
|
|
57
|
+
abuseScoreThreshold: number().positive().optional().default(abuseScoreThresholdDefault),
|
|
58
|
+
requireAllConditions: z.boolean().optional().default(requireAllConditionsDefault),
|
|
59
|
+
// overrides are now lightweight, not recursive
|
|
60
|
+
countryOverrides: z.record(string(), IPValidationSchema).optional(),
|
|
61
|
+
forceConsistentIp: boolean().optional().default(false)
|
|
58
62
|
});
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
const ClientSettingsSchema = object({
|
|
64
|
+
captchaType: CaptchaTypeSpec.optional().default(captchaTypeDefault),
|
|
65
|
+
domains: array(string()).optional().default([...domainsDefault]),
|
|
66
|
+
frictionlessThreshold: number().optional().default(frictionlessThresholdDefault),
|
|
67
|
+
powDifficulty: number().optional().default(powDifficultyDefault),
|
|
68
|
+
imageThreshold: number().optional().default(imageThresholdDefault),
|
|
69
|
+
ipValidationRules: IPValidationRulesSchema.optional(),
|
|
70
|
+
disallowWebView: boolean().optional().default(false).optional(),
|
|
71
|
+
contextAware: z.object({
|
|
72
|
+
enabled: boolean().optional().default(false),
|
|
73
|
+
threshold: number().optional().default(contextAwareThresholdDefault)
|
|
74
|
+
}).optional()
|
|
71
75
|
});
|
|
72
|
-
|
|
76
|
+
export {
|
|
77
|
+
ClientSettingsSchema,
|
|
78
|
+
IPValidationAction,
|
|
79
|
+
IPValidationActionSchema,
|
|
80
|
+
IPValidationRulesSchema,
|
|
81
|
+
abuseScoreThresholdDefault,
|
|
82
|
+
abuseScoreThresholdExceedActionDefault,
|
|
83
|
+
captchaTypeDefault,
|
|
84
|
+
cityChangeActionDefault,
|
|
85
|
+
contextAwareThresholdDefault,
|
|
86
|
+
countryChangeActionDefault,
|
|
87
|
+
distanceExceedActionDefault,
|
|
88
|
+
distanceThresholdKmDefault,
|
|
89
|
+
domainsDefault,
|
|
90
|
+
frictionlessThresholdDefault,
|
|
91
|
+
imageThresholdDefault,
|
|
92
|
+
ispChangeActionDefault,
|
|
93
|
+
powDifficultyDefault,
|
|
94
|
+
requireAllConditionsDefault
|
|
95
|
+
};
|
package/dist/client/user.js
CHANGED
|
@@ -1,20 +1,33 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
})(Tier ||
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
var Tier = /* @__PURE__ */ ((Tier2) => {
|
|
3
|
+
Tier2["Free"] = "free";
|
|
4
|
+
Tier2["Professional"] = "professional";
|
|
5
|
+
Tier2["Enterprise"] = "enterprise";
|
|
6
|
+
return Tier2;
|
|
7
|
+
})(Tier || {});
|
|
8
|
+
const TierSchema = z.nativeEnum(Tier);
|
|
9
|
+
const TierMonthlyLimits = {
|
|
10
|
+
[
|
|
11
|
+
"free"
|
|
12
|
+
/* Free */
|
|
13
|
+
]: {
|
|
14
|
+
verificationRequests: 1e5
|
|
15
|
+
},
|
|
16
|
+
[
|
|
17
|
+
"professional"
|
|
18
|
+
/* Professional */
|
|
19
|
+
]: {
|
|
20
|
+
verificationRequests: 1e6
|
|
21
|
+
},
|
|
22
|
+
[
|
|
23
|
+
"enterprise"
|
|
24
|
+
/* Enterprise */
|
|
25
|
+
]: {
|
|
26
|
+
verificationRequests: "Unlimited"
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
Tier,
|
|
31
|
+
TierMonthlyLimits,
|
|
32
|
+
TierSchema
|
|
19
33
|
};
|
|
20
|
-
//# sourceMappingURL=user.js.map
|