@prosopo/types 3.0.3 → 3.0.4
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 +23 -0
- package/dist/api/api.js +1 -2
- package/dist/api/index.js +5 -3
- package/dist/api/params.js +43 -41
- package/dist/cjs/config/config.cjs +2 -2
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/provider/api.cjs +6 -2
- package/dist/cjs/provider/index.cjs +2 -0
- package/dist/client/captchaType/captchaType.js +11 -9
- package/dist/client/captchaType/captchaTypeSpec.js +3 -2
- package/dist/client/index.js +18 -5
- package/dist/client/settings.js +20 -17
- package/dist/client/user.js +31 -18
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +167 -153
- package/dist/config/frictionless.js +7 -5
- package/dist/config/index.js +32 -5
- package/dist/config/network.js +9 -7
- package/dist/config/timeouts.js +19 -10
- package/dist/datasets/assets.js +1 -2
- package/dist/datasets/captcha.js +122 -94
- package/dist/datasets/dataset.js +28 -23
- package/dist/datasets/index.js +36 -5
- package/dist/datasets/merkle.js +1 -2
- package/dist/index.js +129 -10
- package/dist/keyring/index.js +2 -3
- package/dist/keyring/keyring/types.js +1 -2
- package/dist/keyring/pair/types.js +1 -2
- package/dist/procaptcha/api.js +1 -2
- package/dist/procaptcha/client.js +1 -2
- package/dist/procaptcha/collector.js +1 -2
- package/dist/procaptcha/index.js +19 -8
- package/dist/procaptcha/manager.js +7 -4
- package/dist/procaptcha/props.js +1 -2
- package/dist/procaptcha/token.js +77 -62
- package/dist/procaptcha/utils.js +1 -2
- package/dist/procaptcha-bundle/index.js +1 -2
- package/dist/procaptcha-frictionless/index.js +1 -2
- package/dist/procaptcha-frictionless/props.js +1 -2
- package/dist/provider/accounts.js +1 -2
- package/dist/provider/api.d.ts +3 -0
- package/dist/provider/api.d.ts.map +1 -1
- package/dist/provider/api.js +208 -143
- package/dist/provider/index.js +29 -4
- package/dist/provider/scheduler.js +18 -15
- package/package.json +18 -15
- package/vite.cjs.config.ts +4 -1
- package/vite.esm.config.ts +20 -0
- package/dist/api/api.js.map +0 -1
- package/dist/api/index.js.map +0 -1
- package/dist/api/params.js.map +0 -1
- package/dist/client/captchaType/captchaType.js.map +0 -1
- package/dist/client/captchaType/captchaTypeSpec.js.map +0 -1
- package/dist/client/index.js.map +0 -1
- package/dist/client/settings.js.map +0 -1
- package/dist/client/user.js.map +0 -1
- package/dist/config/config.js.map +0 -1
- package/dist/config/enumMap.js +0 -6
- package/dist/config/enumMap.js.map +0 -1
- package/dist/config/frictionless.js.map +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/config/network.js.map +0 -1
- package/dist/config/timeouts.js.map +0 -1
- package/dist/datasets/assets.js.map +0 -1
- package/dist/datasets/captcha.js.map +0 -1
- package/dist/datasets/dataset.js.map +0 -1
- package/dist/datasets/index.js.map +0 -1
- package/dist/datasets/merkle.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/keyring/index.js.map +0 -1
- package/dist/keyring/keyring/types.js.map +0 -1
- package/dist/keyring/pair/types.js.map +0 -1
- package/dist/procaptcha/api.js.map +0 -1
- package/dist/procaptcha/client.js.map +0 -1
- package/dist/procaptcha/collector.js.map +0 -1
- package/dist/procaptcha/index.js.map +0 -1
- package/dist/procaptcha/manager.js.map +0 -1
- package/dist/procaptcha/props.js.map +0 -1
- package/dist/procaptcha/token.js.map +0 -1
- package/dist/procaptcha/utils.js.map +0 -1
- package/dist/procaptcha-bundle/index.js.map +0 -1
- package/dist/procaptcha-frictionless/index.js.map +0 -1
- package/dist/procaptcha-frictionless/props.js.map +0 -1
- package/dist/provider/accounts.js.map +0 -1
- package/dist/provider/api.js.map +0 -1
- package/dist/provider/index.js.map +0 -1
- package/dist/provider/scheduler.js.map +0 -1
package/dist/config/config.js
CHANGED
|
@@ -1,200 +1,214 @@
|
|
|
1
1
|
import { LanguageSchema } from "@prosopo/locale";
|
|
2
|
-
import { literal } from "zod";
|
|
3
|
-
import
|
|
4
|
-
import { object } from "zod";
|
|
5
|
-
import { record, string, enum as zEnum } from "zod";
|
|
6
|
-
import { union } from "zod";
|
|
7
|
-
import z, { boolean } from "zod";
|
|
8
|
-
import { ApiPathRateLimits, ProsopoCaptchaCountConfigSchema, ProviderDefaultRateLimits, } from "../provider/index.js";
|
|
2
|
+
import z, { enum as _enum, record, object, string, boolean, number, union, literal } from "zod";
|
|
3
|
+
import "../provider/index.js";
|
|
9
4
|
import { FrictionlessPenalties } from "./frictionless.js";
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
+
import { ApiPathRateLimits, ProviderDefaultRateLimits, ProsopoCaptchaCountConfigSchema, DEFAULT_UNSOLVED_COUNT, DEFAULT_SOLVED_COUNT } from "../provider/api.js";
|
|
7
|
+
const LogLevel = _enum([
|
|
8
|
+
"trace",
|
|
9
|
+
"debug",
|
|
10
|
+
"info",
|
|
11
|
+
"warn",
|
|
12
|
+
"error",
|
|
13
|
+
"fatal",
|
|
14
|
+
"log"
|
|
19
15
|
]);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
const DatabaseTypes = _enum([
|
|
17
|
+
"mongo",
|
|
18
|
+
"mongoMemory",
|
|
19
|
+
"provider",
|
|
20
|
+
"client",
|
|
21
|
+
"captcha"
|
|
26
22
|
]);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
const EnvironmentTypesSchema = _enum([
|
|
24
|
+
"development",
|
|
25
|
+
"staging",
|
|
26
|
+
"production"
|
|
31
27
|
]);
|
|
32
|
-
|
|
28
|
+
const DatabaseConfigSchema = record(
|
|
29
|
+
EnvironmentTypesSchema,
|
|
30
|
+
object({
|
|
33
31
|
type: string(),
|
|
34
32
|
endpoint: string(),
|
|
35
33
|
dbname: string().default("prosopo"),
|
|
36
|
-
authSource: string().default("admin")
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
authSource: string().default("admin")
|
|
35
|
+
})
|
|
36
|
+
);
|
|
37
|
+
const ProsopoBaseConfigSchema = object({
|
|
38
|
+
logLevel: LogLevel.optional().default(LogLevel.enum.info),
|
|
39
|
+
defaultEnvironment: EnvironmentTypesSchema.default(
|
|
40
|
+
EnvironmentTypesSchema.Values.production
|
|
41
|
+
),
|
|
42
|
+
// The account with which to query the contract.merge sign transactions
|
|
43
|
+
account: object({
|
|
44
|
+
address: string().optional(),
|
|
45
|
+
secret: string().optional(),
|
|
46
|
+
password: string().optional()
|
|
47
|
+
})
|
|
46
48
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
49
|
+
const PolkadotSecretJSONSpec = z.object({
|
|
50
|
+
encoded: z.string(),
|
|
51
|
+
encoding: z.object({
|
|
52
|
+
content: z.array(z.string()),
|
|
53
|
+
type: z.array(z.string()),
|
|
54
|
+
version: z.string()
|
|
55
|
+
}),
|
|
56
|
+
address: z.string(),
|
|
57
|
+
meta: z.object({
|
|
58
|
+
genesisHash: z.string(),
|
|
59
|
+
name: z.string(),
|
|
60
|
+
whenCreated: z.number()
|
|
61
|
+
})
|
|
60
62
|
});
|
|
61
|
-
|
|
63
|
+
const ProsopoBasicConfigSchema = ProsopoBaseConfigSchema.merge(
|
|
64
|
+
object({
|
|
62
65
|
database: DatabaseConfigSchema.optional(),
|
|
63
|
-
devOnlyWatchEvents: boolean().optional()
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
devOnlyWatchEvents: boolean().optional()
|
|
67
|
+
})
|
|
68
|
+
);
|
|
69
|
+
const ProsopoImageServerConfigSchema = object({
|
|
70
|
+
baseURL: string().url(),
|
|
71
|
+
port: number().optional().default(9229)
|
|
68
72
|
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
const ProsopoCaptchaSolutionConfigSchema = object({
|
|
74
|
+
requiredNumberOfSolutions: number().positive().min(2),
|
|
75
|
+
solutionWinningPercentage: number().positive().max(100),
|
|
76
|
+
captchaBlockRecency: number().positive().min(2)
|
|
73
77
|
});
|
|
74
|
-
|
|
78
|
+
const ProsopoClientConfigSchema = ProsopoBasicConfigSchema.merge(
|
|
79
|
+
object({
|
|
75
80
|
userAccountAddress: string().optional(),
|
|
76
81
|
web2: boolean().optional().default(true),
|
|
77
82
|
solutionThreshold: number().positive().max(100).optional().default(80),
|
|
78
83
|
dappName: string().optional().default("ProsopoClientDapp"),
|
|
79
|
-
serverUrl: string().optional()
|
|
80
|
-
})
|
|
84
|
+
serverUrl: string().optional()
|
|
85
|
+
})
|
|
86
|
+
);
|
|
81
87
|
const defaultImageCaptchaTimeouts = {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
88
|
+
challengeTimeout: DEFAULT_IMAGE_CAPTCHA_TIMEOUT,
|
|
89
|
+
solutionTimeout: DEFAULT_IMAGE_CAPTCHA_SOLUTION_TIMEOUT,
|
|
90
|
+
verifiedTimeout: DEFAULT_IMAGE_CAPTCHA_VERIFIED_TIMEOUT,
|
|
91
|
+
cachedTimeout: DEFAULT_IMAGE_MAX_VERIFIED_TIME_CACHED
|
|
86
92
|
};
|
|
87
93
|
const defaultPoWCaptchaTimeouts = {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
94
|
+
challengeTimeout: DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT,
|
|
95
|
+
solutionTimeout: DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT,
|
|
96
|
+
cachedTimeout: DEFAULT_POW_CAPTCHA_CACHED_TIMEOUT
|
|
91
97
|
};
|
|
92
98
|
const defaultContractCaptchaTimeouts = {
|
|
93
|
-
|
|
99
|
+
maxVerifiedTime: DEFAULT_MAX_VERIFIED_TIME_CONTRACT
|
|
94
100
|
};
|
|
95
101
|
const defaultCaptchaTimeouts = {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
102
|
+
image: defaultImageCaptchaTimeouts,
|
|
103
|
+
pow: defaultPoWCaptchaTimeouts,
|
|
104
|
+
contract: defaultContractCaptchaTimeouts
|
|
99
105
|
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
.default(DEFAULT_IMAGE_MAX_VERIFIED_TIME_CACHED),
|
|
118
|
-
}).default(defaultImageCaptchaTimeouts),
|
|
119
|
-
pow: object({
|
|
120
|
-
verifiedTimeout: number()
|
|
121
|
-
.positive()
|
|
122
|
-
.optional()
|
|
123
|
-
.default(DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT),
|
|
124
|
-
solutionTimeout: number()
|
|
125
|
-
.positive()
|
|
126
|
-
.optional()
|
|
127
|
-
.default(DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT),
|
|
128
|
-
cachedTimeout: number()
|
|
129
|
-
.positive()
|
|
130
|
-
.optional()
|
|
131
|
-
.default(DEFAULT_POW_CAPTCHA_CACHED_TIMEOUT),
|
|
132
|
-
}).default(defaultPoWCaptchaTimeouts),
|
|
133
|
-
contract: object({
|
|
134
|
-
maxVerifiedTime: number()
|
|
135
|
-
.positive()
|
|
136
|
-
.optional()
|
|
137
|
-
.default(DEFAULT_MAX_VERIFIED_TIME_CONTRACT),
|
|
138
|
-
}).default(defaultContractCaptchaTimeouts),
|
|
106
|
+
const CaptchaTimeoutSchema = object({
|
|
107
|
+
image: object({
|
|
108
|
+
// Set this to a default value for the frontend
|
|
109
|
+
challengeTimeout: number().positive().optional().default(DEFAULT_IMAGE_CAPTCHA_TIMEOUT),
|
|
110
|
+
// Set this to a default value for the frontend
|
|
111
|
+
solutionTimeout: number().positive().optional().default(DEFAULT_IMAGE_CAPTCHA_SOLUTION_TIMEOUT),
|
|
112
|
+
verifiedTimeout: number().positive().optional().default(DEFAULT_IMAGE_CAPTCHA_VERIFIED_TIMEOUT),
|
|
113
|
+
cachedTimeout: number().positive().optional().default(DEFAULT_IMAGE_MAX_VERIFIED_TIME_CACHED)
|
|
114
|
+
}).default(defaultImageCaptchaTimeouts),
|
|
115
|
+
pow: object({
|
|
116
|
+
verifiedTimeout: number().positive().optional().default(DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT),
|
|
117
|
+
solutionTimeout: number().positive().optional().default(DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT),
|
|
118
|
+
cachedTimeout: number().positive().optional().default(DEFAULT_POW_CAPTCHA_CACHED_TIMEOUT)
|
|
119
|
+
}).default(defaultPoWCaptchaTimeouts),
|
|
120
|
+
contract: object({
|
|
121
|
+
maxVerifiedTime: number().positive().optional().default(DEFAULT_MAX_VERIFIED_TIME_CONTRACT)
|
|
122
|
+
}).default(defaultContractCaptchaTimeouts)
|
|
139
123
|
}).default(defaultCaptchaTimeouts);
|
|
140
|
-
|
|
124
|
+
const ProsopoServerConfigSchema = ProsopoClientConfigSchema.merge(
|
|
125
|
+
object({
|
|
141
126
|
serverUrl: string().url().optional(),
|
|
142
|
-
timeouts: CaptchaTimeoutSchema.optional().default(defaultCaptchaTimeouts)
|
|
143
|
-
})
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
127
|
+
timeouts: CaptchaTimeoutSchema.optional().default(defaultCaptchaTimeouts)
|
|
128
|
+
})
|
|
129
|
+
);
|
|
130
|
+
const AccountCreatorConfigSchema = object({
|
|
131
|
+
area: object({
|
|
132
|
+
width: number().positive(),
|
|
133
|
+
height: number().positive()
|
|
134
|
+
}),
|
|
135
|
+
offsetParameter: number().positive(),
|
|
136
|
+
multiplier: number().positive(),
|
|
137
|
+
fontSizeFactor: number().positive(),
|
|
138
|
+
maxShadowBlur: number().positive(),
|
|
139
|
+
numberOfRounds: number().positive(),
|
|
140
|
+
seed: number().positive()
|
|
155
141
|
});
|
|
156
142
|
const ThemeType = union([literal("light"), literal("dark")]);
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
})(ModeEnum ||
|
|
162
|
-
|
|
163
|
-
|
|
143
|
+
var ModeEnum = /* @__PURE__ */ ((ModeEnum2) => {
|
|
144
|
+
ModeEnum2["visible"] = "visible";
|
|
145
|
+
ModeEnum2["invisible"] = "invisible";
|
|
146
|
+
return ModeEnum2;
|
|
147
|
+
})(ModeEnum || {});
|
|
148
|
+
const Mode = _enum([
|
|
149
|
+
"visible",
|
|
150
|
+
"invisible"
|
|
151
|
+
/* invisible */
|
|
152
|
+
]).optional();
|
|
153
|
+
const ProcaptchaConfigSchema = ProsopoClientConfigSchema.and(
|
|
154
|
+
object({
|
|
164
155
|
theme: ThemeType.optional().default("light"),
|
|
165
156
|
captchas: CaptchaTimeoutSchema.optional().default(defaultCaptchaTimeouts),
|
|
166
157
|
language: LanguageSchema.optional(),
|
|
167
|
-
mode: Mode.optional().default(
|
|
168
|
-
|
|
169
|
-
|
|
158
|
+
mode: Mode.optional().default(
|
|
159
|
+
"visible"
|
|
160
|
+
/* visible */
|
|
161
|
+
)
|
|
162
|
+
})
|
|
163
|
+
);
|
|
164
|
+
const ProsopoConfigSchema = ProsopoBasicConfigSchema.merge(
|
|
165
|
+
object({
|
|
170
166
|
captchas: ProsopoCaptchaCountConfigSchema.optional().default({
|
|
171
|
-
|
|
172
|
-
|
|
167
|
+
solved: { count: DEFAULT_SOLVED_COUNT },
|
|
168
|
+
unsolved: { count: DEFAULT_UNSOLVED_COUNT }
|
|
173
169
|
}),
|
|
174
170
|
penalties: FrictionlessPenalties,
|
|
175
171
|
scheduledTasks: object({
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
172
|
+
captchaScheduler: object({
|
|
173
|
+
schedule: string().optional()
|
|
174
|
+
}).optional(),
|
|
175
|
+
clientListScheduler: object({
|
|
176
|
+
schedule: string().optional()
|
|
177
|
+
}).optional()
|
|
182
178
|
}).optional(),
|
|
183
179
|
server: ProsopoImageServerConfigSchema,
|
|
184
180
|
mongoEventsUri: string().optional(),
|
|
185
181
|
mongoCaptchaUri: string().optional(),
|
|
186
182
|
mongoClientUri: string().optional(),
|
|
187
183
|
redisConnection: object({
|
|
188
|
-
|
|
189
|
-
|
|
184
|
+
url: string(),
|
|
185
|
+
password: string()
|
|
190
186
|
}),
|
|
191
187
|
rateLimits: ApiPathRateLimits.default(ProviderDefaultRateLimits),
|
|
192
188
|
proxyCount: number().optional().default(0),
|
|
193
189
|
lRules: record(string(), number()).optional(),
|
|
194
190
|
authAccount: object({
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
})
|
|
199
|
-
})
|
|
200
|
-
|
|
191
|
+
address: string().optional(),
|
|
192
|
+
secret: string().optional(),
|
|
193
|
+
password: string().optional()
|
|
194
|
+
})
|
|
195
|
+
})
|
|
196
|
+
);
|
|
197
|
+
export {
|
|
198
|
+
AccountCreatorConfigSchema,
|
|
199
|
+
CaptchaTimeoutSchema,
|
|
200
|
+
DatabaseConfigSchema,
|
|
201
|
+
DatabaseTypes,
|
|
202
|
+
EnvironmentTypesSchema,
|
|
203
|
+
Mode,
|
|
204
|
+
ModeEnum,
|
|
205
|
+
PolkadotSecretJSONSpec,
|
|
206
|
+
ProcaptchaConfigSchema,
|
|
207
|
+
ProsopoBaseConfigSchema,
|
|
208
|
+
ProsopoBasicConfigSchema,
|
|
209
|
+
ProsopoCaptchaSolutionConfigSchema,
|
|
210
|
+
ProsopoClientConfigSchema,
|
|
211
|
+
ProsopoConfigSchema,
|
|
212
|
+
ProsopoImageServerConfigSchema,
|
|
213
|
+
ProsopoServerConfigSchema
|
|
214
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { object, number } from "zod";
|
|
2
|
+
const FrictionlessPenalties = object({
|
|
3
|
+
PENALTY_OLD_TIMESTAMP: number().positive().optional().default(0.2),
|
|
4
|
+
PENALTY_ACCESS_RULE: number().positive().optional().default(0.5)
|
|
5
5
|
});
|
|
6
|
-
|
|
6
|
+
export {
|
|
7
|
+
FrictionlessPenalties
|
|
8
|
+
};
|
package/dist/config/index.js
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { AccountCreatorConfigSchema, CaptchaTimeoutSchema, DatabaseConfigSchema, DatabaseTypes, EnvironmentTypesSchema, Mode, ModeEnum, PolkadotSecretJSONSpec, ProcaptchaConfigSchema, ProsopoBaseConfigSchema, ProsopoBasicConfigSchema, ProsopoCaptchaSolutionConfigSchema, ProsopoClientConfigSchema, ProsopoConfigSchema, ProsopoImageServerConfigSchema, ProsopoServerConfigSchema } from "./config.js";
|
|
2
|
+
import { NetworkPairTypeSchema } from "./network.js";
|
|
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";
|
|
5
|
+
export {
|
|
6
|
+
AccountCreatorConfigSchema,
|
|
7
|
+
CaptchaTimeoutSchema,
|
|
8
|
+
DEFAULT_IMAGE_CAPTCHA_SOLUTION_TIMEOUT,
|
|
9
|
+
DEFAULT_IMAGE_CAPTCHA_TIMEOUT,
|
|
10
|
+
DEFAULT_IMAGE_CAPTCHA_VERIFIED_TIMEOUT,
|
|
11
|
+
DEFAULT_IMAGE_MAX_VERIFIED_TIME_CACHED,
|
|
12
|
+
DEFAULT_MAX_VERIFIED_TIME_CONTRACT,
|
|
13
|
+
DEFAULT_POW_CAPTCHA_CACHED_TIMEOUT,
|
|
14
|
+
DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT,
|
|
15
|
+
DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT,
|
|
16
|
+
DatabaseConfigSchema,
|
|
17
|
+
DatabaseTypes,
|
|
18
|
+
EnvironmentTypesSchema,
|
|
19
|
+
FrictionlessPenalties,
|
|
20
|
+
Mode,
|
|
21
|
+
ModeEnum,
|
|
22
|
+
NetworkPairTypeSchema,
|
|
23
|
+
PolkadotSecretJSONSpec,
|
|
24
|
+
ProcaptchaConfigSchema,
|
|
25
|
+
ProsopoBaseConfigSchema,
|
|
26
|
+
ProsopoBasicConfigSchema,
|
|
27
|
+
ProsopoCaptchaSolutionConfigSchema,
|
|
28
|
+
ProsopoClientConfigSchema,
|
|
29
|
+
ProsopoConfigSchema,
|
|
30
|
+
ProsopoImageServerConfigSchema,
|
|
31
|
+
ProsopoServerConfigSchema
|
|
32
|
+
};
|
package/dist/config/network.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { union, literal } from "zod";
|
|
2
|
+
const NetworkPairTypeSchema = union([
|
|
3
|
+
literal("sr25519"),
|
|
4
|
+
literal("ed25519"),
|
|
5
|
+
literal("ecdsa"),
|
|
6
|
+
literal("ethereum")
|
|
7
7
|
]);
|
|
8
|
-
|
|
8
|
+
export {
|
|
9
|
+
NetworkPairTypeSchema
|
|
10
|
+
};
|
package/dist/config/timeouts.js
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
const ONE_MINUTE = 60 *
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
const ONE_MINUTE = 60 * 1e3;
|
|
2
|
+
const DEFAULT_IMAGE_CAPTCHA_TIMEOUT = ONE_MINUTE;
|
|
3
|
+
const DEFAULT_IMAGE_CAPTCHA_SOLUTION_TIMEOUT = DEFAULT_IMAGE_CAPTCHA_TIMEOUT * 2;
|
|
4
|
+
const DEFAULT_IMAGE_CAPTCHA_VERIFIED_TIMEOUT = DEFAULT_IMAGE_CAPTCHA_TIMEOUT * 3;
|
|
5
|
+
const DEFAULT_IMAGE_MAX_VERIFIED_TIME_CACHED = DEFAULT_IMAGE_CAPTCHA_TIMEOUT * 15;
|
|
6
|
+
const DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT = ONE_MINUTE;
|
|
7
|
+
const DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT = DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT * 2;
|
|
8
|
+
const DEFAULT_POW_CAPTCHA_CACHED_TIMEOUT = DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT * 3;
|
|
9
|
+
const DEFAULT_MAX_VERIFIED_TIME_CONTRACT = ONE_MINUTE * 15;
|
|
10
|
+
export {
|
|
11
|
+
DEFAULT_IMAGE_CAPTCHA_SOLUTION_TIMEOUT,
|
|
12
|
+
DEFAULT_IMAGE_CAPTCHA_TIMEOUT,
|
|
13
|
+
DEFAULT_IMAGE_CAPTCHA_VERIFIED_TIMEOUT,
|
|
14
|
+
DEFAULT_IMAGE_MAX_VERIFIED_TIME_CACHED,
|
|
15
|
+
DEFAULT_MAX_VERIFIED_TIME_CONTRACT,
|
|
16
|
+
DEFAULT_POW_CAPTCHA_CACHED_TIMEOUT,
|
|
17
|
+
DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT,
|
|
18
|
+
DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT
|
|
19
|
+
};
|
package/dist/datasets/assets.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=assets.js.map
|
|
1
|
+
|