@prosopo/types 3.0.5 → 3.5.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +233 -0
  2. package/dist/api/index.d.ts +1 -0
  3. package/dist/api/index.d.ts.map +1 -1
  4. package/dist/api/index.js +1 -0
  5. package/dist/api/ipapi.d.ts +171 -0
  6. package/dist/api/ipapi.d.ts.map +1 -0
  7. package/dist/api/ipapi.js +1 -0
  8. package/dist/api/params.d.ts +2 -1
  9. package/dist/api/params.d.ts.map +1 -1
  10. package/dist/api/params.js +1 -0
  11. package/dist/cjs/api/index.cjs +1 -0
  12. package/dist/cjs/api/ipapi.cjs +1 -0
  13. package/dist/cjs/api/params.cjs +1 -0
  14. package/dist/cjs/client/index.cjs +11 -0
  15. package/dist/cjs/client/settings.cjs +65 -1
  16. package/dist/cjs/config/config.cjs +23 -5
  17. package/dist/cjs/config/frictionless.cjs +9 -2
  18. package/dist/cjs/config/index.cjs +5 -1
  19. package/dist/cjs/datasets/captcha.cjs +1 -1
  20. package/dist/cjs/index.cjs +18 -1
  21. package/dist/cjs/provider/api.cjs +15 -0
  22. package/dist/cjs/provider/detection.cjs +1 -0
  23. package/dist/cjs/provider/index.cjs +3 -0
  24. package/dist/client/index.js +13 -2
  25. package/dist/client/settings.d.ts +356 -8
  26. package/dist/client/settings.d.ts.map +1 -1
  27. package/dist/client/settings.js +67 -3
  28. package/dist/config/config.d.ts +64 -22
  29. package/dist/config/config.d.ts.map +1 -1
  30. package/dist/config/config.js +24 -6
  31. package/dist/config/frictionless.d.ts +6 -0
  32. package/dist/config/frictionless.d.ts.map +1 -1
  33. package/dist/config/frictionless.js +10 -3
  34. package/dist/config/index.js +7 -3
  35. package/dist/datasets/captcha.js +1 -1
  36. package/dist/index.js +23 -6
  37. package/dist/procaptcha/manager.d.ts +1 -1
  38. package/dist/procaptcha/manager.d.ts.map +1 -1
  39. package/dist/procaptcha/props.d.ts +1 -0
  40. package/dist/procaptcha/props.d.ts.map +1 -1
  41. package/dist/procaptcha-frictionless/props.d.ts +1 -1
  42. package/dist/procaptcha-frictionless/props.d.ts.map +1 -1
  43. package/dist/provider/api.d.ts +263 -1
  44. package/dist/provider/api.d.ts.map +1 -1
  45. package/dist/provider/api.js +17 -2
  46. package/dist/provider/detection.d.ts +8 -0
  47. package/dist/provider/detection.d.ts.map +1 -0
  48. package/dist/provider/detection.js +1 -0
  49. package/dist/provider/index.d.ts +1 -0
  50. package/dist/provider/index.d.ts.map +1 -1
  51. package/dist/provider/index.js +5 -2
  52. package/package.json +11 -15
@@ -9,16 +9,17 @@ exports.CaptchaTimeoutSchema = config.CaptchaTimeoutSchema;
9
9
  exports.DatabaseConfigSchema = config.DatabaseConfigSchema;
10
10
  exports.DatabaseTypes = config.DatabaseTypes;
11
11
  exports.EnvironmentTypesSchema = config.EnvironmentTypesSchema;
12
+ exports.IpApiServiceSpec = config.IpApiServiceSpec;
12
13
  exports.Mode = config.Mode;
13
14
  exports.ModeEnum = config.ModeEnum;
14
15
  exports.PolkadotSecretJSONSpec = config.PolkadotSecretJSONSpec;
15
16
  exports.ProcaptchaConfigSchema = config.ProcaptchaConfigSchema;
17
+ exports.ProsopoApiConfigSchema = config.ProsopoApiConfigSchema;
16
18
  exports.ProsopoBaseConfigSchema = config.ProsopoBaseConfigSchema;
17
19
  exports.ProsopoBasicConfigSchema = config.ProsopoBasicConfigSchema;
18
20
  exports.ProsopoCaptchaSolutionConfigSchema = config.ProsopoCaptchaSolutionConfigSchema;
19
21
  exports.ProsopoClientConfigSchema = config.ProsopoClientConfigSchema;
20
22
  exports.ProsopoConfigSchema = config.ProsopoConfigSchema;
21
- exports.ProsopoImageServerConfigSchema = config.ProsopoImageServerConfigSchema;
22
23
  exports.ProsopoServerConfigSchema = config.ProsopoServerConfigSchema;
23
24
  exports.NetworkPairTypeSchema = network.NetworkPairTypeSchema;
24
25
  exports.DEFAULT_IMAGE_CAPTCHA_SOLUTION_TIMEOUT = timeouts.DEFAULT_IMAGE_CAPTCHA_SOLUTION_TIMEOUT;
@@ -30,3 +31,6 @@ exports.DEFAULT_POW_CAPTCHA_CACHED_TIMEOUT = timeouts.DEFAULT_POW_CAPTCHA_CACHED
30
31
  exports.DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT = timeouts.DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT;
31
32
  exports.DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT = timeouts.DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT;
32
33
  exports.FrictionlessPenalties = frictionless.FrictionlessPenalties;
34
+ exports.PENALTY_ACCESS_RULE_DEFAULT = frictionless.PENALTY_ACCESS_RULE_DEFAULT;
35
+ exports.PENALTY_OLD_TIMESTAMP_DEFAULT = frictionless.PENALTY_OLD_TIMESTAMP_DEFAULT;
36
+ exports.PENALTY_UNVERIFIED_HOST_DEFAULT = frictionless.PENALTY_UNVERIFIED_HOST_DEFAULT;
@@ -92,7 +92,7 @@ const CaptchaSolutionSchema = z.object({
92
92
  captchaId: z.string(),
93
93
  captchaContentId: z.string(),
94
94
  solution: z.string().array(),
95
- salt: z.string().min(34)
95
+ salt: z.string()
96
96
  });
97
97
  const CaptchaSolutionArraySchema = z.array(CaptchaSolutionSchema);
98
98
  const DataSchema = z.object({
@@ -29,11 +29,22 @@ exports.Tier = user.Tier;
29
29
  exports.TierMonthlyLimits = user.TierMonthlyLimits;
30
30
  exports.TierSchema = user.TierSchema;
31
31
  exports.ClientSettingsSchema = settings.ClientSettingsSchema;
32
+ exports.IPValidationAction = settings.IPValidationAction;
33
+ exports.IPValidationActionSchema = settings.IPValidationActionSchema;
34
+ exports.IPValidationRulesSchema = settings.IPValidationRulesSchema;
35
+ exports.abuseScoreThresholdDefault = settings.abuseScoreThresholdDefault;
36
+ exports.abuseScoreThresholdExceedActionDefault = settings.abuseScoreThresholdExceedActionDefault;
32
37
  exports.captchaTypeDefault = settings.captchaTypeDefault;
38
+ exports.cityChangeActionDefault = settings.cityChangeActionDefault;
39
+ exports.countryChangeActionDefault = settings.countryChangeActionDefault;
40
+ exports.distanceExceedActionDefault = settings.distanceExceedActionDefault;
41
+ exports.distanceThresholdKmDefault = settings.distanceThresholdKmDefault;
33
42
  exports.domainsDefault = settings.domainsDefault;
34
43
  exports.frictionlessThresholdDefault = settings.frictionlessThresholdDefault;
35
44
  exports.imageThresholdDefault = settings.imageThresholdDefault;
45
+ exports.ispChangeActionDefault = settings.ispChangeActionDefault;
36
46
  exports.powDifficultyDefault = settings.powDifficultyDefault;
47
+ exports.requireAllConditionsDefault = settings.requireAllConditionsDefault;
37
48
  exports.CaptchaType = captchaType.CaptchaType;
38
49
  exports.CaptchaTypeSchema = captchaType.CaptchaTypeSchema;
39
50
  exports.CaptchaTypeSpec = captchaTypeSpec.CaptchaTypeSpec;
@@ -42,16 +53,17 @@ exports.CaptchaTimeoutSchema = config.CaptchaTimeoutSchema;
42
53
  exports.DatabaseConfigSchema = config.DatabaseConfigSchema;
43
54
  exports.DatabaseTypes = config.DatabaseTypes;
44
55
  exports.EnvironmentTypesSchema = config.EnvironmentTypesSchema;
56
+ exports.IpApiServiceSpec = config.IpApiServiceSpec;
45
57
  exports.Mode = config.Mode;
46
58
  exports.ModeEnum = config.ModeEnum;
47
59
  exports.PolkadotSecretJSONSpec = config.PolkadotSecretJSONSpec;
48
60
  exports.ProcaptchaConfigSchema = config.ProcaptchaConfigSchema;
61
+ exports.ProsopoApiConfigSchema = config.ProsopoApiConfigSchema;
49
62
  exports.ProsopoBaseConfigSchema = config.ProsopoBaseConfigSchema;
50
63
  exports.ProsopoBasicConfigSchema = config.ProsopoBasicConfigSchema;
51
64
  exports.ProsopoCaptchaSolutionConfigSchema = config.ProsopoCaptchaSolutionConfigSchema;
52
65
  exports.ProsopoClientConfigSchema = config.ProsopoClientConfigSchema;
53
66
  exports.ProsopoConfigSchema = config.ProsopoConfigSchema;
54
- exports.ProsopoImageServerConfigSchema = config.ProsopoImageServerConfigSchema;
55
67
  exports.ProsopoServerConfigSchema = config.ProsopoServerConfigSchema;
56
68
  exports.NetworkPairTypeSchema = network.NetworkPairTypeSchema;
57
69
  exports.DEFAULT_IMAGE_CAPTCHA_SOLUTION_TIMEOUT = timeouts.DEFAULT_IMAGE_CAPTCHA_SOLUTION_TIMEOUT;
@@ -63,6 +75,9 @@ exports.DEFAULT_POW_CAPTCHA_CACHED_TIMEOUT = timeouts.DEFAULT_POW_CAPTCHA_CACHED
63
75
  exports.DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT = timeouts.DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT;
64
76
  exports.DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT = timeouts.DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT;
65
77
  exports.FrictionlessPenalties = frictionless.FrictionlessPenalties;
78
+ exports.PENALTY_ACCESS_RULE_DEFAULT = frictionless.PENALTY_ACCESS_RULE_DEFAULT;
79
+ exports.PENALTY_OLD_TIMESTAMP_DEFAULT = frictionless.PENALTY_OLD_TIMESTAMP_DEFAULT;
80
+ exports.PENALTY_UNVERIFIED_HOST_DEFAULT = frictionless.PENALTY_UNVERIFIED_HOST_DEFAULT;
66
81
  exports.CaptchaItemSchema = captcha.CaptchaItemSchema;
67
82
  exports.CaptchaItemTypes = captcha.CaptchaItemTypes;
68
83
  exports.CaptchaSchema = captcha.CaptchaSchema;
@@ -110,11 +125,13 @@ exports.ProsopoCaptchaCountConfigSchema = api.ProsopoCaptchaCountConfigSchema;
110
125
  exports.ProviderDefaultRateLimits = api.ProviderDefaultRateLimits;
111
126
  exports.PublicApiPaths = api.PublicApiPaths;
112
127
  exports.RegisterSitekeyBody = api.RegisterSitekeyBody;
128
+ exports.RemoveDetectorKeyBodySpec = api.RemoveDetectorKeyBodySpec;
113
129
  exports.ServerPowCaptchaVerifyRequestBody = api.ServerPowCaptchaVerifyRequestBody;
114
130
  exports.SubmitPowCaptchaSolutionBody = api.SubmitPowCaptchaSolutionBody;
115
131
  exports.UpdateDetectorKeyBody = api.UpdateDetectorKeyBody;
116
132
  exports.VerifyPowCaptchaSolutionBody = api.VerifyPowCaptchaSolutionBody;
117
133
  exports.VerifySolutionBody = api.VerifySolutionBody;
134
+ exports.providerDetailsSchema = api.providerDetailsSchema;
118
135
  exports.ScheduledTaskNames = scheduler.ScheduledTaskNames;
119
136
  exports.ScheduledTaskStatus = scheduler.ScheduledTaskStatus;
120
137
  exports.ProcaptchaResponse = manager.ProcaptchaResponse;
@@ -30,6 +30,15 @@ var PublicApiPaths = /* @__PURE__ */ ((PublicApiPaths2) => {
30
30
  PublicApiPaths2["GetProviderDetails"] = "/v1/prosopo/provider/public/details";
31
31
  return PublicApiPaths2;
32
32
  })(PublicApiPaths || {});
33
+ const providerDetailsSchema = z.object({
34
+ version: z.string(),
35
+ message: z.string(),
36
+ redis: z.object({
37
+ actor: z.string(),
38
+ isReady: z.boolean(),
39
+ awaitingTimeSeconds: z.number()
40
+ }).array()
41
+ });
33
42
  var AdminApiPaths = /* @__PURE__ */ ((AdminApiPaths2) => {
34
43
  AdminApiPaths2["SiteKeyRegister"] = "/v1/prosopo/provider/admin/sitekey/register";
35
44
  AdminApiPaths2["UpdateDetectorKey"] = "/v1/prosopo/provider/admin/detector/update";
@@ -178,6 +187,10 @@ const RegisterSitekeyBody = z.object({
178
187
  const UpdateDetectorKeyBody = z.object({
179
188
  [params.ApiParams.detectorKey]: z.string()
180
189
  });
190
+ const RemoveDetectorKeyBodySpec = z.object({
191
+ [params.ApiParams.detectorKey]: z.string(),
192
+ [params.ApiParams.expirationInSeconds]: z.number().positive().optional()
193
+ });
181
194
  const ProsopoCaptchaCountConfigSchema = z.object({
182
195
  solved: z.object({
183
196
  count: z.number().positive()
@@ -219,8 +232,10 @@ exports.ProsopoCaptchaCountConfigSchema = ProsopoCaptchaCountConfigSchema;
219
232
  exports.ProviderDefaultRateLimits = ProviderDefaultRateLimits;
220
233
  exports.PublicApiPaths = PublicApiPaths;
221
234
  exports.RegisterSitekeyBody = RegisterSitekeyBody;
235
+ exports.RemoveDetectorKeyBodySpec = RemoveDetectorKeyBodySpec;
222
236
  exports.ServerPowCaptchaVerifyRequestBody = ServerPowCaptchaVerifyRequestBody;
223
237
  exports.SubmitPowCaptchaSolutionBody = SubmitPowCaptchaSolutionBody;
224
238
  exports.UpdateDetectorKeyBody = UpdateDetectorKeyBody;
225
239
  exports.VerifyPowCaptchaSolutionBody = VerifyPowCaptchaSolutionBody;
226
240
  exports.VerifySolutionBody = VerifySolutionBody;
241
+ exports.providerDetailsSchema = providerDetailsSchema;
@@ -0,0 +1 @@
1
+ "use strict";
@@ -3,6 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("./accounts.cjs");
4
4
  const api = require("./api.cjs");
5
5
  const scheduler = require("./scheduler.cjs");
6
+ require("./detection.cjs");
6
7
  exports.AdminApiPaths = api.AdminApiPaths;
7
8
  exports.ApiPathRateLimits = api.ApiPathRateLimits;
8
9
  exports.ApiPrefix = api.ApiPrefix;
@@ -20,10 +21,12 @@ exports.ProsopoCaptchaCountConfigSchema = api.ProsopoCaptchaCountConfigSchema;
20
21
  exports.ProviderDefaultRateLimits = api.ProviderDefaultRateLimits;
21
22
  exports.PublicApiPaths = api.PublicApiPaths;
22
23
  exports.RegisterSitekeyBody = api.RegisterSitekeyBody;
24
+ exports.RemoveDetectorKeyBodySpec = api.RemoveDetectorKeyBodySpec;
23
25
  exports.ServerPowCaptchaVerifyRequestBody = api.ServerPowCaptchaVerifyRequestBody;
24
26
  exports.SubmitPowCaptchaSolutionBody = api.SubmitPowCaptchaSolutionBody;
25
27
  exports.UpdateDetectorKeyBody = api.UpdateDetectorKeyBody;
26
28
  exports.VerifyPowCaptchaSolutionBody = api.VerifyPowCaptchaSolutionBody;
27
29
  exports.VerifySolutionBody = api.VerifySolutionBody;
30
+ exports.providerDetailsSchema = api.providerDetailsSchema;
28
31
  exports.ScheduledTaskNames = scheduler.ScheduledTaskNames;
29
32
  exports.ScheduledTaskStatus = scheduler.ScheduledTaskStatus;
@@ -1,5 +1,5 @@
1
1
  import { Tier, TierMonthlyLimits, TierSchema } from "./user.js";
2
- import { ClientSettingsSchema, captchaTypeDefault, domainsDefault, frictionlessThresholdDefault, imageThresholdDefault, powDifficultyDefault } from "./settings.js";
2
+ import { ClientSettingsSchema, IPValidationAction, IPValidationActionSchema, IPValidationRulesSchema, abuseScoreThresholdDefault, abuseScoreThresholdExceedActionDefault, captchaTypeDefault, cityChangeActionDefault, countryChangeActionDefault, distanceExceedActionDefault, distanceThresholdKmDefault, domainsDefault, frictionlessThresholdDefault, imageThresholdDefault, ispChangeActionDefault, powDifficultyDefault, requireAllConditionsDefault } from "./settings.js";
3
3
  import { CaptchaType, CaptchaTypeSchema } from "./captchaType/captchaType.js";
4
4
  import { CaptchaTypeSpec } from "./captchaType/captchaTypeSpec.js";
5
5
  export {
@@ -7,12 +7,23 @@ export {
7
7
  CaptchaTypeSchema,
8
8
  CaptchaTypeSpec,
9
9
  ClientSettingsSchema,
10
+ IPValidationAction,
11
+ IPValidationActionSchema,
12
+ IPValidationRulesSchema,
10
13
  Tier,
11
14
  TierMonthlyLimits,
12
15
  TierSchema,
16
+ abuseScoreThresholdDefault,
17
+ abuseScoreThresholdExceedActionDefault,
13
18
  captchaTypeDefault,
19
+ cityChangeActionDefault,
20
+ countryChangeActionDefault,
21
+ distanceExceedActionDefault,
22
+ distanceThresholdKmDefault,
14
23
  domainsDefault,
15
24
  frictionlessThresholdDefault,
16
25
  imageThresholdDefault,
17
- powDifficultyDefault
26
+ ispChangeActionDefault,
27
+ powDifficultyDefault,
28
+ requireAllConditionsDefault
18
29
  };
@@ -1,28 +1,376 @@
1
- import { type output } from "zod";
1
+ import { type output, z } from "zod";
2
2
  import { CaptchaType } from "./captchaType/captchaType.js";
3
3
  export declare const captchaTypeDefault = CaptchaType.frictionless;
4
4
  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 ClientSettingsSchema: import("zod").ZodObject<{
9
- captchaType: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNativeEnum<typeof CaptchaType>>>;
10
- domains: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>>;
11
- frictionlessThreshold: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
12
- powDifficulty: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
13
- imageThreshold: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
14
- }, "strip", import("zod").ZodTypeAny, {
8
+ export declare enum IPValidationAction {
9
+ Allow = "allow",
10
+ Reject = "reject",
11
+ Flag = "flag"
12
+ }
13
+ export type IPValidateCondition = {
14
+ met: boolean;
15
+ action: IPValidationAction;
16
+ message: string;
17
+ };
18
+ export declare const IPValidationActionSchema: z.ZodNativeEnum<typeof IPValidationAction>;
19
+ export declare const countryChangeActionDefault = IPValidationAction.Allow;
20
+ export declare const cityChangeActionDefault = IPValidationAction.Allow;
21
+ export declare const ispChangeActionDefault = IPValidationAction.Allow;
22
+ export declare const distanceThresholdKmDefault = 1000;
23
+ export declare const abuseScoreThresholdDefault = 0.005;
24
+ export declare const distanceExceedActionDefault = IPValidationAction.Reject;
25
+ export declare const abuseScoreThresholdExceedActionDefault = IPValidationAction.Reject;
26
+ export declare const requireAllConditionsDefault = false;
27
+ declare const IPValidationSchema: z.ZodObject<{
28
+ actions: z.ZodObject<{
29
+ countryChangeAction: z.ZodOptional<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
30
+ cityChangeAction: z.ZodOptional<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
31
+ ispChangeAction: z.ZodOptional<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
32
+ distanceExceedAction: z.ZodOptional<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
33
+ abuseScoreExceedAction: z.ZodOptional<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ countryChangeAction?: IPValidationAction | undefined;
36
+ cityChangeAction?: IPValidationAction | undefined;
37
+ ispChangeAction?: IPValidationAction | undefined;
38
+ distanceExceedAction?: IPValidationAction | undefined;
39
+ abuseScoreExceedAction?: IPValidationAction | undefined;
40
+ }, {
41
+ countryChangeAction?: IPValidationAction | undefined;
42
+ cityChangeAction?: IPValidationAction | undefined;
43
+ ispChangeAction?: IPValidationAction | undefined;
44
+ distanceExceedAction?: IPValidationAction | undefined;
45
+ abuseScoreExceedAction?: IPValidationAction | undefined;
46
+ }>;
47
+ distanceThresholdKm: z.ZodOptional<z.ZodNumber>;
48
+ abuseScoreThreshold: z.ZodOptional<z.ZodNumber>;
49
+ requireAllConditions: z.ZodOptional<z.ZodBoolean>;
50
+ }, "strip", z.ZodTypeAny, {
51
+ actions: {
52
+ countryChangeAction?: IPValidationAction | undefined;
53
+ cityChangeAction?: IPValidationAction | undefined;
54
+ ispChangeAction?: IPValidationAction | undefined;
55
+ distanceExceedAction?: IPValidationAction | undefined;
56
+ abuseScoreExceedAction?: IPValidationAction | undefined;
57
+ };
58
+ distanceThresholdKm?: number | undefined;
59
+ abuseScoreThreshold?: number | undefined;
60
+ requireAllConditions?: boolean | undefined;
61
+ }, {
62
+ actions: {
63
+ countryChangeAction?: IPValidationAction | undefined;
64
+ cityChangeAction?: IPValidationAction | undefined;
65
+ ispChangeAction?: IPValidationAction | undefined;
66
+ distanceExceedAction?: IPValidationAction | undefined;
67
+ abuseScoreExceedAction?: IPValidationAction | undefined;
68
+ };
69
+ distanceThresholdKm?: number | undefined;
70
+ abuseScoreThreshold?: number | undefined;
71
+ requireAllConditions?: boolean | undefined;
72
+ }>;
73
+ export declare const IPValidationRulesSchema: z.ZodObject<{
74
+ actions: z.ZodObject<{
75
+ countryChangeAction: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
76
+ cityChangeAction: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
77
+ ispChangeAction: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
78
+ distanceExceedAction: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
79
+ abuseScoreExceedAction: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
80
+ }, "strip", z.ZodTypeAny, {
81
+ countryChangeAction: IPValidationAction;
82
+ cityChangeAction: IPValidationAction;
83
+ ispChangeAction: IPValidationAction;
84
+ distanceExceedAction: IPValidationAction;
85
+ abuseScoreExceedAction: IPValidationAction;
86
+ }, {
87
+ countryChangeAction?: IPValidationAction | undefined;
88
+ cityChangeAction?: IPValidationAction | undefined;
89
+ ispChangeAction?: IPValidationAction | undefined;
90
+ distanceExceedAction?: IPValidationAction | undefined;
91
+ abuseScoreExceedAction?: IPValidationAction | undefined;
92
+ }>;
93
+ distanceThresholdKm: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
94
+ abuseScoreThreshold: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
95
+ requireAllConditions: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
96
+ countryOverrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
97
+ actions: z.ZodObject<{
98
+ countryChangeAction: z.ZodOptional<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
99
+ cityChangeAction: z.ZodOptional<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
100
+ ispChangeAction: z.ZodOptional<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
101
+ distanceExceedAction: z.ZodOptional<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
102
+ abuseScoreExceedAction: z.ZodOptional<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
103
+ }, "strip", z.ZodTypeAny, {
104
+ countryChangeAction?: IPValidationAction | undefined;
105
+ cityChangeAction?: IPValidationAction | undefined;
106
+ ispChangeAction?: IPValidationAction | undefined;
107
+ distanceExceedAction?: IPValidationAction | undefined;
108
+ abuseScoreExceedAction?: IPValidationAction | undefined;
109
+ }, {
110
+ countryChangeAction?: IPValidationAction | undefined;
111
+ cityChangeAction?: IPValidationAction | undefined;
112
+ ispChangeAction?: IPValidationAction | undefined;
113
+ distanceExceedAction?: IPValidationAction | undefined;
114
+ abuseScoreExceedAction?: IPValidationAction | undefined;
115
+ }>;
116
+ distanceThresholdKm: z.ZodOptional<z.ZodNumber>;
117
+ abuseScoreThreshold: z.ZodOptional<z.ZodNumber>;
118
+ requireAllConditions: z.ZodOptional<z.ZodBoolean>;
119
+ }, "strip", z.ZodTypeAny, {
120
+ actions: {
121
+ countryChangeAction?: IPValidationAction | undefined;
122
+ cityChangeAction?: IPValidationAction | undefined;
123
+ ispChangeAction?: IPValidationAction | undefined;
124
+ distanceExceedAction?: IPValidationAction | undefined;
125
+ abuseScoreExceedAction?: IPValidationAction | undefined;
126
+ };
127
+ distanceThresholdKm?: number | undefined;
128
+ abuseScoreThreshold?: number | undefined;
129
+ requireAllConditions?: boolean | undefined;
130
+ }, {
131
+ actions: {
132
+ countryChangeAction?: IPValidationAction | undefined;
133
+ cityChangeAction?: IPValidationAction | undefined;
134
+ ispChangeAction?: IPValidationAction | undefined;
135
+ distanceExceedAction?: IPValidationAction | undefined;
136
+ abuseScoreExceedAction?: IPValidationAction | undefined;
137
+ };
138
+ distanceThresholdKm?: number | undefined;
139
+ abuseScoreThreshold?: number | undefined;
140
+ requireAllConditions?: boolean | undefined;
141
+ }>>>;
142
+ }, "strip", z.ZodTypeAny, {
143
+ actions: {
144
+ countryChangeAction: IPValidationAction;
145
+ cityChangeAction: IPValidationAction;
146
+ ispChangeAction: IPValidationAction;
147
+ distanceExceedAction: IPValidationAction;
148
+ abuseScoreExceedAction: IPValidationAction;
149
+ };
150
+ distanceThresholdKm: number;
151
+ abuseScoreThreshold: number;
152
+ requireAllConditions: boolean;
153
+ countryOverrides?: Record<string, {
154
+ actions: {
155
+ countryChangeAction?: IPValidationAction | undefined;
156
+ cityChangeAction?: IPValidationAction | undefined;
157
+ ispChangeAction?: IPValidationAction | undefined;
158
+ distanceExceedAction?: IPValidationAction | undefined;
159
+ abuseScoreExceedAction?: IPValidationAction | undefined;
160
+ };
161
+ distanceThresholdKm?: number | undefined;
162
+ abuseScoreThreshold?: number | undefined;
163
+ requireAllConditions?: boolean | undefined;
164
+ }> | undefined;
165
+ }, {
166
+ actions: {
167
+ countryChangeAction?: IPValidationAction | undefined;
168
+ cityChangeAction?: IPValidationAction | undefined;
169
+ ispChangeAction?: IPValidationAction | undefined;
170
+ distanceExceedAction?: IPValidationAction | undefined;
171
+ abuseScoreExceedAction?: IPValidationAction | undefined;
172
+ };
173
+ distanceThresholdKm?: number | undefined;
174
+ abuseScoreThreshold?: number | undefined;
175
+ requireAllConditions?: boolean | undefined;
176
+ countryOverrides?: Record<string, {
177
+ actions: {
178
+ countryChangeAction?: IPValidationAction | undefined;
179
+ cityChangeAction?: IPValidationAction | undefined;
180
+ ispChangeAction?: IPValidationAction | undefined;
181
+ distanceExceedAction?: IPValidationAction | undefined;
182
+ abuseScoreExceedAction?: IPValidationAction | undefined;
183
+ };
184
+ distanceThresholdKm?: number | undefined;
185
+ abuseScoreThreshold?: number | undefined;
186
+ requireAllConditions?: boolean | undefined;
187
+ }> | undefined;
188
+ }>;
189
+ export declare const ClientSettingsSchema: z.ZodObject<{
190
+ captchaType: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof CaptchaType>>>;
191
+ domains: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
192
+ frictionlessThreshold: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
193
+ powDifficulty: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
194
+ imageThreshold: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
195
+ ipValidationRules: z.ZodOptional<z.ZodObject<{
196
+ actions: z.ZodObject<{
197
+ countryChangeAction: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
198
+ cityChangeAction: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
199
+ ispChangeAction: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
200
+ distanceExceedAction: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
201
+ abuseScoreExceedAction: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
202
+ }, "strip", z.ZodTypeAny, {
203
+ countryChangeAction: IPValidationAction;
204
+ cityChangeAction: IPValidationAction;
205
+ ispChangeAction: IPValidationAction;
206
+ distanceExceedAction: IPValidationAction;
207
+ abuseScoreExceedAction: IPValidationAction;
208
+ }, {
209
+ countryChangeAction?: IPValidationAction | undefined;
210
+ cityChangeAction?: IPValidationAction | undefined;
211
+ ispChangeAction?: IPValidationAction | undefined;
212
+ distanceExceedAction?: IPValidationAction | undefined;
213
+ abuseScoreExceedAction?: IPValidationAction | undefined;
214
+ }>;
215
+ distanceThresholdKm: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
216
+ abuseScoreThreshold: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
217
+ requireAllConditions: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
218
+ countryOverrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
219
+ actions: z.ZodObject<{
220
+ countryChangeAction: z.ZodOptional<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
221
+ cityChangeAction: z.ZodOptional<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
222
+ ispChangeAction: z.ZodOptional<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
223
+ distanceExceedAction: z.ZodOptional<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
224
+ abuseScoreExceedAction: z.ZodOptional<z.ZodOptional<z.ZodNativeEnum<typeof IPValidationAction>>>;
225
+ }, "strip", z.ZodTypeAny, {
226
+ countryChangeAction?: IPValidationAction | undefined;
227
+ cityChangeAction?: IPValidationAction | undefined;
228
+ ispChangeAction?: IPValidationAction | undefined;
229
+ distanceExceedAction?: IPValidationAction | undefined;
230
+ abuseScoreExceedAction?: IPValidationAction | undefined;
231
+ }, {
232
+ countryChangeAction?: IPValidationAction | undefined;
233
+ cityChangeAction?: IPValidationAction | undefined;
234
+ ispChangeAction?: IPValidationAction | undefined;
235
+ distanceExceedAction?: IPValidationAction | undefined;
236
+ abuseScoreExceedAction?: IPValidationAction | undefined;
237
+ }>;
238
+ distanceThresholdKm: z.ZodOptional<z.ZodNumber>;
239
+ abuseScoreThreshold: z.ZodOptional<z.ZodNumber>;
240
+ requireAllConditions: z.ZodOptional<z.ZodBoolean>;
241
+ }, "strip", z.ZodTypeAny, {
242
+ actions: {
243
+ countryChangeAction?: IPValidationAction | undefined;
244
+ cityChangeAction?: IPValidationAction | undefined;
245
+ ispChangeAction?: IPValidationAction | undefined;
246
+ distanceExceedAction?: IPValidationAction | undefined;
247
+ abuseScoreExceedAction?: IPValidationAction | undefined;
248
+ };
249
+ distanceThresholdKm?: number | undefined;
250
+ abuseScoreThreshold?: number | undefined;
251
+ requireAllConditions?: boolean | undefined;
252
+ }, {
253
+ actions: {
254
+ countryChangeAction?: IPValidationAction | undefined;
255
+ cityChangeAction?: IPValidationAction | undefined;
256
+ ispChangeAction?: IPValidationAction | undefined;
257
+ distanceExceedAction?: IPValidationAction | undefined;
258
+ abuseScoreExceedAction?: IPValidationAction | undefined;
259
+ };
260
+ distanceThresholdKm?: number | undefined;
261
+ abuseScoreThreshold?: number | undefined;
262
+ requireAllConditions?: boolean | undefined;
263
+ }>>>;
264
+ }, "strip", z.ZodTypeAny, {
265
+ actions: {
266
+ countryChangeAction: IPValidationAction;
267
+ cityChangeAction: IPValidationAction;
268
+ ispChangeAction: IPValidationAction;
269
+ distanceExceedAction: IPValidationAction;
270
+ abuseScoreExceedAction: IPValidationAction;
271
+ };
272
+ distanceThresholdKm: number;
273
+ abuseScoreThreshold: number;
274
+ requireAllConditions: boolean;
275
+ countryOverrides?: Record<string, {
276
+ actions: {
277
+ countryChangeAction?: IPValidationAction | undefined;
278
+ cityChangeAction?: IPValidationAction | undefined;
279
+ ispChangeAction?: IPValidationAction | undefined;
280
+ distanceExceedAction?: IPValidationAction | undefined;
281
+ abuseScoreExceedAction?: IPValidationAction | undefined;
282
+ };
283
+ distanceThresholdKm?: number | undefined;
284
+ abuseScoreThreshold?: number | undefined;
285
+ requireAllConditions?: boolean | undefined;
286
+ }> | undefined;
287
+ }, {
288
+ actions: {
289
+ countryChangeAction?: IPValidationAction | undefined;
290
+ cityChangeAction?: IPValidationAction | undefined;
291
+ ispChangeAction?: IPValidationAction | undefined;
292
+ distanceExceedAction?: IPValidationAction | undefined;
293
+ abuseScoreExceedAction?: IPValidationAction | undefined;
294
+ };
295
+ distanceThresholdKm?: number | undefined;
296
+ abuseScoreThreshold?: number | undefined;
297
+ requireAllConditions?: boolean | undefined;
298
+ countryOverrides?: Record<string, {
299
+ actions: {
300
+ countryChangeAction?: IPValidationAction | undefined;
301
+ cityChangeAction?: IPValidationAction | undefined;
302
+ ispChangeAction?: IPValidationAction | undefined;
303
+ distanceExceedAction?: IPValidationAction | undefined;
304
+ abuseScoreExceedAction?: IPValidationAction | undefined;
305
+ };
306
+ distanceThresholdKm?: number | undefined;
307
+ abuseScoreThreshold?: number | undefined;
308
+ requireAllConditions?: boolean | undefined;
309
+ }> | undefined;
310
+ }>>;
311
+ }, "strip", z.ZodTypeAny, {
15
312
  captchaType: CaptchaType;
16
313
  domains: string[];
17
314
  frictionlessThreshold: number;
18
315
  powDifficulty: number;
19
316
  imageThreshold: number;
317
+ ipValidationRules?: {
318
+ actions: {
319
+ countryChangeAction: IPValidationAction;
320
+ cityChangeAction: IPValidationAction;
321
+ ispChangeAction: IPValidationAction;
322
+ distanceExceedAction: IPValidationAction;
323
+ abuseScoreExceedAction: IPValidationAction;
324
+ };
325
+ distanceThresholdKm: number;
326
+ abuseScoreThreshold: number;
327
+ requireAllConditions: boolean;
328
+ countryOverrides?: Record<string, {
329
+ actions: {
330
+ countryChangeAction?: IPValidationAction | undefined;
331
+ cityChangeAction?: IPValidationAction | undefined;
332
+ ispChangeAction?: IPValidationAction | undefined;
333
+ distanceExceedAction?: IPValidationAction | undefined;
334
+ abuseScoreExceedAction?: IPValidationAction | undefined;
335
+ };
336
+ distanceThresholdKm?: number | undefined;
337
+ abuseScoreThreshold?: number | undefined;
338
+ requireAllConditions?: boolean | undefined;
339
+ }> | undefined;
340
+ } | undefined;
20
341
  }, {
21
342
  captchaType?: CaptchaType | undefined;
22
343
  domains?: string[] | undefined;
23
344
  frictionlessThreshold?: number | undefined;
24
345
  powDifficulty?: number | undefined;
25
346
  imageThreshold?: number | undefined;
347
+ ipValidationRules?: {
348
+ actions: {
349
+ countryChangeAction?: IPValidationAction | undefined;
350
+ cityChangeAction?: IPValidationAction | undefined;
351
+ ispChangeAction?: IPValidationAction | undefined;
352
+ distanceExceedAction?: IPValidationAction | undefined;
353
+ abuseScoreExceedAction?: IPValidationAction | undefined;
354
+ };
355
+ distanceThresholdKm?: number | undefined;
356
+ abuseScoreThreshold?: number | undefined;
357
+ requireAllConditions?: boolean | undefined;
358
+ countryOverrides?: Record<string, {
359
+ actions: {
360
+ countryChangeAction?: IPValidationAction | undefined;
361
+ cityChangeAction?: IPValidationAction | undefined;
362
+ ispChangeAction?: IPValidationAction | undefined;
363
+ distanceExceedAction?: IPValidationAction | undefined;
364
+ abuseScoreExceedAction?: IPValidationAction | undefined;
365
+ };
366
+ distanceThresholdKm?: number | undefined;
367
+ abuseScoreThreshold?: number | undefined;
368
+ requireAllConditions?: boolean | undefined;
369
+ }> | undefined;
370
+ } | undefined;
26
371
  }>;
27
372
  export type IUserSettings = output<typeof ClientSettingsSchema>;
373
+ export type IIPValidationRules = output<typeof IPValidationRulesSchema>;
374
+ export type IIPValidation = output<typeof IPValidationSchema>;
375
+ export {};
28
376
  //# sourceMappingURL=settings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/client/settings.ts"],"names":[],"mappings":"AAaA,OAAO,EAAyB,KAAK,MAAM,EAAU,MAAM,KAAK,CAAC;AACjE,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;AAEzC,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;EAU/B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,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;AAGzC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgClC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW/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"}