@prosopo/types 3.5.3 → 3.6.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/dist/api/params.d.ts +3 -1
  3. package/dist/api/params.d.ts.map +1 -1
  4. package/dist/api/params.js +2 -0
  5. package/dist/cjs/api/params.cjs +2 -0
  6. package/dist/cjs/client/index.cjs +1 -0
  7. package/dist/cjs/client/settings.cjs +10 -2
  8. package/dist/cjs/config/config.cjs +8 -4
  9. package/dist/cjs/config/frictionless.cjs +4 -1
  10. package/dist/cjs/config/index.cjs +1 -0
  11. package/dist/cjs/index.cjs +3 -0
  12. package/dist/cjs/provider/api.cjs +11 -1
  13. package/dist/cjs/provider/index.cjs +1 -0
  14. package/dist/cjs/provider/scheduler.cjs +1 -0
  15. package/dist/client/index.js +2 -1
  16. package/dist/client/settings.d.ts +30 -0
  17. package/dist/client/settings.d.ts.map +1 -1
  18. package/dist/client/settings.js +10 -2
  19. package/dist/client/user.d.ts +2 -3
  20. package/dist/client/user.d.ts.map +1 -1
  21. package/dist/config/config.d.ts +43 -15
  22. package/dist/config/config.d.ts.map +1 -1
  23. package/dist/config/config.js +10 -6
  24. package/dist/config/frictionless.d.ts +4 -0
  25. package/dist/config/frictionless.d.ts.map +1 -1
  26. package/dist/config/frictionless.js +5 -2
  27. package/dist/config/index.js +2 -1
  28. package/dist/datasets/captcha.d.ts +42 -42
  29. package/dist/datasets/dataset.d.ts +28 -28
  30. package/dist/index.js +6 -3
  31. package/dist/provider/api.d.ts +63 -1
  32. package/dist/provider/api.d.ts.map +1 -1
  33. package/dist/provider/api.js +11 -1
  34. package/dist/provider/detection.d.ts +3 -0
  35. package/dist/provider/detection.d.ts.map +1 -1
  36. package/dist/provider/index.js +2 -1
  37. package/dist/provider/scheduler.d.ts +2 -1
  38. package/dist/provider/scheduler.d.ts.map +1 -1
  39. package/dist/provider/scheduler.js +1 -0
  40. package/package.json +14 -14
package/CHANGELOG.md CHANGED
@@ -1,5 +1,71 @@
1
1
  # @prosopo/types
2
2
 
3
+ ## 3.6.0
4
+ ### Minor Changes
5
+
6
+ - bb5f41c: Context awareness
7
+
8
+ ### Patch Changes
9
+
10
+ - 15ae7cf: Change slider defaults
11
+ - 8ce9205: Change engine requirements
12
+ - b6e98b2: Run npm audit
13
+ - Updated dependencies [bb5f41c]
14
+ - Updated dependencies [8ce9205]
15
+ - Updated dependencies [df79c03]
16
+ - Updated dependencies [b6e98b2]
17
+ - @prosopo/util@3.2.0
18
+ - @prosopo/util-crypto@13.5.24
19
+ - @prosopo/locale@3.1.22
20
+ - @prosopo/config@3.1.22
21
+
22
+ ## 3.5.11
23
+ ### Patch Changes
24
+
25
+ - 8f1773a: Tweak config
26
+
27
+ ## 3.5.10
28
+ ### Patch Changes
29
+
30
+ - cb8ab85: head entropy for bot detection
31
+
32
+ ## 3.5.9
33
+ ### Patch Changes
34
+
35
+ - 43907e8: Convert timestamp fields from numbers to Date objects throughout codebase
36
+ - 7101036: Force consistent IPs logic
37
+ - Updated dependencies [005ce66]
38
+ - @prosopo/util@3.1.7
39
+
40
+ ## 3.5.8
41
+ ### Patch Changes
42
+
43
+ - e5c259d: .
44
+
45
+ ## 3.5.7
46
+ ### Patch Changes
47
+
48
+ - Updated dependencies [b8185a4]
49
+ - @prosopo/config@3.1.21
50
+ - @prosopo/locale@3.1.21
51
+ - @prosopo/util@3.1.6
52
+ - @prosopo/util-crypto@13.5.23
53
+
54
+ ## 3.5.6
55
+ ### Patch Changes
56
+
57
+ - 5d11a81: Adding maintenance mode
58
+
59
+ ## 3.5.5
60
+ ### Patch Changes
61
+
62
+ - 494c5a8: Updated payload
63
+
64
+ ## 3.5.4
65
+ ### Patch Changes
66
+
67
+ - 08ff50f: Hot fix country code
68
+
3
69
  ## 3.5.3
4
70
  ### Patch Changes
5
71
 
@@ -36,6 +36,8 @@ export declare enum ApiParams {
36
36
  tier = "tier",
37
37
  detectorKey = "detectorKey",
38
38
  ip = "ip",
39
- expirationInSeconds = "expirationInSeconds"
39
+ expirationInSeconds = "expirationInSeconds",
40
+ enabled = "enabled",
41
+ headHash = "headHash"
40
42
  }
41
43
  //# sourceMappingURL=params.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../../src/api/params.ts"],"names":[],"mappings":"AAcA,oBAAY,SAAS;IACpB,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,QAAQ,aAAa;IACrB,YAAY,iBAAiB;IAC7B,KAAK,UAAU;IACf,aAAa,kBAAkB;IAC/B,iBAAiB,sBAAsB;IACvC,WAAW,gBAAgB;IAC3B,kBAAkB,wBAAwB;IAC1C,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,qBAAqB,0BAA0B;IAC/C,aAAa,kBAAkB;IAC/B,KAAK,UAAU;IACf,IAAI,SAAS;IACb,WAAW,gBAAgB;IAC3B,EAAE,OAAO;IACT,mBAAmB,wBAAwB;CAC3C"}
1
+ {"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../../src/api/params.ts"],"names":[],"mappings":"AAcA,oBAAY,SAAS;IACpB,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,QAAQ,aAAa;IACrB,YAAY,iBAAiB;IAC7B,KAAK,UAAU;IACf,aAAa,kBAAkB;IAC/B,iBAAiB,sBAAsB;IACvC,WAAW,gBAAgB;IAC3B,kBAAkB,wBAAwB;IAC1C,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,qBAAqB,0BAA0B;IAC/C,aAAa,kBAAkB;IAC/B,KAAK,UAAU;IACf,IAAI,SAAS;IACb,WAAW,gBAAgB;IAC3B,EAAE,OAAO;IACT,mBAAmB,wBAAwB;IAC3C,OAAO,YAAY;IACnB,QAAQ,aAAa;CACrB"}
@@ -37,6 +37,8 @@ var ApiParams = /* @__PURE__ */ ((ApiParams2) => {
37
37
  ApiParams2["detectorKey"] = "detectorKey";
38
38
  ApiParams2["ip"] = "ip";
39
39
  ApiParams2["expirationInSeconds"] = "expirationInSeconds";
40
+ ApiParams2["enabled"] = "enabled";
41
+ ApiParams2["headHash"] = "headHash";
40
42
  return ApiParams2;
41
43
  })(ApiParams || {});
42
44
  export {
@@ -39,6 +39,8 @@ var ApiParams = /* @__PURE__ */ ((ApiParams2) => {
39
39
  ApiParams2["detectorKey"] = "detectorKey";
40
40
  ApiParams2["ip"] = "ip";
41
41
  ApiParams2["expirationInSeconds"] = "expirationInSeconds";
42
+ ApiParams2["enabled"] = "enabled";
43
+ ApiParams2["headHash"] = "headHash";
42
44
  return ApiParams2;
43
45
  })(ApiParams || {});
44
46
  exports.ApiParams = ApiParams;
@@ -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";
@@ -58,7 +59,8 @@ const IPValidationRulesSchema = z.object({
58
59
  abuseScoreThreshold: z.number().positive().optional().default(abuseScoreThresholdDefault),
59
60
  requireAllConditions: z.z.boolean().optional().default(requireAllConditionsDefault),
60
61
  // overrides are now lightweight, not recursive
61
- countryOverrides: z.z.record(z.string(), IPValidationSchema).optional()
62
+ countryOverrides: z.z.record(z.string(), IPValidationSchema).optional(),
63
+ forceConsistentIp: z.boolean().optional().default(false)
62
64
  });
63
65
  const ClientSettingsSchema = z.object({
64
66
  captchaType: captchaTypeSpec.CaptchaTypeSpec.optional().default(captchaTypeDefault),
@@ -66,7 +68,12 @@ const ClientSettingsSchema = z.object({
66
68
  frictionlessThreshold: z.number().optional().default(frictionlessThresholdDefault),
67
69
  powDifficulty: z.number().optional().default(powDifficultyDefault),
68
70
  imageThreshold: z.number().optional().default(imageThresholdDefault),
69
- ipValidationRules: IPValidationRulesSchema.optional()
71
+ ipValidationRules: IPValidationRulesSchema.optional(),
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()
70
77
  });
71
78
  exports.ClientSettingsSchema = ClientSettingsSchema;
72
79
  exports.IPValidationAction = IPValidationAction;
@@ -76,6 +83,7 @@ exports.abuseScoreThresholdDefault = abuseScoreThresholdDefault;
76
83
  exports.abuseScoreThresholdExceedActionDefault = abuseScoreThresholdExceedActionDefault;
77
84
  exports.captchaTypeDefault = captchaTypeDefault;
78
85
  exports.cityChangeActionDefault = cityChangeActionDefault;
86
+ exports.contextAwareThresholdDefault = contextAwareThresholdDefault;
79
87
  exports.countryChangeActionDefault = countryChangeActionDefault;
80
88
  exports.distanceExceedActionDefault = distanceExceedActionDefault;
81
89
  exports.distanceThresholdKmDefault = distanceThresholdKmDefault;
@@ -64,8 +64,7 @@ const PolkadotSecretJSONSpec = z.object({
64
64
  });
65
65
  const ProsopoBasicConfigSchema = ProsopoBaseConfigSchema.merge(
66
66
  z.object({
67
- database: DatabaseConfigSchema.optional(),
68
- devOnlyWatchEvents: z.boolean().optional()
67
+ database: DatabaseConfigSchema.optional()
69
68
  })
70
69
  );
71
70
  const ProsopoApiConfigSchema = z.object({
@@ -163,7 +162,8 @@ const ProcaptchaConfigSchema = ProsopoClientConfigSchema.and(
163
162
  mode: Mode.optional().default(
164
163
  "visible"
165
164
  /* visible */
166
- )
165
+ ),
166
+ contextAware: z.boolean().optional().default(false)
167
167
  })
168
168
  );
169
169
  const IpApiServiceSpec = z.object({
@@ -180,7 +180,8 @@ const ProsopoConfigSchema = ProsopoBasicConfigSchema.merge(
180
180
  penalties: frictionless.FrictionlessPenalties.optional().default({
181
181
  PENALTY_OLD_TIMESTAMP: frictionless.PENALTY_OLD_TIMESTAMP_DEFAULT,
182
182
  PENALTY_ACCESS_RULE: frictionless.PENALTY_ACCESS_RULE_DEFAULT,
183
- PENALTY_UNVERIFIED_HOST: frictionless.PENALTY_UNVERIFIED_HOST_DEFAULT
183
+ PENALTY_UNVERIFIED_HOST: frictionless.PENALTY_UNVERIFIED_HOST_DEFAULT,
184
+ PENALTY_WEBVIEW: frictionless.PENALTY_WEBVIEW_DEFAULT
184
185
  }),
185
186
  scheduledTasks: z.object({
186
187
  captchaScheduler: 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(),
@@ -4,12 +4,15 @@ const z = require("zod");
4
4
  const PENALTY_OLD_TIMESTAMP_DEFAULT = 0.2;
5
5
  const PENALTY_ACCESS_RULE_DEFAULT = 0.5;
6
6
  const PENALTY_UNVERIFIED_HOST_DEFAULT = 0.2;
7
+ const PENALTY_WEBVIEW_DEFAULT = 0.1;
7
8
  const FrictionlessPenalties = z.object({
8
9
  PENALTY_OLD_TIMESTAMP: z.number().positive().optional().default(PENALTY_OLD_TIMESTAMP_DEFAULT),
9
10
  PENALTY_ACCESS_RULE: z.number().positive().optional().default(PENALTY_ACCESS_RULE_DEFAULT),
10
- PENALTY_UNVERIFIED_HOST: z.number().positive().optional().default(PENALTY_UNVERIFIED_HOST_DEFAULT)
11
+ PENALTY_UNVERIFIED_HOST: z.number().positive().optional().default(PENALTY_UNVERIFIED_HOST_DEFAULT),
12
+ PENALTY_WEBVIEW: z.number().positive().optional().default(PENALTY_WEBVIEW_DEFAULT)
11
13
  });
12
14
  exports.FrictionlessPenalties = FrictionlessPenalties;
13
15
  exports.PENALTY_ACCESS_RULE_DEFAULT = PENALTY_ACCESS_RULE_DEFAULT;
14
16
  exports.PENALTY_OLD_TIMESTAMP_DEFAULT = PENALTY_OLD_TIMESTAMP_DEFAULT;
15
17
  exports.PENALTY_UNVERIFIED_HOST_DEFAULT = PENALTY_UNVERIFIED_HOST_DEFAULT;
18
+ exports.PENALTY_WEBVIEW_DEFAULT = PENALTY_WEBVIEW_DEFAULT;
@@ -34,3 +34,4 @@ exports.FrictionlessPenalties = frictionless.FrictionlessPenalties;
34
34
  exports.PENALTY_ACCESS_RULE_DEFAULT = frictionless.PENALTY_ACCESS_RULE_DEFAULT;
35
35
  exports.PENALTY_OLD_TIMESTAMP_DEFAULT = frictionless.PENALTY_OLD_TIMESTAMP_DEFAULT;
36
36
  exports.PENALTY_UNVERIFIED_HOST_DEFAULT = frictionless.PENALTY_UNVERIFIED_HOST_DEFAULT;
37
+ exports.PENALTY_WEBVIEW_DEFAULT = frictionless.PENALTY_WEBVIEW_DEFAULT;
@@ -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;
@@ -78,6 +79,7 @@ exports.FrictionlessPenalties = frictionless.FrictionlessPenalties;
78
79
  exports.PENALTY_ACCESS_RULE_DEFAULT = frictionless.PENALTY_ACCESS_RULE_DEFAULT;
79
80
  exports.PENALTY_OLD_TIMESTAMP_DEFAULT = frictionless.PENALTY_OLD_TIMESTAMP_DEFAULT;
80
81
  exports.PENALTY_UNVERIFIED_HOST_DEFAULT = frictionless.PENALTY_UNVERIFIED_HOST_DEFAULT;
82
+ exports.PENALTY_WEBVIEW_DEFAULT = frictionless.PENALTY_WEBVIEW_DEFAULT;
81
83
  exports.CaptchaItemSchema = captcha.CaptchaItemSchema;
82
84
  exports.CaptchaItemTypes = captcha.CaptchaItemTypes;
83
85
  exports.CaptchaSchema = captcha.CaptchaSchema;
@@ -128,6 +130,7 @@ exports.RegisterSitekeyBody = api.RegisterSitekeyBody;
128
130
  exports.RemoveDetectorKeyBodySpec = api.RemoveDetectorKeyBodySpec;
129
131
  exports.ServerPowCaptchaVerifyRequestBody = api.ServerPowCaptchaVerifyRequestBody;
130
132
  exports.SubmitPowCaptchaSolutionBody = api.SubmitPowCaptchaSolutionBody;
133
+ exports.ToggleMaintenanceModeBody = api.ToggleMaintenanceModeBody;
131
134
  exports.UpdateDetectorKeyBody = api.UpdateDetectorKeyBody;
132
135
  exports.VerifyPowCaptchaSolutionBody = api.VerifyPowCaptchaSolutionBody;
133
136
  exports.VerifySolutionBody = api.VerifySolutionBody;
@@ -43,6 +43,7 @@ var AdminApiPaths = /* @__PURE__ */ ((AdminApiPaths2) => {
43
43
  AdminApiPaths2["SiteKeyRegister"] = "/v1/prosopo/provider/admin/sitekey/register";
44
44
  AdminApiPaths2["UpdateDetectorKey"] = "/v1/prosopo/provider/admin/detector/update";
45
45
  AdminApiPaths2["RemoveDetectorKey"] = "/v1/prosopo/provider/admin/detector/remove";
46
+ AdminApiPaths2["ToggleMaintenanceMode"] = "/v1/prosopo/provider/admin/maintenance/toggle";
46
47
  return AdminApiPaths2;
47
48
  })(AdminApiPaths || {});
48
49
  const ProviderDefaultRateLimits = {
@@ -103,6 +104,10 @@ const ProviderDefaultRateLimits = {
103
104
  [
104
105
  "/v1/prosopo/provider/admin/detector/remove"
105
106
  /* RemoveDetectorKey */
107
+ ]: { windowMs: 6e4, limit: 5 },
108
+ [
109
+ "/v1/prosopo/provider/admin/maintenance/toggle"
110
+ /* ToggleMaintenanceMode */
106
111
  ]: { windowMs: 6e4, limit: 5 }
107
112
  };
108
113
  const createRateLimitSchemaWithDefaults = (paths) => z.object(
@@ -174,7 +179,8 @@ const SubmitPowCaptchaSolutionBody = z.object({
174
179
  const GetFrictionlessCaptchaChallengeRequestBody = z.object({
175
180
  [params.ApiParams.dapp]: z.string(),
176
181
  [params.ApiParams.token]: z.string(),
177
- [params.ApiParams.user]: z.string()
182
+ [params.ApiParams.user]: z.string(),
183
+ [params.ApiParams.headHash]: z.string()
178
184
  });
179
185
  const VerifyPowCaptchaSolutionBody = z.object({
180
186
  [params.ApiParams.siteKey]: z.string()
@@ -191,6 +197,9 @@ const RemoveDetectorKeyBodySpec = z.object({
191
197
  [params.ApiParams.detectorKey]: z.string(),
192
198
  [params.ApiParams.expirationInSeconds]: z.number().positive().optional()
193
199
  });
200
+ const ToggleMaintenanceModeBody = z.object({
201
+ [params.ApiParams.enabled]: z.boolean()
202
+ });
194
203
  const ProsopoCaptchaCountConfigSchema = z.object({
195
204
  solved: z.object({
196
205
  count: z.number().positive()
@@ -235,6 +244,7 @@ exports.RegisterSitekeyBody = RegisterSitekeyBody;
235
244
  exports.RemoveDetectorKeyBodySpec = RemoveDetectorKeyBodySpec;
236
245
  exports.ServerPowCaptchaVerifyRequestBody = ServerPowCaptchaVerifyRequestBody;
237
246
  exports.SubmitPowCaptchaSolutionBody = SubmitPowCaptchaSolutionBody;
247
+ exports.ToggleMaintenanceModeBody = ToggleMaintenanceModeBody;
238
248
  exports.UpdateDetectorKeyBody = UpdateDetectorKeyBody;
239
249
  exports.VerifyPowCaptchaSolutionBody = VerifyPowCaptchaSolutionBody;
240
250
  exports.VerifySolutionBody = VerifySolutionBody;
@@ -24,6 +24,7 @@ exports.RegisterSitekeyBody = api.RegisterSitekeyBody;
24
24
  exports.RemoveDetectorKeyBodySpec = api.RemoveDetectorKeyBodySpec;
25
25
  exports.ServerPowCaptchaVerifyRequestBody = api.ServerPowCaptchaVerifyRequestBody;
26
26
  exports.SubmitPowCaptchaSolutionBody = api.SubmitPowCaptchaSolutionBody;
27
+ exports.ToggleMaintenanceModeBody = api.ToggleMaintenanceModeBody;
27
28
  exports.UpdateDetectorKeyBody = api.UpdateDetectorKeyBody;
28
29
  exports.VerifyPowCaptchaSolutionBody = api.VerifyPowCaptchaSolutionBody;
29
30
  exports.VerifySolutionBody = api.VerifySolutionBody;
@@ -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,5 +1,5 @@
1
1
  import { Tier, TierMonthlyLimits, TierSchema } from "./user.js";
2
- import { ClientSettingsSchema, IPValidationAction, IPValidationActionSchema, IPValidationRulesSchema, abuseScoreThresholdDefault, abuseScoreThresholdExceedActionDefault, captchaTypeDefault, cityChangeActionDefault, countryChangeActionDefault, distanceExceedActionDefault, distanceThresholdKmDefault, domainsDefault, frictionlessThresholdDefault, imageThresholdDefault, ispChangeActionDefault, powDifficultyDefault, requireAllConditionsDefault } from "./settings.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
3
  import { CaptchaType, CaptchaTypeSchema } from "./captchaType/captchaType.js";
4
4
  import { CaptchaTypeSpec } from "./captchaType/captchaTypeSpec.js";
5
5
  export {
@@ -17,6 +17,7 @@ export {
17
17
  abuseScoreThresholdExceedActionDefault,
18
18
  captchaTypeDefault,
19
19
  cityChangeActionDefault,
20
+ contextAwareThresholdDefault,
20
21
  countryChangeActionDefault,
21
22
  distanceExceedActionDefault,
22
23
  distanceThresholdKmDefault,
@@ -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",
@@ -139,6 +140,7 @@ export declare const IPValidationRulesSchema: z.ZodObject<{
139
140
  abuseScoreThreshold?: number | undefined;
140
141
  requireAllConditions?: boolean | undefined;
141
142
  }>>>;
143
+ forceConsistentIp: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
142
144
  }, "strip", z.ZodTypeAny, {
143
145
  actions: {
144
146
  countryChangeAction: IPValidationAction;
@@ -150,6 +152,7 @@ export declare const IPValidationRulesSchema: z.ZodObject<{
150
152
  distanceThresholdKm: number;
151
153
  abuseScoreThreshold: number;
152
154
  requireAllConditions: boolean;
155
+ forceConsistentIp: boolean;
153
156
  countryOverrides?: Record<string, {
154
157
  actions: {
155
158
  countryChangeAction?: IPValidationAction | undefined;
@@ -185,6 +188,7 @@ export declare const IPValidationRulesSchema: z.ZodObject<{
185
188
  abuseScoreThreshold?: number | undefined;
186
189
  requireAllConditions?: boolean | undefined;
187
190
  }> | undefined;
191
+ forceConsistentIp?: boolean | undefined;
188
192
  }>;
189
193
  export declare const ClientSettingsSchema: z.ZodObject<{
190
194
  captchaType: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof CaptchaType>>>;
@@ -261,6 +265,7 @@ export declare const ClientSettingsSchema: z.ZodObject<{
261
265
  abuseScoreThreshold?: number | undefined;
262
266
  requireAllConditions?: boolean | undefined;
263
267
  }>>>;
268
+ forceConsistentIp: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
264
269
  }, "strip", z.ZodTypeAny, {
265
270
  actions: {
266
271
  countryChangeAction: IPValidationAction;
@@ -272,6 +277,7 @@ export declare const ClientSettingsSchema: z.ZodObject<{
272
277
  distanceThresholdKm: number;
273
278
  abuseScoreThreshold: number;
274
279
  requireAllConditions: boolean;
280
+ forceConsistentIp: boolean;
275
281
  countryOverrides?: Record<string, {
276
282
  actions: {
277
283
  countryChangeAction?: IPValidationAction | undefined;
@@ -307,6 +313,18 @@ export declare const ClientSettingsSchema: z.ZodObject<{
307
313
  abuseScoreThreshold?: number | undefined;
308
314
  requireAllConditions?: boolean | undefined;
309
315
  }> | undefined;
316
+ forceConsistentIp?: boolean | undefined;
317
+ }>>;
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;
310
328
  }>>;
311
329
  }, "strip", z.ZodTypeAny, {
312
330
  captchaType: CaptchaType;
@@ -325,6 +343,7 @@ export declare const ClientSettingsSchema: z.ZodObject<{
325
343
  distanceThresholdKm: number;
326
344
  abuseScoreThreshold: number;
327
345
  requireAllConditions: boolean;
346
+ forceConsistentIp: boolean;
328
347
  countryOverrides?: Record<string, {
329
348
  actions: {
330
349
  countryChangeAction?: IPValidationAction | undefined;
@@ -338,6 +357,11 @@ export declare const ClientSettingsSchema: z.ZodObject<{
338
357
  requireAllConditions?: boolean | undefined;
339
358
  }> | undefined;
340
359
  } | undefined;
360
+ disallowWebView?: boolean | undefined;
361
+ contextAware?: {
362
+ enabled: boolean;
363
+ threshold: number;
364
+ } | undefined;
341
365
  }, {
342
366
  captchaType?: CaptchaType | undefined;
343
367
  domains?: string[] | undefined;
@@ -367,6 +391,12 @@ export declare const ClientSettingsSchema: z.ZodObject<{
367
391
  abuseScoreThreshold?: number | undefined;
368
392
  requireAllConditions?: boolean | undefined;
369
393
  }> | undefined;
394
+ forceConsistentIp?: boolean | undefined;
395
+ } | undefined;
396
+ disallowWebView?: boolean | undefined;
397
+ contextAware?: {
398
+ enabled?: boolean | undefined;
399
+ threshold?: number | undefined;
370
400
  } | undefined;
371
401
  }>;
372
402
  export type IUserSettings = output<typeof ClientSettingsSchema>;
@@ -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;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;;;;;;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M,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -6,6 +6,7 @@ const domainsDefault = [];
6
6
  const frictionlessThresholdDefault = 0.5;
7
7
  const powDifficultyDefault = 4;
8
8
  const imageThresholdDefault = 0.8;
9
+ const contextAwareThresholdDefault = 0.7;
9
10
  var IPValidationAction = /* @__PURE__ */ ((IPValidationAction2) => {
10
11
  IPValidationAction2["Allow"] = "allow";
11
12
  IPValidationAction2["Reject"] = "reject";
@@ -56,7 +57,8 @@ const IPValidationRulesSchema = object({
56
57
  abuseScoreThreshold: number().positive().optional().default(abuseScoreThresholdDefault),
57
58
  requireAllConditions: z.boolean().optional().default(requireAllConditionsDefault),
58
59
  // overrides are now lightweight, not recursive
59
- countryOverrides: z.record(string(), IPValidationSchema).optional()
60
+ countryOverrides: z.record(string(), IPValidationSchema).optional(),
61
+ forceConsistentIp: boolean().optional().default(false)
60
62
  });
61
63
  const ClientSettingsSchema = object({
62
64
  captchaType: CaptchaTypeSpec.optional().default(captchaTypeDefault),
@@ -64,7 +66,12 @@ const ClientSettingsSchema = object({
64
66
  frictionlessThreshold: number().optional().default(frictionlessThresholdDefault),
65
67
  powDifficulty: number().optional().default(powDifficultyDefault),
66
68
  imageThreshold: number().optional().default(imageThresholdDefault),
67
- ipValidationRules: IPValidationRulesSchema.optional()
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()
68
75
  });
69
76
  export {
70
77
  ClientSettingsSchema,
@@ -75,6 +82,7 @@ export {
75
82
  abuseScoreThresholdExceedActionDefault,
76
83
  captchaTypeDefault,
77
84
  cityChangeActionDefault,
85
+ contextAwareThresholdDefault,
78
86
  countryChangeActionDefault,
79
87
  distanceExceedActionDefault,
80
88
  distanceThresholdKmDefault,
@@ -1,5 +1,4 @@
1
1
  import { z } from "zod";
2
- import type { Timestamp } from "../datasets/index.js";
3
2
  import type { IUserSettings } from "./settings.js";
4
3
  export declare enum Tier {
5
4
  Free = "free",
@@ -24,13 +23,13 @@ export interface IUserData {
24
23
  account: string;
25
24
  url: string;
26
25
  mnemonic: string;
27
- createdAt: Timestamp;
26
+ createdAt: Date;
28
27
  activated: boolean;
29
28
  tier: Tier;
30
29
  tierRequestQuota: number;
31
30
  marketingPreferences: boolean;
32
31
  originUrl: string;
33
32
  settings: IUserSettings;
34
- updatedAtTimestamp?: Timestamp;
33
+ updatedAtTimestamp?: Date;
35
34
  }
36
35
  //# sourceMappingURL=user.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/client/user.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,oBAAY,IAAI;IACf,IAAI,SAAS;IACb,YAAY,iBAAiB;IAC7B,UAAU,eAAe;CACzB;AAED,eAAO,MAAM,UAAU,8BAAqB,CAAC;AAE7C,eAAO,MAAM,iBAAiB;;;;;;;;;;CAU7B,CAAC;AAEF,MAAM,WAAW,SAAS;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;IACX,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,aAAa,CAAC;IACxB,kBAAkB,CAAC,EAAE,SAAS,CAAC;CAC/B"}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