@prosopo/types 3.0.6 → 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 +214 -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 +9 -1
  17. package/dist/cjs/config/frictionless.cjs +4 -1
  18. package/dist/cjs/config/index.cjs +2 -0
  19. package/dist/cjs/datasets/captcha.cjs +1 -1
  20. package/dist/cjs/index.cjs +15 -0
  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 +37 -0
  29. package/dist/config/config.d.ts.map +1 -1
  30. package/dist/config/config.js +10 -2
  31. package/dist/config/frictionless.d.ts +4 -0
  32. package/dist/config/frictionless.d.ts.map +1 -1
  33. package/dist/config/frictionless.js +5 -2
  34. package/dist/config/index.js +4 -2
  35. package/dist/datasets/captcha.js +1 -1
  36. package/dist/index.js +20 -5
  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 +9 -12
package/CHANGELOG.md CHANGED
@@ -1,5 +1,219 @@
1
1
  # @prosopo/types
2
2
 
3
+ ## 3.5.3
4
+ ### Patch Changes
5
+
6
+ - Updated dependencies [1e3a838]
7
+ - @prosopo/config@3.1.20
8
+ - @prosopo/locale@3.1.20
9
+ - @prosopo/util@3.1.5
10
+ - @prosopo/util-crypto@13.5.22
11
+
12
+ ## 3.5.2
13
+ ### Patch Changes
14
+
15
+ - 5659b24: Release 3.4.4
16
+ - Updated dependencies [5659b24]
17
+ - @prosopo/util-crypto@13.5.21
18
+ - @prosopo/locale@3.1.19
19
+ - @prosopo/util@3.1.4
20
+ - @prosopo/config@3.1.19
21
+
22
+ ## 3.5.1
23
+ ### Patch Changes
24
+
25
+ - 52cd544: Integrity checks
26
+ - b117ba3: Hot fix country code
27
+ - 50c4120: Release 3.4.3
28
+ - Updated dependencies [50c4120]
29
+ - @prosopo/util-crypto@13.5.20
30
+ - @prosopo/locale@3.1.18
31
+ - @prosopo/util@3.1.3
32
+ - @prosopo/config@3.1.18
33
+
34
+ ## 3.5.0
35
+ ### Minor Changes
36
+
37
+ - e20ad6b: IP country overrides
38
+
39
+ ### Patch Changes
40
+
41
+ - 618703f: Release 3.4.2
42
+ - Updated dependencies [618703f]
43
+ - @prosopo/util-crypto@13.5.19
44
+ - @prosopo/locale@3.1.17
45
+ - @prosopo/util@3.1.2
46
+ - @prosopo/config@3.1.17
47
+
48
+ ## 3.4.1
49
+ ### Patch Changes
50
+
51
+ - 11303d9: Release 3.4.0
52
+ - 18cb28b: Release 3.4.1
53
+ - 11303d9: feat/pluggable-redis
54
+ - Updated dependencies [11303d9]
55
+ - Updated dependencies [18cb28b]
56
+ - @prosopo/util-crypto@13.5.18
57
+ - @prosopo/locale@3.1.16
58
+ - @prosopo/util@3.1.1
59
+ - @prosopo/config@3.1.16
60
+
61
+ ## 3.4.0
62
+ ### Minor Changes
63
+
64
+ - 6768f14: Update salt
65
+
66
+ ### Patch Changes
67
+
68
+ - f3f7aec: Release 3.4.0
69
+ - Updated dependencies [f3f7aec]
70
+ - Updated dependencies [6768f14]
71
+ - @prosopo/util-crypto@13.5.17
72
+ - @prosopo/locale@3.1.15
73
+ - @prosopo/util@3.1.0
74
+ - @prosopo/config@3.1.15
75
+
76
+ ## 3.3.0
77
+ ### Minor Changes
78
+
79
+ - 97edf3f: Adding dom manip checks
80
+
81
+ ### Patch Changes
82
+
83
+ - Release 3.3.1
84
+ - 0824221: Release 3.2.4
85
+ - Updated dependencies
86
+ - Updated dependencies [0824221]
87
+ - @prosopo/util-crypto@13.5.16
88
+ - @prosopo/locale@3.1.14
89
+ - @prosopo/util@3.0.17
90
+ - @prosopo/config@3.1.14
91
+
92
+ ## 3.2.1
93
+ ### Patch Changes
94
+
95
+ - 509be28: Fix IP conditions logic
96
+ - 008d112: Release 3.3.0
97
+ - Updated dependencies [008d112]
98
+ - @prosopo/util-crypto@13.5.15
99
+ - @prosopo/locale@3.1.13
100
+ - @prosopo/util@3.0.16
101
+ - @prosopo/config@3.1.13
102
+
103
+ ## 3.2.0
104
+ ### Minor Changes
105
+
106
+ - cf48565: Store additional details. Remove duplicate indexes.
107
+
108
+ ### Patch Changes
109
+
110
+ - 0824221: Release 3.2.4
111
+ - Updated dependencies [0824221]
112
+ - @prosopo/util-crypto@13.5.14
113
+ - @prosopo/locale@3.1.12
114
+ - @prosopo/util@3.0.15
115
+ - @prosopo/config@3.1.12
116
+
117
+ ## 3.1.4
118
+ ### Patch Changes
119
+
120
+ - 0d1a33e: Adding ipcomparison service with user features
121
+ - 0d1a33e: Adding ip comparison service
122
+ - 1a23649: Release 3.2.3
123
+ - Updated dependencies [0d1a33e]
124
+ - Updated dependencies [1a23649]
125
+ - @prosopo/locale@3.1.11
126
+ - @prosopo/util-crypto@13.5.13
127
+ - @prosopo/util@3.0.14
128
+ - @prosopo/config@3.1.11
129
+
130
+ ## 3.1.3
131
+ ### Patch Changes
132
+
133
+ - 657a827: Release 3.2.2
134
+ - Updated dependencies [657a827]
135
+ - @prosopo/util-crypto@13.5.12
136
+ - @prosopo/locale@3.1.10
137
+ - @prosopo/util@3.0.13
138
+ - @prosopo/config@3.1.10
139
+
140
+ ## 3.1.2
141
+ ### Patch Changes
142
+
143
+ - 4440947: fix type-only tsc compilation
144
+ - 7bdaca6: Release 3.2.1
145
+ - 1249ce0: Be more lenient with random provider selection
146
+ - Updated dependencies [4440947]
147
+ - Updated dependencies [7bdaca6]
148
+ - Updated dependencies [809b984]
149
+ - Updated dependencies [809b984]
150
+ - @prosopo/util-crypto@13.5.11
151
+ - @prosopo/locale@3.1.9
152
+ - @prosopo/util@3.0.12
153
+ - @prosopo/config@3.1.9
154
+
155
+ ## 3.1.1
156
+ ### Patch Changes
157
+
158
+ - 1f980c4: Fix types mismatch in decryption
159
+ - 6fe8570: Release 3.2.0
160
+ - Updated dependencies [6fe8570]
161
+ - @prosopo/util-crypto@13.5.10
162
+ - @prosopo/locale@3.1.8
163
+ - @prosopo/util@3.0.11
164
+ - @prosopo/config@3.1.8
165
+
166
+ ## 3.1.0
167
+ ### Minor Changes
168
+
169
+ - 8bdc7f0: Using detector to select provider
170
+
171
+ ### Patch Changes
172
+
173
+ - f304be9: Release 3.1.13
174
+ - Updated dependencies [f304be9]
175
+ - @prosopo/util-crypto@13.5.9
176
+ - @prosopo/locale@3.1.7
177
+ - @prosopo/util@3.0.10
178
+ - @prosopo/config@3.1.7
179
+
180
+ ## 3.0.10
181
+ ### Patch Changes
182
+
183
+ - Updated dependencies [9eed772]
184
+ - Updated dependencies [ebb0168]
185
+ - @prosopo/config@3.1.6
186
+ - @prosopo/util@3.0.9
187
+ - @prosopo/locale@3.1.6
188
+ - @prosopo/util-crypto@13.5.8
189
+
190
+ ## 3.0.9
191
+ ### Patch Changes
192
+
193
+ - 6960643: lint detect missing and unneccessary imports
194
+ - Updated dependencies [d8e855c]
195
+ - Updated dependencies [6960643]
196
+ - @prosopo/locale@3.1.5
197
+ - @prosopo/util-crypto@13.5.7
198
+ - @prosopo/util@3.0.8
199
+
200
+ ## 3.0.8
201
+ ### Patch Changes
202
+
203
+ - Updated dependencies [30e7d4d]
204
+ - @prosopo/config@3.1.5
205
+ - @prosopo/common@3.1.4
206
+ - @prosopo/locale@3.1.4
207
+
208
+ ## 3.0.7
209
+ ### Patch Changes
210
+
211
+ - Updated dependencies [44ffda2]
212
+ - Updated dependencies [a49b538]
213
+ - @prosopo/config@3.1.4
214
+ - @prosopo/common@3.1.3
215
+ - @prosopo/locale@3.1.3
216
+
3
217
  ## 3.0.6
4
218
  ### Patch Changes
5
219
 
@@ -1,3 +1,4 @@
1
1
  export * from "./api.js";
2
2
  export * from "./params.js";
3
+ export * from "./ipapi.js";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
package/dist/api/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import "./api.js";
2
2
  import { ApiParams } from "./params.js";
3
+ import "./ipapi.js";
3
4
  export {
4
5
  ApiParams
5
6
  };
@@ -0,0 +1,171 @@
1
+ export interface IPApiDatacenterInfo {
2
+ datacenter: string;
3
+ network: string;
4
+ country?: string;
5
+ region?: string;
6
+ city?: string;
7
+ domain?: string;
8
+ code?: string;
9
+ name?: string;
10
+ state?: string;
11
+ service?: string;
12
+ network_border_group?: string;
13
+ }
14
+ export interface IPApiCompanyInfo {
15
+ name: string;
16
+ abuser_score: string;
17
+ domain: string;
18
+ type: "hosting" | "education" | "government" | "banking" | "business" | "isp";
19
+ network: string;
20
+ whois: string;
21
+ }
22
+ export interface IPApiAbuseInfo {
23
+ name: string;
24
+ address: string;
25
+ email: string;
26
+ phone?: string;
27
+ country?: string;
28
+ }
29
+ export interface IPApiASNInfo {
30
+ asn: number;
31
+ abuser_score: string;
32
+ route: string;
33
+ descr: string;
34
+ country: string;
35
+ active: boolean;
36
+ org: string;
37
+ domain: string;
38
+ abuse: string;
39
+ type: "hosting" | "education" | "government" | "banking" | "business" | "isp";
40
+ created: string;
41
+ updated: string;
42
+ rir: string;
43
+ whois: string;
44
+ }
45
+ export interface IPApiLocationInfo {
46
+ is_eu_member: boolean;
47
+ calling_code: string;
48
+ currency_code: string;
49
+ continent: string;
50
+ country: string;
51
+ country_code: string;
52
+ state: string;
53
+ city: string;
54
+ latitude: number;
55
+ longitude: number;
56
+ zip: string;
57
+ timezone: string;
58
+ local_time: string;
59
+ local_time_unix: number;
60
+ is_dst: boolean;
61
+ other?: string[];
62
+ }
63
+ export interface IPApiVPNInfo {
64
+ ip: string;
65
+ service: string;
66
+ url: string;
67
+ type: "exit_node" | "vpn_server";
68
+ last_seen: number;
69
+ last_seen_str: string;
70
+ exit_node_region?: string;
71
+ country_code: string;
72
+ city_name: string;
73
+ latitude: number;
74
+ longitude: number;
75
+ }
76
+ export interface IPApiResponse {
77
+ ip: string;
78
+ rir: "ARIN" | "RIPE" | "APNIC" | "LACNIC" | "AFRINIC";
79
+ is_bogon: boolean;
80
+ is_mobile: boolean;
81
+ is_satellite: boolean;
82
+ is_crawler: boolean | string;
83
+ is_datacenter: boolean;
84
+ is_tor: boolean;
85
+ is_proxy: boolean;
86
+ is_vpn: boolean;
87
+ is_abuser: boolean;
88
+ datacenter?: IPApiDatacenterInfo;
89
+ company?: IPApiCompanyInfo;
90
+ abuse?: IPApiAbuseInfo;
91
+ asn?: IPApiASNInfo;
92
+ location?: IPApiLocationInfo;
93
+ vpn?: IPApiVPNInfo;
94
+ elapsed_ms: number;
95
+ }
96
+ export interface IPInfoResult {
97
+ ip: string;
98
+ isValid: boolean;
99
+ isVPN: boolean;
100
+ isTor: boolean;
101
+ isProxy: boolean;
102
+ isDatacenter: boolean;
103
+ isAbuser: boolean;
104
+ isMobile: boolean;
105
+ isSatellite: boolean;
106
+ providerName?: string;
107
+ providerType?: "hosting" | "education" | "government" | "banking" | "business" | "isp";
108
+ asnNumber?: number;
109
+ asnOrganization?: string;
110
+ country?: string;
111
+ countryCode?: string;
112
+ region?: string;
113
+ city?: string;
114
+ latitude?: number;
115
+ longitude?: number;
116
+ timezone?: string;
117
+ vpnService?: string;
118
+ vpnType?: "exit_node" | "vpn_server";
119
+ abuserScore?: number;
120
+ companyAbuserScore?: number;
121
+ rawResponse?: IPApiResponse;
122
+ }
123
+ export interface IPInfoError {
124
+ isValid: false;
125
+ error: string;
126
+ ip: string;
127
+ }
128
+ export type IPInfoResponse = IPInfoResult | IPInfoError;
129
+ export type IPConnectionType = "datacenter" | "mobile" | "satellite" | "residential" | "unknown";
130
+ type IPDetails = {
131
+ provider?: string;
132
+ connectionType: IPConnectionType;
133
+ isVpnOrProxy: boolean;
134
+ country?: string;
135
+ countryCode?: string;
136
+ city?: string;
137
+ coordinates?: {
138
+ latitude: number;
139
+ longitude: number;
140
+ };
141
+ abuserScore?: number;
142
+ };
143
+ export type IPComparison = {
144
+ differentProviders: boolean;
145
+ differentConnectionTypes: boolean;
146
+ distanceKm?: number;
147
+ anyVpnOrProxy: boolean;
148
+ ip1Details: IPDetails;
149
+ ip2Details: IPDetails;
150
+ };
151
+ export interface IPComparisonResult {
152
+ ipsMatch: boolean;
153
+ ip1: string;
154
+ ip2: string;
155
+ comparison?: IPComparison;
156
+ }
157
+ export interface IPComparisonError {
158
+ error: string;
159
+ ip1: string;
160
+ ip2: string;
161
+ ip1Error?: string;
162
+ ip2Error?: string;
163
+ }
164
+ export type IPComparisonResponse = IPComparisonResult | IPComparisonError;
165
+ export interface IPAssessmentResult {
166
+ verdict: "match" | "similar" | "wildlyDifferent";
167
+ distanceKm?: number;
168
+ comparison?: IPComparisonResult["comparison"];
169
+ }
170
+ export {};
171
+ //# sourceMappingURL=ipapi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ipapi.d.ts","sourceRoot":"","sources":["../../src/api/ipapi.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,mBAAmB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,SAAS,GAAG,WAAW,GAAG,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,KAAK,CAAC;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAA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Q,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,wBAAwB,EAAE,OAAO,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,SAAS,CAAC;IACtB,UAAU,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,MAAM,WAAW,kBAAkB;IAClC,QAAQ,EAAE,OAAO,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,YAAY,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,GAAG,iBAAiB,CAAC;AAE1E,MAAM,WAAW,kBAAkB;IAClC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,iBAAiB,CAAC;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;CAC9C"}
@@ -0,0 +1 @@
1
+
@@ -35,6 +35,7 @@ export declare enum ApiParams {
35
35
  score = "score",
36
36
  tier = "tier",
37
37
  detectorKey = "detectorKey",
38
- ip = "ip"
38
+ ip = "ip",
39
+ expirationInSeconds = "expirationInSeconds"
39
40
  }
40
41
  //# sourceMappingURL=params.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../../src/api/params.ts"],"names":[],"mappings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AAQ,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"}
@@ -36,6 +36,7 @@ var ApiParams = /* @__PURE__ */ ((ApiParams2) => {
36
36
  ApiParams2["tier"] = "tier";
37
37
  ApiParams2["detectorKey"] = "detectorKey";
38
38
  ApiParams2["ip"] = "ip";
39
+ ApiParams2["expirationInSeconds"] = "expirationInSeconds";
39
40
  return ApiParams2;
40
41
  })(ApiParams || {});
41
42
  export {
@@ -2,4 +2,5 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("./api.cjs");
4
4
  const params = require("./params.cjs");
5
+ require("./ipapi.cjs");
5
6
  exports.ApiParams = params.ApiParams;
@@ -0,0 +1 @@
1
+ "use strict";
@@ -38,6 +38,7 @@ var ApiParams = /* @__PURE__ */ ((ApiParams2) => {
38
38
  ApiParams2["tier"] = "tier";
39
39
  ApiParams2["detectorKey"] = "detectorKey";
40
40
  ApiParams2["ip"] = "ip";
41
+ ApiParams2["expirationInSeconds"] = "expirationInSeconds";
41
42
  return ApiParams2;
42
43
  })(ApiParams || {});
43
44
  exports.ApiParams = ApiParams;
@@ -8,11 +8,22 @@ exports.Tier = user.Tier;
8
8
  exports.TierMonthlyLimits = user.TierMonthlyLimits;
9
9
  exports.TierSchema = user.TierSchema;
10
10
  exports.ClientSettingsSchema = settings.ClientSettingsSchema;
11
+ exports.IPValidationAction = settings.IPValidationAction;
12
+ exports.IPValidationActionSchema = settings.IPValidationActionSchema;
13
+ exports.IPValidationRulesSchema = settings.IPValidationRulesSchema;
14
+ exports.abuseScoreThresholdDefault = settings.abuseScoreThresholdDefault;
15
+ exports.abuseScoreThresholdExceedActionDefault = settings.abuseScoreThresholdExceedActionDefault;
11
16
  exports.captchaTypeDefault = settings.captchaTypeDefault;
17
+ exports.cityChangeActionDefault = settings.cityChangeActionDefault;
18
+ exports.countryChangeActionDefault = settings.countryChangeActionDefault;
19
+ exports.distanceExceedActionDefault = settings.distanceExceedActionDefault;
20
+ exports.distanceThresholdKmDefault = settings.distanceThresholdKmDefault;
12
21
  exports.domainsDefault = settings.domainsDefault;
13
22
  exports.frictionlessThresholdDefault = settings.frictionlessThresholdDefault;
14
23
  exports.imageThresholdDefault = settings.imageThresholdDefault;
24
+ exports.ispChangeActionDefault = settings.ispChangeActionDefault;
15
25
  exports.powDifficultyDefault = settings.powDifficultyDefault;
26
+ exports.requireAllConditionsDefault = settings.requireAllConditionsDefault;
16
27
  exports.CaptchaType = captchaType.CaptchaType;
17
28
  exports.CaptchaTypeSchema = captchaType.CaptchaTypeSchema;
18
29
  exports.CaptchaTypeSpec = captchaTypeSpec.CaptchaTypeSpec;
@@ -8,16 +8,80 @@ const domainsDefault = [];
8
8
  const frictionlessThresholdDefault = 0.5;
9
9
  const powDifficultyDefault = 4;
10
10
  const imageThresholdDefault = 0.8;
11
+ var IPValidationAction = /* @__PURE__ */ ((IPValidationAction2) => {
12
+ IPValidationAction2["Allow"] = "allow";
13
+ IPValidationAction2["Reject"] = "reject";
14
+ IPValidationAction2["Flag"] = "flag";
15
+ return IPValidationAction2;
16
+ })(IPValidationAction || {});
17
+ const IPValidationActionSchema = z.z.nativeEnum(IPValidationAction);
18
+ const countryChangeActionDefault = "allow";
19
+ const cityChangeActionDefault = "allow";
20
+ const ispChangeActionDefault = "allow";
21
+ const distanceThresholdKmDefault = 1e3;
22
+ const abuseScoreThresholdDefault = 5e-3;
23
+ const distanceExceedActionDefault = "reject";
24
+ const abuseScoreThresholdExceedActionDefault = "reject";
25
+ const requireAllConditionsDefault = false;
26
+ const IPValidationSchema = z.object({
27
+ actions: z.object({
28
+ countryChangeAction: IPValidationActionSchema.optional(),
29
+ cityChangeAction: IPValidationActionSchema.optional(),
30
+ ispChangeAction: IPValidationActionSchema.optional(),
31
+ distanceExceedAction: IPValidationActionSchema.optional(),
32
+ abuseScoreExceedAction: IPValidationActionSchema.optional()
33
+ }).partial(),
34
+ // all optional, so you can just override what you need
35
+ distanceThresholdKm: z.number().positive().optional(),
36
+ abuseScoreThreshold: z.number().positive().optional(),
37
+ requireAllConditions: z.boolean().optional()
38
+ });
39
+ const IPValidationRulesSchema = z.object({
40
+ actions: z.object({
41
+ countryChangeAction: IPValidationActionSchema.optional().default(
42
+ countryChangeActionDefault
43
+ ),
44
+ cityChangeAction: IPValidationActionSchema.optional().default(
45
+ cityChangeActionDefault
46
+ ),
47
+ ispChangeAction: IPValidationActionSchema.optional().default(
48
+ ispChangeActionDefault
49
+ ),
50
+ distanceExceedAction: IPValidationActionSchema.optional().default(
51
+ distanceExceedActionDefault
52
+ ),
53
+ abuseScoreExceedAction: IPValidationActionSchema.optional().default(
54
+ abuseScoreThresholdExceedActionDefault
55
+ )
56
+ }),
57
+ distanceThresholdKm: z.number().positive().optional().default(distanceThresholdKmDefault),
58
+ abuseScoreThreshold: z.number().positive().optional().default(abuseScoreThresholdDefault),
59
+ requireAllConditions: z.z.boolean().optional().default(requireAllConditionsDefault),
60
+ // overrides are now lightweight, not recursive
61
+ countryOverrides: z.z.record(z.string(), IPValidationSchema).optional()
62
+ });
11
63
  const ClientSettingsSchema = z.object({
12
64
  captchaType: captchaTypeSpec.CaptchaTypeSpec.optional().default(captchaTypeDefault),
13
65
  domains: z.array(z.string()).optional().default([...domainsDefault]),
14
66
  frictionlessThreshold: z.number().optional().default(frictionlessThresholdDefault),
15
67
  powDifficulty: z.number().optional().default(powDifficultyDefault),
16
- imageThreshold: z.number().optional().default(imageThresholdDefault)
68
+ imageThreshold: z.number().optional().default(imageThresholdDefault),
69
+ ipValidationRules: IPValidationRulesSchema.optional()
17
70
  });
18
71
  exports.ClientSettingsSchema = ClientSettingsSchema;
72
+ exports.IPValidationAction = IPValidationAction;
73
+ exports.IPValidationActionSchema = IPValidationActionSchema;
74
+ exports.IPValidationRulesSchema = IPValidationRulesSchema;
75
+ exports.abuseScoreThresholdDefault = abuseScoreThresholdDefault;
76
+ exports.abuseScoreThresholdExceedActionDefault = abuseScoreThresholdExceedActionDefault;
19
77
  exports.captchaTypeDefault = captchaTypeDefault;
78
+ exports.cityChangeActionDefault = cityChangeActionDefault;
79
+ exports.countryChangeActionDefault = countryChangeActionDefault;
80
+ exports.distanceExceedActionDefault = distanceExceedActionDefault;
81
+ exports.distanceThresholdKmDefault = distanceThresholdKmDefault;
20
82
  exports.domainsDefault = domainsDefault;
21
83
  exports.frictionlessThresholdDefault = frictionlessThresholdDefault;
22
84
  exports.imageThresholdDefault = imageThresholdDefault;
85
+ exports.ispChangeActionDefault = ispChangeActionDefault;
23
86
  exports.powDifficultyDefault = powDifficultyDefault;
87
+ exports.requireAllConditionsDefault = requireAllConditionsDefault;
@@ -166,15 +166,21 @@ const ProcaptchaConfigSchema = ProsopoClientConfigSchema.and(
166
166
  )
167
167
  })
168
168
  );
169
+ const IpApiServiceSpec = z.object({
170
+ apiKey: z.string(),
171
+ baseUrl: z.string().url()
172
+ });
169
173
  const ProsopoConfigSchema = ProsopoBasicConfigSchema.merge(
170
174
  z.object({
175
+ host: z.string(),
171
176
  captchas: api.ProsopoCaptchaCountConfigSchema.optional().default({
172
177
  solved: { count: api.DEFAULT_SOLVED_COUNT },
173
178
  unsolved: { count: api.DEFAULT_UNSOLVED_COUNT }
174
179
  }),
175
180
  penalties: frictionless.FrictionlessPenalties.optional().default({
176
181
  PENALTY_OLD_TIMESTAMP: frictionless.PENALTY_OLD_TIMESTAMP_DEFAULT,
177
- PENALTY_ACCESS_RULE: frictionless.PENALTY_ACCESS_RULE_DEFAULT
182
+ PENALTY_ACCESS_RULE: frictionless.PENALTY_ACCESS_RULE_DEFAULT,
183
+ PENALTY_UNVERIFIED_HOST: frictionless.PENALTY_UNVERIFIED_HOST_DEFAULT
178
184
  }),
179
185
  scheduledTasks: z.object({
180
186
  captchaScheduler: z.object({
@@ -188,6 +194,7 @@ const ProsopoConfigSchema = ProsopoBasicConfigSchema.merge(
188
194
  mongoEventsUri: z.string().optional(),
189
195
  mongoCaptchaUri: z.string().optional(),
190
196
  mongoClientUri: z.string().optional(),
197
+ ipApi: IpApiServiceSpec,
191
198
  redisConnection: z.object({
192
199
  url: z.string(),
193
200
  password: z.string(),
@@ -211,6 +218,7 @@ exports.CaptchaTimeoutSchema = CaptchaTimeoutSchema;
211
218
  exports.DatabaseConfigSchema = DatabaseConfigSchema;
212
219
  exports.DatabaseTypes = DatabaseTypes;
213
220
  exports.EnvironmentTypesSchema = EnvironmentTypesSchema;
221
+ exports.IpApiServiceSpec = IpApiServiceSpec;
214
222
  exports.Mode = Mode;
215
223
  exports.ModeEnum = ModeEnum;
216
224
  exports.PolkadotSecretJSONSpec = PolkadotSecretJSONSpec;
@@ -3,10 +3,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const z = require("zod");
4
4
  const PENALTY_OLD_TIMESTAMP_DEFAULT = 0.2;
5
5
  const PENALTY_ACCESS_RULE_DEFAULT = 0.5;
6
+ const PENALTY_UNVERIFIED_HOST_DEFAULT = 0.2;
6
7
  const FrictionlessPenalties = z.object({
7
8
  PENALTY_OLD_TIMESTAMP: z.number().positive().optional().default(PENALTY_OLD_TIMESTAMP_DEFAULT),
8
- PENALTY_ACCESS_RULE: z.number().positive().optional().default(PENALTY_ACCESS_RULE_DEFAULT)
9
+ 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)
9
11
  });
10
12
  exports.FrictionlessPenalties = FrictionlessPenalties;
11
13
  exports.PENALTY_ACCESS_RULE_DEFAULT = PENALTY_ACCESS_RULE_DEFAULT;
12
14
  exports.PENALTY_OLD_TIMESTAMP_DEFAULT = PENALTY_OLD_TIMESTAMP_DEFAULT;
15
+ exports.PENALTY_UNVERIFIED_HOST_DEFAULT = PENALTY_UNVERIFIED_HOST_DEFAULT;
@@ -9,6 +9,7 @@ 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;
@@ -32,3 +33,4 @@ exports.DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT = timeouts.DEFAULT_POW_CAPTCHA_VERI
32
33
  exports.FrictionlessPenalties = frictionless.FrictionlessPenalties;
33
34
  exports.PENALTY_ACCESS_RULE_DEFAULT = frictionless.PENALTY_ACCESS_RULE_DEFAULT;
34
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({