@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.
- package/CHANGELOG.md +233 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1 -0
- package/dist/api/ipapi.d.ts +171 -0
- package/dist/api/ipapi.d.ts.map +1 -0
- package/dist/api/ipapi.js +1 -0
- package/dist/api/params.d.ts +2 -1
- package/dist/api/params.d.ts.map +1 -1
- package/dist/api/params.js +1 -0
- package/dist/cjs/api/index.cjs +1 -0
- package/dist/cjs/api/ipapi.cjs +1 -0
- package/dist/cjs/api/params.cjs +1 -0
- package/dist/cjs/client/index.cjs +11 -0
- package/dist/cjs/client/settings.cjs +65 -1
- package/dist/cjs/config/config.cjs +23 -5
- package/dist/cjs/config/frictionless.cjs +9 -2
- package/dist/cjs/config/index.cjs +5 -1
- package/dist/cjs/datasets/captcha.cjs +1 -1
- package/dist/cjs/index.cjs +18 -1
- package/dist/cjs/provider/api.cjs +15 -0
- package/dist/cjs/provider/detection.cjs +1 -0
- package/dist/cjs/provider/index.cjs +3 -0
- package/dist/client/index.js +13 -2
- package/dist/client/settings.d.ts +356 -8
- package/dist/client/settings.d.ts.map +1 -1
- package/dist/client/settings.js +67 -3
- package/dist/config/config.d.ts +64 -22
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +24 -6
- package/dist/config/frictionless.d.ts +6 -0
- package/dist/config/frictionless.d.ts.map +1 -1
- package/dist/config/frictionless.js +10 -3
- package/dist/config/index.js +7 -3
- package/dist/datasets/captcha.js +1 -1
- package/dist/index.js +23 -6
- package/dist/procaptcha/manager.d.ts +1 -1
- package/dist/procaptcha/manager.d.ts.map +1 -1
- package/dist/procaptcha/props.d.ts +1 -0
- package/dist/procaptcha/props.d.ts.map +1 -1
- package/dist/procaptcha-frictionless/props.d.ts +1 -1
- package/dist/procaptcha-frictionless/props.d.ts.map +1 -1
- package/dist/provider/api.d.ts +263 -1
- package/dist/provider/api.d.ts.map +1 -1
- package/dist/provider/api.js +17 -2
- package/dist/provider/detection.d.ts +8 -0
- package/dist/provider/detection.d.ts.map +1 -0
- package/dist/provider/detection.js +1 -0
- package/dist/provider/index.d.ts +1 -0
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +5 -2
- package/package.json +11 -15
package/dist/client/settings.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { object,
|
|
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
4
|
const captchaTypeDefault = CaptchaType.frictionless;
|
|
@@ -6,18 +6,82 @@ const domainsDefault = [];
|
|
|
6
6
|
const frictionlessThresholdDefault = 0.5;
|
|
7
7
|
const powDifficultyDefault = 4;
|
|
8
8
|
const imageThresholdDefault = 0.8;
|
|
9
|
+
var IPValidationAction = /* @__PURE__ */ ((IPValidationAction2) => {
|
|
10
|
+
IPValidationAction2["Allow"] = "allow";
|
|
11
|
+
IPValidationAction2["Reject"] = "reject";
|
|
12
|
+
IPValidationAction2["Flag"] = "flag";
|
|
13
|
+
return IPValidationAction2;
|
|
14
|
+
})(IPValidationAction || {});
|
|
15
|
+
const IPValidationActionSchema = z.nativeEnum(IPValidationAction);
|
|
16
|
+
const countryChangeActionDefault = "allow";
|
|
17
|
+
const cityChangeActionDefault = "allow";
|
|
18
|
+
const ispChangeActionDefault = "allow";
|
|
19
|
+
const distanceThresholdKmDefault = 1e3;
|
|
20
|
+
const abuseScoreThresholdDefault = 5e-3;
|
|
21
|
+
const distanceExceedActionDefault = "reject";
|
|
22
|
+
const abuseScoreThresholdExceedActionDefault = "reject";
|
|
23
|
+
const requireAllConditionsDefault = false;
|
|
24
|
+
const IPValidationSchema = object({
|
|
25
|
+
actions: object({
|
|
26
|
+
countryChangeAction: IPValidationActionSchema.optional(),
|
|
27
|
+
cityChangeAction: IPValidationActionSchema.optional(),
|
|
28
|
+
ispChangeAction: IPValidationActionSchema.optional(),
|
|
29
|
+
distanceExceedAction: IPValidationActionSchema.optional(),
|
|
30
|
+
abuseScoreExceedAction: IPValidationActionSchema.optional()
|
|
31
|
+
}).partial(),
|
|
32
|
+
// all optional, so you can just override what you need
|
|
33
|
+
distanceThresholdKm: number().positive().optional(),
|
|
34
|
+
abuseScoreThreshold: number().positive().optional(),
|
|
35
|
+
requireAllConditions: boolean().optional()
|
|
36
|
+
});
|
|
37
|
+
const IPValidationRulesSchema = object({
|
|
38
|
+
actions: object({
|
|
39
|
+
countryChangeAction: IPValidationActionSchema.optional().default(
|
|
40
|
+
countryChangeActionDefault
|
|
41
|
+
),
|
|
42
|
+
cityChangeAction: IPValidationActionSchema.optional().default(
|
|
43
|
+
cityChangeActionDefault
|
|
44
|
+
),
|
|
45
|
+
ispChangeAction: IPValidationActionSchema.optional().default(
|
|
46
|
+
ispChangeActionDefault
|
|
47
|
+
),
|
|
48
|
+
distanceExceedAction: IPValidationActionSchema.optional().default(
|
|
49
|
+
distanceExceedActionDefault
|
|
50
|
+
),
|
|
51
|
+
abuseScoreExceedAction: IPValidationActionSchema.optional().default(
|
|
52
|
+
abuseScoreThresholdExceedActionDefault
|
|
53
|
+
)
|
|
54
|
+
}),
|
|
55
|
+
distanceThresholdKm: number().positive().optional().default(distanceThresholdKmDefault),
|
|
56
|
+
abuseScoreThreshold: number().positive().optional().default(abuseScoreThresholdDefault),
|
|
57
|
+
requireAllConditions: z.boolean().optional().default(requireAllConditionsDefault),
|
|
58
|
+
// overrides are now lightweight, not recursive
|
|
59
|
+
countryOverrides: z.record(string(), IPValidationSchema).optional()
|
|
60
|
+
});
|
|
9
61
|
const ClientSettingsSchema = object({
|
|
10
62
|
captchaType: CaptchaTypeSpec.optional().default(captchaTypeDefault),
|
|
11
63
|
domains: array(string()).optional().default([...domainsDefault]),
|
|
12
64
|
frictionlessThreshold: number().optional().default(frictionlessThresholdDefault),
|
|
13
65
|
powDifficulty: number().optional().default(powDifficultyDefault),
|
|
14
|
-
imageThreshold: number().optional().default(imageThresholdDefault)
|
|
66
|
+
imageThreshold: number().optional().default(imageThresholdDefault),
|
|
67
|
+
ipValidationRules: IPValidationRulesSchema.optional()
|
|
15
68
|
});
|
|
16
69
|
export {
|
|
17
70
|
ClientSettingsSchema,
|
|
71
|
+
IPValidationAction,
|
|
72
|
+
IPValidationActionSchema,
|
|
73
|
+
IPValidationRulesSchema,
|
|
74
|
+
abuseScoreThresholdDefault,
|
|
75
|
+
abuseScoreThresholdExceedActionDefault,
|
|
18
76
|
captchaTypeDefault,
|
|
77
|
+
cityChangeActionDefault,
|
|
78
|
+
countryChangeActionDefault,
|
|
79
|
+
distanceExceedActionDefault,
|
|
80
|
+
distanceThresholdKmDefault,
|
|
19
81
|
domainsDefault,
|
|
20
82
|
frictionlessThresholdDefault,
|
|
21
83
|
imageThresholdDefault,
|
|
22
|
-
|
|
84
|
+
ispChangeActionDefault,
|
|
85
|
+
powDifficultyDefault,
|
|
86
|
+
requireAllConditionsDefault
|
|
23
87
|
};
|
package/dist/config/config.d.ts
CHANGED
|
@@ -180,7 +180,7 @@ export declare const ProsopoBasicConfigSchema: z.ZodObject<z.objectUtil.extendSh
|
|
|
180
180
|
}>;
|
|
181
181
|
export type ProsopoBasicConfigInput = input<typeof ProsopoBasicConfigSchema>;
|
|
182
182
|
export type ProsopoBasicConfigOutput = output<typeof ProsopoBasicConfigSchema>;
|
|
183
|
-
export declare const
|
|
183
|
+
export declare const ProsopoApiConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
184
184
|
baseURL: z.ZodString;
|
|
185
185
|
port: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
186
186
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -189,7 +189,7 @@ export declare const ProsopoImageServerConfigSchema: z.ZodObject<{
|
|
|
189
189
|
}, {
|
|
190
190
|
baseURL: string;
|
|
191
191
|
port?: number | undefined;
|
|
192
|
-
}
|
|
192
|
+
}>>;
|
|
193
193
|
export declare const ProsopoCaptchaSolutionConfigSchema: z.ZodObject<{
|
|
194
194
|
requiredNumberOfSolutions: z.ZodNumber;
|
|
195
195
|
solutionWinningPercentage: z.ZodNumber;
|
|
@@ -782,6 +782,17 @@ export declare const ProcaptchaConfigSchema: z.ZodIntersection<z.ZodObject<z.obj
|
|
|
782
782
|
}>>;
|
|
783
783
|
export type ProcaptchaClientConfigInput = input<typeof ProcaptchaConfigSchema>;
|
|
784
784
|
export type ProcaptchaClientConfigOutput = output<typeof ProcaptchaConfigSchema>;
|
|
785
|
+
export declare const IpApiServiceSpec: z.ZodObject<{
|
|
786
|
+
apiKey: z.ZodString;
|
|
787
|
+
baseUrl: z.ZodString;
|
|
788
|
+
}, "strip", z.ZodTypeAny, {
|
|
789
|
+
apiKey: string;
|
|
790
|
+
baseUrl: string;
|
|
791
|
+
}, {
|
|
792
|
+
apiKey: string;
|
|
793
|
+
baseUrl: string;
|
|
794
|
+
}>;
|
|
795
|
+
export type IpApiService = zInfer<typeof IpApiServiceSpec>;
|
|
785
796
|
export declare const ProsopoConfigSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
786
797
|
logLevel: z.ZodDefault<z.ZodOptional<z.ZodEnum<["trace", "debug", "info", "warn", "error", "fatal", "log"]>>>;
|
|
787
798
|
defaultEnvironment: z.ZodDefault<z.ZodEnum<["development", "staging", "production"]>>;
|
|
@@ -817,6 +828,7 @@ export declare const ProsopoConfigSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
817
828
|
}>>>;
|
|
818
829
|
devOnlyWatchEvents: z.ZodOptional<z.ZodBoolean>;
|
|
819
830
|
}>, {
|
|
831
|
+
host: z.ZodString;
|
|
820
832
|
captchas: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
821
833
|
solved: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
822
834
|
count: z.ZodNumber;
|
|
@@ -847,16 +859,19 @@ export declare const ProsopoConfigSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
847
859
|
count: number;
|
|
848
860
|
} | undefined;
|
|
849
861
|
}>>>;
|
|
850
|
-
penalties: z.ZodObject<{
|
|
862
|
+
penalties: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
851
863
|
PENALTY_OLD_TIMESTAMP: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
852
864
|
PENALTY_ACCESS_RULE: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
865
|
+
PENALTY_UNVERIFIED_HOST: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
853
866
|
}, "strip", z.ZodTypeAny, {
|
|
854
867
|
PENALTY_OLD_TIMESTAMP: number;
|
|
855
868
|
PENALTY_ACCESS_RULE: number;
|
|
869
|
+
PENALTY_UNVERIFIED_HOST: number;
|
|
856
870
|
}, {
|
|
857
871
|
PENALTY_OLD_TIMESTAMP?: number | undefined;
|
|
858
872
|
PENALTY_ACCESS_RULE?: number | undefined;
|
|
859
|
-
|
|
873
|
+
PENALTY_UNVERIFIED_HOST?: number | undefined;
|
|
874
|
+
}>>>;
|
|
860
875
|
scheduledTasks: z.ZodOptional<z.ZodObject<{
|
|
861
876
|
captchaScheduler: z.ZodOptional<z.ZodObject<{
|
|
862
877
|
schedule: z.ZodOptional<z.ZodString>;
|
|
@@ -887,7 +902,7 @@ export declare const ProsopoConfigSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
887
902
|
schedule?: string | undefined;
|
|
888
903
|
} | undefined;
|
|
889
904
|
}>>;
|
|
890
|
-
server: z.ZodObject<{
|
|
905
|
+
server: z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
891
906
|
baseURL: z.ZodString;
|
|
892
907
|
port: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
893
908
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -896,20 +911,33 @@ export declare const ProsopoConfigSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
896
911
|
}, {
|
|
897
912
|
baseURL: string;
|
|
898
913
|
port?: number | undefined;
|
|
899
|
-
}
|
|
914
|
+
}>>>;
|
|
900
915
|
mongoEventsUri: z.ZodOptional<z.ZodString>;
|
|
901
916
|
mongoCaptchaUri: z.ZodOptional<z.ZodString>;
|
|
902
917
|
mongoClientUri: z.ZodOptional<z.ZodString>;
|
|
903
|
-
|
|
918
|
+
ipApi: z.ZodObject<{
|
|
919
|
+
apiKey: z.ZodString;
|
|
920
|
+
baseUrl: z.ZodString;
|
|
921
|
+
}, "strip", z.ZodTypeAny, {
|
|
922
|
+
apiKey: string;
|
|
923
|
+
baseUrl: string;
|
|
924
|
+
}, {
|
|
925
|
+
apiKey: string;
|
|
926
|
+
baseUrl: string;
|
|
927
|
+
}>;
|
|
928
|
+
redisConnection: z.ZodDefault<z.ZodObject<{
|
|
904
929
|
url: z.ZodString;
|
|
905
930
|
password: z.ZodString;
|
|
931
|
+
indexName: z.ZodOptional<z.ZodString>;
|
|
906
932
|
}, "strip", z.ZodTypeAny, {
|
|
907
933
|
password: string;
|
|
908
934
|
url: string;
|
|
935
|
+
indexName?: string | undefined;
|
|
909
936
|
}, {
|
|
910
937
|
password: string;
|
|
911
938
|
url: string;
|
|
912
|
-
|
|
939
|
+
indexName?: string | undefined;
|
|
940
|
+
}>>;
|
|
913
941
|
rateLimits: z.ZodDefault<z.ZodObject<Record<import("../provider/api.js").CombinedApiPaths, z.ZodObject<{
|
|
914
942
|
windowMs: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
915
943
|
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -1049,17 +1077,20 @@ export declare const ProsopoConfigSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
1049
1077
|
address?: string | undefined;
|
|
1050
1078
|
password?: string | undefined;
|
|
1051
1079
|
};
|
|
1080
|
+
host: string;
|
|
1052
1081
|
penalties: {
|
|
1053
1082
|
PENALTY_OLD_TIMESTAMP: number;
|
|
1054
1083
|
PENALTY_ACCESS_RULE: number;
|
|
1084
|
+
PENALTY_UNVERIFIED_HOST: number;
|
|
1055
1085
|
};
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1086
|
+
ipApi: {
|
|
1087
|
+
apiKey: string;
|
|
1088
|
+
baseUrl: string;
|
|
1059
1089
|
};
|
|
1060
1090
|
redisConnection: {
|
|
1061
1091
|
password: string;
|
|
1062
1092
|
url: string;
|
|
1093
|
+
indexName?: string | undefined;
|
|
1063
1094
|
};
|
|
1064
1095
|
rateLimits: {
|
|
1065
1096
|
"/v1/prosopo/provider/client/captcha/image": {
|
|
@@ -1132,6 +1163,10 @@ export declare const ProsopoConfigSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
1132
1163
|
schedule?: string | undefined;
|
|
1133
1164
|
} | undefined;
|
|
1134
1165
|
} | undefined;
|
|
1166
|
+
server?: {
|
|
1167
|
+
baseURL: string;
|
|
1168
|
+
port: number;
|
|
1169
|
+
} | undefined;
|
|
1135
1170
|
mongoEventsUri?: string | undefined;
|
|
1136
1171
|
mongoCaptchaUri?: string | undefined;
|
|
1137
1172
|
mongoClientUri?: string | undefined;
|
|
@@ -1142,17 +1177,10 @@ export declare const ProsopoConfigSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
1142
1177
|
address?: string | undefined;
|
|
1143
1178
|
password?: string | undefined;
|
|
1144
1179
|
};
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
server: {
|
|
1150
|
-
baseURL: string;
|
|
1151
|
-
port?: number | undefined;
|
|
1152
|
-
};
|
|
1153
|
-
redisConnection: {
|
|
1154
|
-
password: string;
|
|
1155
|
-
url: string;
|
|
1180
|
+
host: string;
|
|
1181
|
+
ipApi: {
|
|
1182
|
+
apiKey: string;
|
|
1183
|
+
baseUrl: string;
|
|
1156
1184
|
};
|
|
1157
1185
|
authAccount: {
|
|
1158
1186
|
secret?: string | undefined;
|
|
@@ -1176,6 +1204,11 @@ export declare const ProsopoConfigSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
1176
1204
|
authSource?: string | undefined;
|
|
1177
1205
|
}>> | undefined;
|
|
1178
1206
|
devOnlyWatchEvents?: boolean | undefined;
|
|
1207
|
+
penalties?: {
|
|
1208
|
+
PENALTY_OLD_TIMESTAMP?: number | undefined;
|
|
1209
|
+
PENALTY_ACCESS_RULE?: number | undefined;
|
|
1210
|
+
PENALTY_UNVERIFIED_HOST?: number | undefined;
|
|
1211
|
+
} | undefined;
|
|
1179
1212
|
scheduledTasks?: {
|
|
1180
1213
|
captchaScheduler?: {
|
|
1181
1214
|
schedule?: string | undefined;
|
|
@@ -1184,9 +1217,18 @@ export declare const ProsopoConfigSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
1184
1217
|
schedule?: string | undefined;
|
|
1185
1218
|
} | undefined;
|
|
1186
1219
|
} | undefined;
|
|
1220
|
+
server?: {
|
|
1221
|
+
baseURL: string;
|
|
1222
|
+
port?: number | undefined;
|
|
1223
|
+
} | undefined;
|
|
1187
1224
|
mongoEventsUri?: string | undefined;
|
|
1188
1225
|
mongoCaptchaUri?: string | undefined;
|
|
1189
1226
|
mongoClientUri?: string | undefined;
|
|
1227
|
+
redisConnection?: {
|
|
1228
|
+
password: string;
|
|
1229
|
+
url: string;
|
|
1230
|
+
indexName?: string | undefined;
|
|
1231
|
+
} | undefined;
|
|
1190
1232
|
rateLimits?: {
|
|
1191
1233
|
"/v1/prosopo/provider/client/captcha/image": {
|
|
1192
1234
|
windowMs?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC;AAIjC,OAAO,KAAK,EAAE,MAAM,EA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;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0C/B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACnE,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
package/dist/config/config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LanguageSchema } from "@prosopo/locale";
|
|
2
2
|
import z, { enum as _enum, record, object, string, boolean, number, union, literal } from "zod";
|
|
3
3
|
import "../provider/index.js";
|
|
4
|
-
import { FrictionlessPenalties } from "./frictionless.js";
|
|
4
|
+
import { FrictionlessPenalties, PENALTY_UNVERIFIED_HOST_DEFAULT, PENALTY_ACCESS_RULE_DEFAULT, PENALTY_OLD_TIMESTAMP_DEFAULT } from "./frictionless.js";
|
|
5
5
|
import { DEFAULT_IMAGE_MAX_VERIFIED_TIME_CACHED, DEFAULT_IMAGE_CAPTCHA_VERIFIED_TIMEOUT, DEFAULT_IMAGE_CAPTCHA_SOLUTION_TIMEOUT, DEFAULT_IMAGE_CAPTCHA_TIMEOUT, DEFAULT_POW_CAPTCHA_CACHED_TIMEOUT, DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT, DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT, DEFAULT_MAX_VERIFIED_TIME_CONTRACT } from "./timeouts.js";
|
|
6
6
|
import { ApiPathRateLimits, ProviderDefaultRateLimits, ProsopoCaptchaCountConfigSchema, DEFAULT_UNSOLVED_COUNT, DEFAULT_SOLVED_COUNT } from "../provider/api.js";
|
|
7
7
|
const LogLevel = _enum([
|
|
@@ -66,9 +66,12 @@ const ProsopoBasicConfigSchema = ProsopoBaseConfigSchema.merge(
|
|
|
66
66
|
devOnlyWatchEvents: boolean().optional()
|
|
67
67
|
})
|
|
68
68
|
);
|
|
69
|
-
const
|
|
69
|
+
const ProsopoApiConfigSchema = object({
|
|
70
70
|
baseURL: string().url(),
|
|
71
71
|
port: number().optional().default(9229)
|
|
72
|
+
}).default({
|
|
73
|
+
baseURL: "http://localhost",
|
|
74
|
+
port: 9229
|
|
72
75
|
});
|
|
73
76
|
const ProsopoCaptchaSolutionConfigSchema = object({
|
|
74
77
|
requiredNumberOfSolutions: number().positive().min(2),
|
|
@@ -161,13 +164,22 @@ const ProcaptchaConfigSchema = ProsopoClientConfigSchema.and(
|
|
|
161
164
|
)
|
|
162
165
|
})
|
|
163
166
|
);
|
|
167
|
+
const IpApiServiceSpec = z.object({
|
|
168
|
+
apiKey: z.string(),
|
|
169
|
+
baseUrl: z.string().url()
|
|
170
|
+
});
|
|
164
171
|
const ProsopoConfigSchema = ProsopoBasicConfigSchema.merge(
|
|
165
172
|
object({
|
|
173
|
+
host: string(),
|
|
166
174
|
captchas: ProsopoCaptchaCountConfigSchema.optional().default({
|
|
167
175
|
solved: { count: DEFAULT_SOLVED_COUNT },
|
|
168
176
|
unsolved: { count: DEFAULT_UNSOLVED_COUNT }
|
|
169
177
|
}),
|
|
170
|
-
penalties: FrictionlessPenalties
|
|
178
|
+
penalties: FrictionlessPenalties.optional().default({
|
|
179
|
+
PENALTY_OLD_TIMESTAMP: PENALTY_OLD_TIMESTAMP_DEFAULT,
|
|
180
|
+
PENALTY_ACCESS_RULE: PENALTY_ACCESS_RULE_DEFAULT,
|
|
181
|
+
PENALTY_UNVERIFIED_HOST: PENALTY_UNVERIFIED_HOST_DEFAULT
|
|
182
|
+
}),
|
|
171
183
|
scheduledTasks: object({
|
|
172
184
|
captchaScheduler: object({
|
|
173
185
|
schedule: string().optional()
|
|
@@ -176,13 +188,18 @@ const ProsopoConfigSchema = ProsopoBasicConfigSchema.merge(
|
|
|
176
188
|
schedule: string().optional()
|
|
177
189
|
}).optional()
|
|
178
190
|
}).optional(),
|
|
179
|
-
server:
|
|
191
|
+
server: ProsopoApiConfigSchema.optional(),
|
|
180
192
|
mongoEventsUri: string().optional(),
|
|
181
193
|
mongoCaptchaUri: string().optional(),
|
|
182
194
|
mongoClientUri: string().optional(),
|
|
195
|
+
ipApi: IpApiServiceSpec,
|
|
183
196
|
redisConnection: object({
|
|
184
197
|
url: string(),
|
|
185
|
-
password: string()
|
|
198
|
+
password: string(),
|
|
199
|
+
indexName: string().optional()
|
|
200
|
+
}).default({
|
|
201
|
+
url: "redis://localhost:6379",
|
|
202
|
+
password: "root"
|
|
186
203
|
}),
|
|
187
204
|
rateLimits: ApiPathRateLimits.default(ProviderDefaultRateLimits),
|
|
188
205
|
proxyCount: number().optional().default(0),
|
|
@@ -200,15 +217,16 @@ export {
|
|
|
200
217
|
DatabaseConfigSchema,
|
|
201
218
|
DatabaseTypes,
|
|
202
219
|
EnvironmentTypesSchema,
|
|
220
|
+
IpApiServiceSpec,
|
|
203
221
|
Mode,
|
|
204
222
|
ModeEnum,
|
|
205
223
|
PolkadotSecretJSONSpec,
|
|
206
224
|
ProcaptchaConfigSchema,
|
|
225
|
+
ProsopoApiConfigSchema,
|
|
207
226
|
ProsopoBaseConfigSchema,
|
|
208
227
|
ProsopoBasicConfigSchema,
|
|
209
228
|
ProsopoCaptchaSolutionConfigSchema,
|
|
210
229
|
ProsopoClientConfigSchema,
|
|
211
230
|
ProsopoConfigSchema,
|
|
212
|
-
ProsopoImageServerConfigSchema,
|
|
213
231
|
ProsopoServerConfigSchema
|
|
214
232
|
};
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
+
export declare const PENALTY_OLD_TIMESTAMP_DEFAULT = 0.2;
|
|
2
|
+
export declare const PENALTY_ACCESS_RULE_DEFAULT = 0.5;
|
|
3
|
+
export declare const PENALTY_UNVERIFIED_HOST_DEFAULT = 0.2;
|
|
1
4
|
export declare const FrictionlessPenalties: import("zod").ZodObject<{
|
|
2
5
|
PENALTY_OLD_TIMESTAMP: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
3
6
|
PENALTY_ACCESS_RULE: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
7
|
+
PENALTY_UNVERIFIED_HOST: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
4
8
|
}, "strip", import("zod").ZodTypeAny, {
|
|
5
9
|
PENALTY_OLD_TIMESTAMP: number;
|
|
6
10
|
PENALTY_ACCESS_RULE: number;
|
|
11
|
+
PENALTY_UNVERIFIED_HOST: number;
|
|
7
12
|
}, {
|
|
8
13
|
PENALTY_OLD_TIMESTAMP?: number | undefined;
|
|
9
14
|
PENALTY_ACCESS_RULE?: number | undefined;
|
|
15
|
+
PENALTY_UNVERIFIED_HOST?: number | undefined;
|
|
10
16
|
}>;
|
|
11
17
|
//# sourceMappingURL=frictionless.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frictionless.d.ts","sourceRoot":"","sources":["../../src/config/frictionless.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"frictionless.d.ts","sourceRoot":"","sources":["../../src/config/frictionless.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,6BAA6B,MAAM,CAAC;AACjD,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAC/C,eAAO,MAAM,+BAA+B,MAAM,CAAC;AACnD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAahC,CAAC"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { object, number } from "zod";
|
|
2
|
+
const PENALTY_OLD_TIMESTAMP_DEFAULT = 0.2;
|
|
3
|
+
const PENALTY_ACCESS_RULE_DEFAULT = 0.5;
|
|
4
|
+
const PENALTY_UNVERIFIED_HOST_DEFAULT = 0.2;
|
|
2
5
|
const FrictionlessPenalties = object({
|
|
3
|
-
PENALTY_OLD_TIMESTAMP: number().positive().optional().default(
|
|
4
|
-
PENALTY_ACCESS_RULE: number().positive().optional().default(
|
|
6
|
+
PENALTY_OLD_TIMESTAMP: number().positive().optional().default(PENALTY_OLD_TIMESTAMP_DEFAULT),
|
|
7
|
+
PENALTY_ACCESS_RULE: number().positive().optional().default(PENALTY_ACCESS_RULE_DEFAULT),
|
|
8
|
+
PENALTY_UNVERIFIED_HOST: number().positive().optional().default(PENALTY_UNVERIFIED_HOST_DEFAULT)
|
|
5
9
|
});
|
|
6
10
|
export {
|
|
7
|
-
FrictionlessPenalties
|
|
11
|
+
FrictionlessPenalties,
|
|
12
|
+
PENALTY_ACCESS_RULE_DEFAULT,
|
|
13
|
+
PENALTY_OLD_TIMESTAMP_DEFAULT,
|
|
14
|
+
PENALTY_UNVERIFIED_HOST_DEFAULT
|
|
8
15
|
};
|
package/dist/config/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AccountCreatorConfigSchema, CaptchaTimeoutSchema, DatabaseConfigSchema, DatabaseTypes, EnvironmentTypesSchema, Mode, ModeEnum, PolkadotSecretJSONSpec, ProcaptchaConfigSchema, ProsopoBaseConfigSchema, ProsopoBasicConfigSchema, ProsopoCaptchaSolutionConfigSchema, ProsopoClientConfigSchema, ProsopoConfigSchema,
|
|
1
|
+
import { AccountCreatorConfigSchema, CaptchaTimeoutSchema, DatabaseConfigSchema, DatabaseTypes, EnvironmentTypesSchema, IpApiServiceSpec, Mode, ModeEnum, PolkadotSecretJSONSpec, ProcaptchaConfigSchema, ProsopoApiConfigSchema, ProsopoBaseConfigSchema, ProsopoBasicConfigSchema, ProsopoCaptchaSolutionConfigSchema, ProsopoClientConfigSchema, ProsopoConfigSchema, ProsopoServerConfigSchema } from "./config.js";
|
|
2
2
|
import { NetworkPairTypeSchema } from "./network.js";
|
|
3
3
|
import { DEFAULT_IMAGE_CAPTCHA_SOLUTION_TIMEOUT, DEFAULT_IMAGE_CAPTCHA_TIMEOUT, DEFAULT_IMAGE_CAPTCHA_VERIFIED_TIMEOUT, DEFAULT_IMAGE_MAX_VERIFIED_TIME_CACHED, DEFAULT_MAX_VERIFIED_TIME_CONTRACT, DEFAULT_POW_CAPTCHA_CACHED_TIMEOUT, DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT, DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT } from "./timeouts.js";
|
|
4
|
-
import { FrictionlessPenalties } from "./frictionless.js";
|
|
4
|
+
import { FrictionlessPenalties, PENALTY_ACCESS_RULE_DEFAULT, PENALTY_OLD_TIMESTAMP_DEFAULT, PENALTY_UNVERIFIED_HOST_DEFAULT } from "./frictionless.js";
|
|
5
5
|
export {
|
|
6
6
|
AccountCreatorConfigSchema,
|
|
7
7
|
CaptchaTimeoutSchema,
|
|
@@ -17,16 +17,20 @@ export {
|
|
|
17
17
|
DatabaseTypes,
|
|
18
18
|
EnvironmentTypesSchema,
|
|
19
19
|
FrictionlessPenalties,
|
|
20
|
+
IpApiServiceSpec,
|
|
20
21
|
Mode,
|
|
21
22
|
ModeEnum,
|
|
22
23
|
NetworkPairTypeSchema,
|
|
24
|
+
PENALTY_ACCESS_RULE_DEFAULT,
|
|
25
|
+
PENALTY_OLD_TIMESTAMP_DEFAULT,
|
|
26
|
+
PENALTY_UNVERIFIED_HOST_DEFAULT,
|
|
23
27
|
PolkadotSecretJSONSpec,
|
|
24
28
|
ProcaptchaConfigSchema,
|
|
29
|
+
ProsopoApiConfigSchema,
|
|
25
30
|
ProsopoBaseConfigSchema,
|
|
26
31
|
ProsopoBasicConfigSchema,
|
|
27
32
|
ProsopoCaptchaSolutionConfigSchema,
|
|
28
33
|
ProsopoClientConfigSchema,
|
|
29
34
|
ProsopoConfigSchema,
|
|
30
|
-
ProsopoImageServerConfigSchema,
|
|
31
35
|
ProsopoServerConfigSchema
|
|
32
36
|
};
|
package/dist/datasets/captcha.js
CHANGED
|
@@ -90,7 +90,7 @@ const CaptchaSolutionSchema = object({
|
|
|
90
90
|
captchaId: string(),
|
|
91
91
|
captchaContentId: string(),
|
|
92
92
|
solution: string().array(),
|
|
93
|
-
salt: string()
|
|
93
|
+
salt: string()
|
|
94
94
|
});
|
|
95
95
|
const CaptchaSolutionArraySchema = array(CaptchaSolutionSchema);
|
|
96
96
|
const DataSchema = object({
|
package/dist/index.js
CHANGED
|
@@ -9,16 +9,16 @@ import "./procaptcha-frictionless/index.js";
|
|
|
9
9
|
import "./keyring/index.js";
|
|
10
10
|
import { ApiParams } from "./api/params.js";
|
|
11
11
|
import { Tier, TierMonthlyLimits, TierSchema } from "./client/user.js";
|
|
12
|
-
import { ClientSettingsSchema, captchaTypeDefault, domainsDefault, frictionlessThresholdDefault, imageThresholdDefault, powDifficultyDefault } from "./client/settings.js";
|
|
12
|
+
import { ClientSettingsSchema, IPValidationAction, IPValidationActionSchema, IPValidationRulesSchema, abuseScoreThresholdDefault, abuseScoreThresholdExceedActionDefault, captchaTypeDefault, cityChangeActionDefault, countryChangeActionDefault, distanceExceedActionDefault, distanceThresholdKmDefault, domainsDefault, frictionlessThresholdDefault, imageThresholdDefault, ispChangeActionDefault, powDifficultyDefault, requireAllConditionsDefault } from "./client/settings.js";
|
|
13
13
|
import { CaptchaType, CaptchaTypeSchema } from "./client/captchaType/captchaType.js";
|
|
14
14
|
import { CaptchaTypeSpec } from "./client/captchaType/captchaTypeSpec.js";
|
|
15
|
-
import { AccountCreatorConfigSchema, CaptchaTimeoutSchema, DatabaseConfigSchema, DatabaseTypes, EnvironmentTypesSchema, Mode, ModeEnum, PolkadotSecretJSONSpec, ProcaptchaConfigSchema, ProsopoBaseConfigSchema, ProsopoBasicConfigSchema, ProsopoCaptchaSolutionConfigSchema, ProsopoClientConfigSchema, ProsopoConfigSchema,
|
|
15
|
+
import { AccountCreatorConfigSchema, CaptchaTimeoutSchema, DatabaseConfigSchema, DatabaseTypes, EnvironmentTypesSchema, IpApiServiceSpec, Mode, ModeEnum, PolkadotSecretJSONSpec, ProcaptchaConfigSchema, ProsopoApiConfigSchema, ProsopoBaseConfigSchema, ProsopoBasicConfigSchema, ProsopoCaptchaSolutionConfigSchema, ProsopoClientConfigSchema, ProsopoConfigSchema, ProsopoServerConfigSchema } from "./config/config.js";
|
|
16
16
|
import { NetworkPairTypeSchema } from "./config/network.js";
|
|
17
17
|
import { DEFAULT_IMAGE_CAPTCHA_SOLUTION_TIMEOUT, DEFAULT_IMAGE_CAPTCHA_TIMEOUT, DEFAULT_IMAGE_CAPTCHA_VERIFIED_TIMEOUT, DEFAULT_IMAGE_MAX_VERIFIED_TIME_CACHED, DEFAULT_MAX_VERIFIED_TIME_CONTRACT, DEFAULT_POW_CAPTCHA_CACHED_TIMEOUT, DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT, DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT } from "./config/timeouts.js";
|
|
18
|
-
import { FrictionlessPenalties } from "./config/frictionless.js";
|
|
18
|
+
import { FrictionlessPenalties, PENALTY_ACCESS_RULE_DEFAULT, PENALTY_OLD_TIMESTAMP_DEFAULT, PENALTY_UNVERIFIED_HOST_DEFAULT } from "./config/frictionless.js";
|
|
19
19
|
import { CaptchaItemSchema, CaptchaItemTypes, CaptchaSchema, CaptchaSolutionArraySchema, CaptchaSolutionSchema, CaptchaStates, CaptchaStatus, CaptchaTypes, CaptchasContainerSchema, CaptchasSchema, CaptchasWithNumericSolutionSchema, DappPayee, DataSchema, GovernanceStatus, HashedCaptchaItemSchema, LabelledDataSchema, LabelledItemSchema, LabelsContainerSchema, MaybeLabelledHashedItemSchema, POW_SEPARATOR, PowChallengeIdSchema, SelectAllCaptchaSchema, SelectAllCaptchaSchemaRaw, SelectAllCaptchaSchemaWithNumericSolution, StoredStatusNames, TimestampSchema } from "./datasets/captcha.js";
|
|
20
20
|
import { DatasetSchema, DatasetWithIdsAndTreeSchema, DatasetWithIdsSchema, DatasetWithNumericSolutionSchema } from "./datasets/dataset.js";
|
|
21
|
-
import { AdminApiPaths, ApiPathRateLimits, ApiPrefix, BlockRuleSpec, BlockRuleType, CaptchaRequestBody, CaptchaSolutionBody, ClientApiPaths, DEFAULT_SOLVED_COUNT, DEFAULT_UNSOLVED_COUNT, DappDomainRequestBody, GetFrictionlessCaptchaChallengeRequestBody, GetPowCaptchaChallengeRequestBody, ProsopoCaptchaCountConfigSchema, ProviderDefaultRateLimits, PublicApiPaths, RegisterSitekeyBody, ServerPowCaptchaVerifyRequestBody, SubmitPowCaptchaSolutionBody, UpdateDetectorKeyBody, VerifyPowCaptchaSolutionBody, VerifySolutionBody } from "./provider/api.js";
|
|
21
|
+
import { AdminApiPaths, ApiPathRateLimits, ApiPrefix, BlockRuleSpec, BlockRuleType, CaptchaRequestBody, CaptchaSolutionBody, ClientApiPaths, DEFAULT_SOLVED_COUNT, DEFAULT_UNSOLVED_COUNT, DappDomainRequestBody, GetFrictionlessCaptchaChallengeRequestBody, GetPowCaptchaChallengeRequestBody, ProsopoCaptchaCountConfigSchema, ProviderDefaultRateLimits, PublicApiPaths, RegisterSitekeyBody, RemoveDetectorKeyBodySpec, ServerPowCaptchaVerifyRequestBody, SubmitPowCaptchaSolutionBody, UpdateDetectorKeyBody, VerifyPowCaptchaSolutionBody, VerifySolutionBody, providerDetailsSchema } from "./provider/api.js";
|
|
22
22
|
import { ScheduledTaskNames, ScheduledTaskStatus } from "./provider/scheduler.js";
|
|
23
23
|
import { ProcaptchaResponse } from "./procaptcha/manager.js";
|
|
24
24
|
import { ChallengeSignatureSchema, ProcaptchaOutputSchema, ProcaptchaTokenCodec, ProcaptchaTokenSpec, RequestHashSignatureSchema, SignatureTypesSchema, TimestampSignatureSchema, decodeProcaptchaOutput, encodeProcaptchaOutput } from "./procaptcha/token.js";
|
|
@@ -75,6 +75,10 @@ export {
|
|
|
75
75
|
GetPowCaptchaChallengeRequestBody,
|
|
76
76
|
GovernanceStatus,
|
|
77
77
|
HashedCaptchaItemSchema,
|
|
78
|
+
IPValidationAction,
|
|
79
|
+
IPValidationActionSchema,
|
|
80
|
+
IPValidationRulesSchema,
|
|
81
|
+
IpApiServiceSpec,
|
|
78
82
|
LabelledDataSchema,
|
|
79
83
|
LabelledItemSchema,
|
|
80
84
|
LabelsContainerSchema,
|
|
@@ -82,6 +86,9 @@ export {
|
|
|
82
86
|
Mode,
|
|
83
87
|
ModeEnum,
|
|
84
88
|
NetworkPairTypeSchema,
|
|
89
|
+
PENALTY_ACCESS_RULE_DEFAULT,
|
|
90
|
+
PENALTY_OLD_TIMESTAMP_DEFAULT,
|
|
91
|
+
PENALTY_UNVERIFIED_HOST_DEFAULT,
|
|
85
92
|
POW_SEPARATOR,
|
|
86
93
|
PolkadotSecretJSONSpec,
|
|
87
94
|
PowChallengeIdSchema,
|
|
@@ -90,17 +97,18 @@ export {
|
|
|
90
97
|
ProcaptchaResponse,
|
|
91
98
|
ProcaptchaTokenCodec,
|
|
92
99
|
ProcaptchaTokenSpec,
|
|
100
|
+
ProsopoApiConfigSchema,
|
|
93
101
|
ProsopoBaseConfigSchema,
|
|
94
102
|
ProsopoBasicConfigSchema,
|
|
95
103
|
ProsopoCaptchaCountConfigSchema,
|
|
96
104
|
ProsopoCaptchaSolutionConfigSchema,
|
|
97
105
|
ProsopoClientConfigSchema,
|
|
98
106
|
ProsopoConfigSchema,
|
|
99
|
-
ProsopoImageServerConfigSchema,
|
|
100
107
|
ProsopoServerConfigSchema,
|
|
101
108
|
ProviderDefaultRateLimits,
|
|
102
109
|
PublicApiPaths,
|
|
103
110
|
RegisterSitekeyBody,
|
|
111
|
+
RemoveDetectorKeyBodySpec,
|
|
104
112
|
RequestHashSignatureSchema,
|
|
105
113
|
ScheduledTaskNames,
|
|
106
114
|
ScheduledTaskStatus,
|
|
@@ -119,11 +127,20 @@ export {
|
|
|
119
127
|
UpdateDetectorKeyBody,
|
|
120
128
|
VerifyPowCaptchaSolutionBody,
|
|
121
129
|
VerifySolutionBody,
|
|
130
|
+
abuseScoreThresholdDefault,
|
|
131
|
+
abuseScoreThresholdExceedActionDefault,
|
|
122
132
|
captchaTypeDefault,
|
|
133
|
+
cityChangeActionDefault,
|
|
134
|
+
countryChangeActionDefault,
|
|
123
135
|
decodeProcaptchaOutput,
|
|
136
|
+
distanceExceedActionDefault,
|
|
137
|
+
distanceThresholdKmDefault,
|
|
124
138
|
domainsDefault,
|
|
125
139
|
encodeProcaptchaOutput,
|
|
126
140
|
frictionlessThresholdDefault,
|
|
127
141
|
imageThresholdDefault,
|
|
128
|
-
|
|
142
|
+
ispChangeActionDefault,
|
|
143
|
+
powDifficultyDefault,
|
|
144
|
+
providerDetailsSchema,
|
|
145
|
+
requireAllConditionsDefault
|
|
129
146
|
};
|
|
@@ -17,7 +17,7 @@ export declare const ProcaptchaResponse: import("zod").ZodObject<{
|
|
|
17
17
|
export interface ProcaptchaState {
|
|
18
18
|
isHuman: boolean;
|
|
19
19
|
index: number;
|
|
20
|
-
solutions: string[][];
|
|
20
|
+
solutions: [string, number, number][][];
|
|
21
21
|
captchaApi: ProcaptchaApiInterface | undefined;
|
|
22
22
|
challenge: CaptchaResponseBody | undefined;
|
|
23
23
|
showModal: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/procaptcha/manager.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACX,eAAe,EACf,iBAAiB,EACjB,MAAM,kCAAkC,CAAC;AAG1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,KAAK,eAAe,EAAuB,MAAM,YAAY,CAAC;AAKvE,MAAM,WAAW,OAAO;IACvB,OAAO,EAAE,eAAe,CAAC;IACzB,SAAS,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED,eAAO,MAAM,kBAAkB;;;;;;EAE7B,CAAC;AAMH,MAAM,WAAW,eAAe;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../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;IAC/B,IAAI,EAAE,KAAK,CAAC;IACZ,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAEtC,YAAY,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/procaptcha/props.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM,MAAM,iBAAiB,GAAG;IAC/B,QAAQ,EAAE,cAAc,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAKrD,MAAM,WAAW,eAAe;IAE/B,MAAM,EAAE,2BAA2B,CAAC;IACpC,SAAS,EAAE,mBAAmB,CAAC;IAC/B,IAAI,EAAE,KAAK,CAAC;IACZ,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAEtC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,WAAW,CAAC;CACxB"}
|
|
@@ -6,7 +6,7 @@ export type BotDetectionFunctionResult = GetFrictionlessCaptchaResponse & {
|
|
|
6
6
|
provider: RandomProvider;
|
|
7
7
|
userAccount: Account;
|
|
8
8
|
};
|
|
9
|
-
export type BotDetectionFunction = (config: ProcaptchaClientConfigOutput) => Promise<BotDetectionFunctionResult>;
|
|
9
|
+
export type BotDetectionFunction = (config: ProcaptchaClientConfigOutput, container: HTMLElement | undefined, restartFn: () => void) => Promise<BotDetectionFunctionResult>;
|
|
10
10
|
export interface ProcaptchaFrictionlessProps extends ProcaptchaProps {
|
|
11
11
|
restart: () => void;
|
|
12
12
|
detectBot?: BotDetectionFunction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/procaptcha-frictionless/props.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EACX,8BAA8B,EAC9B,cAAc,EACd,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,0BAA0B,GAAG,8BAA8B,GAAG;IACzE,QAAQ,EAAE,cAAc,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAClC,MAAM,EAAE,4BAA4B,
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/procaptcha-frictionless/props.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EACX,8BAA8B,EAC9B,cAAc,EACd,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,0BAA0B,GAAG,8BAA8B,GAAG;IACzE,QAAQ,EAAE,cAAc,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAClC,MAAM,EAAE,4BAA4B,EACpC,SAAS,EAAE,WAAW,GAAG,SAAS,EAClC,SAAS,EAAE,MAAM,IAAI,KACjB,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAKzC,MAAM,WAAW,2BAA4B,SAAQ,eAAe;IACnE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,eAAe,CAAC,EAAE,4BAA4B,CAAC;CAC/C"}
|