@prosopo/types 1.0.2 → 2.0.1
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/dist/api/api.d.ts +10 -12
- package/dist/api/api.d.ts.map +1 -1
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +2 -2
- package/dist/api/index.js.map +1 -1
- package/dist/api/params.d.ts +3 -2
- package/dist/api/params.d.ts.map +1 -1
- package/dist/api/params.js +2 -1
- package/dist/api/params.js.map +1 -1
- package/dist/cjs/api/params.cjs +2 -1
- package/dist/cjs/config/config.cjs +43 -38
- package/dist/cjs/config/index.cjs +9 -8
- package/dist/cjs/config/network.cjs +6 -1
- package/dist/cjs/config/timeouts.cjs +19 -0
- package/dist/cjs/contract/artifacts.cjs +10 -3
- package/dist/cjs/datasets/captcha.cjs +35 -1
- package/dist/cjs/datasets/dataset.cjs +1 -1
- package/dist/cjs/datasets/index.cjs +5 -0
- package/dist/cjs/dist/api/api.cjs +1 -0
- package/dist/cjs/dist/api/index.cjs +8 -0
- package/dist/cjs/dist/api/params.cjs +30 -0
- package/dist/cjs/dist/config/config.cjs +182 -0
- package/dist/cjs/dist/config/enumMap.cjs +8 -0
- package/dist/cjs/dist/config/index.cjs +33 -0
- package/dist/cjs/dist/config/network.cjs +34 -0
- package/dist/cjs/dist/config/timeouts.cjs +19 -0
- package/dist/cjs/dist/contract/artifacts.cjs +135 -0
- package/dist/cjs/dist/contract/batch.cjs +1 -0
- package/dist/cjs/dist/contract/contract.cjs +1 -0
- package/dist/cjs/dist/contract/index.cjs +22 -0
- package/dist/cjs/dist/contract/interface.cjs +1 -0
- package/dist/cjs/dist/contract/useWeight.cjs +1 -0
- package/dist/cjs/dist/datasets/assets.cjs +1 -0
- package/dist/cjs/dist/datasets/captcha.cjs +118 -0
- package/dist/cjs/dist/datasets/dataset.cjs +32 -0
- package/dist/cjs/dist/datasets/index.cjs +52 -0
- package/dist/cjs/dist/datasets/merkle.cjs +1 -0
- package/dist/cjs/dist/index.cjs +16 -0
- package/dist/cjs/dist/networks/index.cjs +52 -0
- package/dist/cjs/dist/procaptcha/api.cjs +1 -0
- package/dist/cjs/dist/procaptcha/client.cjs +1 -0
- package/dist/cjs/dist/procaptcha/collector.cjs +1 -0
- package/dist/cjs/dist/procaptcha/index.cjs +17 -0
- package/dist/cjs/dist/procaptcha/manager.cjs +10 -0
- package/dist/cjs/dist/procaptcha/props.cjs +1 -0
- package/dist/cjs/dist/procaptcha/storage.cjs +9 -0
- package/dist/cjs/dist/procaptcha/token.cjs +58 -0
- package/dist/cjs/dist/procaptcha/utils.cjs +1 -0
- package/dist/cjs/dist/procaptcha-bundle/index.cjs +8 -0
- package/dist/cjs/dist/procaptcha-frictionless/index.cjs +2 -0
- package/dist/cjs/dist/procaptcha-frictionless/props.cjs +1 -0
- package/dist/cjs/dist/provider/accounts.cjs +7 -0
- package/dist/cjs/dist/provider/api.cjs +113 -0
- package/dist/cjs/dist/provider/argv.cjs +7 -0
- package/dist/cjs/dist/provider/index.cjs +35 -0
- package/dist/cjs/dist/provider/scheduler.cjs +14 -0
- package/dist/cjs/index.cjs +19 -8
- package/dist/cjs/networks/index.cjs +11 -5
- package/dist/cjs/procaptcha/manager.cjs +1 -1
- package/dist/cjs/procaptcha/token.cjs +23 -5
- package/dist/cjs/procaptcha-frictionless/index.cjs +2 -0
- package/dist/cjs/procaptcha-frictionless/props.cjs +1 -0
- package/dist/cjs/provider/accounts.cjs +7 -0
- package/dist/cjs/provider/api.cjs +102 -14
- package/dist/cjs/provider/argv.cjs +3 -2
- package/dist/cjs/provider/index.cjs +4 -1
- package/dist/config/config.d.ts +344 -96
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +64 -30
- package/dist/config/config.js.map +1 -1
- package/dist/config/enumMap.d.ts +1 -1
- package/dist/config/enumMap.d.ts.map +1 -1
- package/dist/config/enumMap.js +1 -1
- package/dist/config/enumMap.js.map +1 -1
- package/dist/config/index.d.ts +3 -2
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +3 -2
- package/dist/config/index.js.map +1 -1
- package/dist/config/network.d.ts +18 -18
- package/dist/config/network.d.ts.map +1 -1
- package/dist/config/network.js +12 -7
- package/dist/config/network.js.map +1 -1
- package/dist/config/timeouts.d.ts +9 -0
- package/dist/config/timeouts.d.ts.map +1 -0
- package/dist/config/timeouts.js +10 -0
- package/dist/config/timeouts.js.map +1 -0
- package/dist/contract/artifacts.d.ts +171 -171
- package/dist/contract/artifacts.d.ts.map +1 -1
- package/dist/contract/artifacts.js +7 -4
- package/dist/contract/artifacts.js.map +1 -1
- package/dist/contract/batch.d.ts +4 -4
- package/dist/contract/batch.d.ts.map +1 -1
- package/dist/contract/contract.d.ts +2 -2
- package/dist/contract/contract.d.ts.map +1 -1
- package/dist/contract/index.d.ts +5 -5
- package/dist/contract/index.d.ts.map +1 -1
- package/dist/contract/index.js +5 -5
- package/dist/contract/index.js.map +1 -1
- package/dist/contract/interface.d.ts +9 -9
- package/dist/contract/interface.d.ts.map +1 -1
- package/dist/contract/useWeight.d.ts +2 -2
- package/dist/contract/useWeight.d.ts.map +1 -1
- package/dist/datasets/assets.d.ts.map +1 -1
- package/dist/datasets/captcha.d.ts +53 -10
- package/dist/datasets/captcha.d.ts.map +1 -1
- package/dist/datasets/captcha.js +31 -3
- package/dist/datasets/captcha.js.map +1 -1
- package/dist/datasets/dataset.d.ts +43 -43
- package/dist/datasets/dataset.d.ts.map +1 -1
- package/dist/datasets/dataset.js +2 -2
- package/dist/datasets/dataset.js.map +1 -1
- package/dist/datasets/index.d.ts +4 -4
- package/dist/datasets/index.d.ts.map +1 -1
- package/dist/datasets/index.js +4 -4
- package/dist/datasets/index.js.map +1 -1
- package/dist/datasets/merkle.d.ts.map +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/dist/networks/index.d.ts +1 -1
- package/dist/networks/index.d.ts.map +1 -1
- package/dist/networks/index.js +22 -20
- package/dist/networks/index.js.map +1 -1
- package/dist/procaptcha/api.d.ts +8 -10
- package/dist/procaptcha/api.d.ts.map +1 -1
- package/dist/procaptcha/client.d.ts +8 -3
- package/dist/procaptcha/client.d.ts.map +1 -1
- package/dist/procaptcha/collector.d.ts.map +1 -1
- package/dist/procaptcha/index.d.ts +8 -8
- package/dist/procaptcha/index.d.ts.map +1 -1
- package/dist/procaptcha/index.js +8 -8
- package/dist/procaptcha/index.js.map +1 -1
- package/dist/procaptcha/manager.d.ts +5 -5
- package/dist/procaptcha/manager.d.ts.map +1 -1
- package/dist/procaptcha/manager.js +3 -3
- package/dist/procaptcha/manager.js.map +1 -1
- package/dist/procaptcha/props.d.ts +2 -2
- package/dist/procaptcha/props.d.ts.map +1 -1
- package/dist/procaptcha/storage.d.ts +1 -1
- package/dist/procaptcha/storage.d.ts.map +1 -1
- package/dist/procaptcha/storage.js +1 -1
- package/dist/procaptcha/storage.js.map +1 -1
- package/dist/procaptcha/token.d.ts +56 -1
- package/dist/procaptcha/token.d.ts.map +1 -1
- package/dist/procaptcha/token.js +21 -5
- package/dist/procaptcha/token.js.map +1 -1
- package/dist/procaptcha/utils.d.ts.map +1 -1
- package/dist/procaptcha-bundle/index.d.ts.map +1 -1
- package/dist/procaptcha-bundle/index.js.map +1 -1
- package/dist/procaptcha-frictionless/index.d.ts +2 -0
- package/dist/procaptcha-frictionless/index.d.ts.map +1 -0
- package/dist/procaptcha-frictionless/index.js +2 -0
- package/dist/procaptcha-frictionless/index.js.map +1 -0
- package/dist/procaptcha-frictionless/props.d.ts +8 -0
- package/dist/procaptcha-frictionless/props.d.ts.map +1 -0
- package/dist/procaptcha-frictionless/props.js +2 -0
- package/dist/procaptcha-frictionless/props.js.map +1 -0
- package/dist/provider/accounts.d.ts +6 -3
- package/dist/provider/accounts.d.ts.map +1 -1
- package/dist/provider/accounts.js +5 -1
- package/dist/provider/accounts.js.map +1 -1
- package/dist/provider/api.d.ts +324 -34
- package/dist/provider/api.d.ts.map +1 -1
- package/dist/provider/api.js +57 -12
- package/dist/provider/api.js.map +1 -1
- package/dist/provider/argv.d.ts +1 -1
- package/dist/provider/argv.d.ts.map +1 -1
- package/dist/provider/argv.js +2 -2
- package/dist/provider/argv.js.map +1 -1
- package/dist/provider/index.d.ts +4 -4
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +4 -4
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/scheduler.d.ts.map +1 -1
- package/dist/provider/scheduler.js.map +1 -1
- package/package.json +50 -55
- package/vite.cjs.config.ts +3 -3
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const z = require("zod");
|
|
4
|
+
const index = require("../networks/index.cjs");
|
|
5
|
+
require("../provider/index.cjs");
|
|
6
|
+
const network = require("./network.cjs");
|
|
7
|
+
const timeouts = require("./timeouts.cjs");
|
|
8
|
+
const api = require("../provider/api.cjs");
|
|
9
|
+
const LogLevel = z.enum([
|
|
10
|
+
"trace",
|
|
11
|
+
"debug",
|
|
12
|
+
"info",
|
|
13
|
+
"warn",
|
|
14
|
+
"error",
|
|
15
|
+
"fatal",
|
|
16
|
+
"log"
|
|
17
|
+
]);
|
|
18
|
+
const DatabaseTypes = z.enum(["mongo", "mongoMemory"]);
|
|
19
|
+
const EnvironmentTypesSchema = z.enum([
|
|
20
|
+
"development",
|
|
21
|
+
"staging",
|
|
22
|
+
"production"
|
|
23
|
+
]);
|
|
24
|
+
const DatabaseConfigSchema = z.record(EnvironmentTypesSchema, z.object({
|
|
25
|
+
type: z.string(),
|
|
26
|
+
endpoint: z.string(),
|
|
27
|
+
dbname: z.string(),
|
|
28
|
+
authSource: z.string()
|
|
29
|
+
}));
|
|
30
|
+
const BatchCommitConfigSchema = z.object({
|
|
31
|
+
interval: z.number().positive().optional().default(300),
|
|
32
|
+
maxBatchExtrinsicPercentage: z.number().positive().optional().default(59)
|
|
33
|
+
});
|
|
34
|
+
const ProsopoBaseConfigSchema = z.object({
|
|
35
|
+
logLevel: LogLevel.optional().default(LogLevel.enum.info),
|
|
36
|
+
defaultEnvironment: EnvironmentTypesSchema.default(EnvironmentTypesSchema.Values.production),
|
|
37
|
+
defaultNetwork: network.NetworkNamesSchema.default(network.NetworkNamesSchema.Values.astar),
|
|
38
|
+
account: z.object({
|
|
39
|
+
address: z.string().optional(),
|
|
40
|
+
secret: z.string().optional(),
|
|
41
|
+
password: z.string().optional()
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
const PolkadotSecretJSONSpec = z.object({
|
|
45
|
+
encoded: z.string(),
|
|
46
|
+
encoding: z.object({
|
|
47
|
+
content: z.array(z.string()),
|
|
48
|
+
type: z.array(z.string()),
|
|
49
|
+
version: z.string()
|
|
50
|
+
}),
|
|
51
|
+
address: z.string(),
|
|
52
|
+
meta: z.object({
|
|
53
|
+
genesisHash: z.string(),
|
|
54
|
+
name: z.string(),
|
|
55
|
+
whenCreated: z.number()
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
const ProsopoBasicConfigSchema = ProsopoBaseConfigSchema.merge(z.object({
|
|
59
|
+
networks: network.ProsopoNetworkSchema.default(index),
|
|
60
|
+
database: DatabaseConfigSchema.optional(),
|
|
61
|
+
devOnlyWatchEvents: z.boolean().optional()
|
|
62
|
+
}));
|
|
63
|
+
const ProsopoCaptchaCountConfigSchema = z.object({
|
|
64
|
+
solved: z.object({
|
|
65
|
+
count: z.number().positive()
|
|
66
|
+
}).optional().default({ count: 1 }),
|
|
67
|
+
unsolved: z.object({
|
|
68
|
+
count: z.number().nonnegative()
|
|
69
|
+
}).optional().default({ count: 1 })
|
|
70
|
+
});
|
|
71
|
+
const ProsopoImageServerConfigSchema = z.object({
|
|
72
|
+
baseURL: z.string().url(),
|
|
73
|
+
port: z.number().optional().default(9229)
|
|
74
|
+
});
|
|
75
|
+
const ProsopoCaptchaSolutionConfigSchema = z.object({
|
|
76
|
+
requiredNumberOfSolutions: z.number().positive().min(2),
|
|
77
|
+
solutionWinningPercentage: z.number().positive().max(100),
|
|
78
|
+
captchaBlockRecency: z.number().positive().min(2)
|
|
79
|
+
});
|
|
80
|
+
const ProsopoClientConfigSchema = ProsopoBasicConfigSchema.merge(z.object({
|
|
81
|
+
userAccountAddress: z.string().optional(),
|
|
82
|
+
web2: z.boolean().optional().default(true),
|
|
83
|
+
solutionThreshold: z.number().positive().max(100).optional().default(80),
|
|
84
|
+
dappName: z.string().optional().default("ProsopoClientDapp"),
|
|
85
|
+
serverUrl: z.string().optional()
|
|
86
|
+
}));
|
|
87
|
+
const defaultImageCaptchaTimeouts = {
|
|
88
|
+
challengeTimeout: timeouts.DEFAULT_IMAGE_CAPTCHA_TIMEOUT,
|
|
89
|
+
solutionTimeout: timeouts.DEFAULT_IMAGE_CAPTCHA_SOLUTION_TIMEOUT,
|
|
90
|
+
verifiedTimeout: timeouts.DEFAULT_IMAGE_CAPTCHA_VERIFIED_TIMEOUT,
|
|
91
|
+
cachedTimeout: timeouts.DEFAULT_IMAGE_MAX_VERIFIED_TIME_CACHED
|
|
92
|
+
};
|
|
93
|
+
const defaultPoWCaptchaTimeouts = {
|
|
94
|
+
challengeTimeout: timeouts.DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT,
|
|
95
|
+
solutionTimeout: timeouts.DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT,
|
|
96
|
+
cachedTimeout: timeouts.DEFAULT_POW_CAPTCHA_CACHED_TIMEOUT
|
|
97
|
+
};
|
|
98
|
+
const defaultContractCaptchaTimeouts = {
|
|
99
|
+
maxVerifiedTime: timeouts.DEFAULT_MAX_VERIFIED_TIME_CONTRACT
|
|
100
|
+
};
|
|
101
|
+
const defaultCaptchaTimeouts = {
|
|
102
|
+
image: defaultImageCaptchaTimeouts,
|
|
103
|
+
pow: defaultPoWCaptchaTimeouts,
|
|
104
|
+
contract: defaultContractCaptchaTimeouts
|
|
105
|
+
};
|
|
106
|
+
const CaptchaTimeoutSchema = z.object({
|
|
107
|
+
image: z.object({
|
|
108
|
+
challengeTimeout: z.number().positive().optional().default(timeouts.DEFAULT_IMAGE_CAPTCHA_TIMEOUT),
|
|
109
|
+
solutionTimeout: z.number().positive().optional().default(timeouts.DEFAULT_IMAGE_CAPTCHA_SOLUTION_TIMEOUT),
|
|
110
|
+
verifiedTimeout: z.number().positive().optional().default(timeouts.DEFAULT_IMAGE_CAPTCHA_VERIFIED_TIMEOUT),
|
|
111
|
+
cachedTimeout: z.number().positive().optional().default(timeouts.DEFAULT_IMAGE_MAX_VERIFIED_TIME_CACHED)
|
|
112
|
+
}).default(defaultImageCaptchaTimeouts),
|
|
113
|
+
pow: z.object({
|
|
114
|
+
verifiedTimeout: z.number().positive().optional().default(timeouts.DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT),
|
|
115
|
+
solutionTimeout: z.number().positive().optional().default(timeouts.DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT),
|
|
116
|
+
cachedTimeout: z.number().positive().optional().default(timeouts.DEFAULT_POW_CAPTCHA_CACHED_TIMEOUT)
|
|
117
|
+
}).default(defaultPoWCaptchaTimeouts),
|
|
118
|
+
contract: z.object({
|
|
119
|
+
maxVerifiedTime: z.number().positive().optional().default(timeouts.DEFAULT_MAX_VERIFIED_TIME_CONTRACT)
|
|
120
|
+
}).default(defaultContractCaptchaTimeouts)
|
|
121
|
+
}).default(defaultCaptchaTimeouts);
|
|
122
|
+
const ProsopoServerConfigSchema = ProsopoClientConfigSchema.merge(z.object({
|
|
123
|
+
serverUrl: z.string().url().optional(),
|
|
124
|
+
timeouts: CaptchaTimeoutSchema.optional().default(defaultCaptchaTimeouts)
|
|
125
|
+
}));
|
|
126
|
+
const AccountCreatorConfigSchema = z.object({
|
|
127
|
+
area: z.object({
|
|
128
|
+
width: z.number().positive(),
|
|
129
|
+
height: z.number().positive()
|
|
130
|
+
}),
|
|
131
|
+
offsetParameter: z.number().positive(),
|
|
132
|
+
multiplier: z.number().positive(),
|
|
133
|
+
fontSizeFactor: z.number().positive(),
|
|
134
|
+
maxShadowBlur: z.number().positive(),
|
|
135
|
+
numberOfRounds: z.number().positive(),
|
|
136
|
+
seed: z.number().positive()
|
|
137
|
+
});
|
|
138
|
+
const ThemeType = z.union([z.literal("light"), z.literal("dark")]);
|
|
139
|
+
const ProcaptchaConfigSchema = ProsopoClientConfigSchema.and(z.object({
|
|
140
|
+
accountCreator: AccountCreatorConfigSchema.optional(),
|
|
141
|
+
theme: ThemeType.optional(),
|
|
142
|
+
captchas: CaptchaTimeoutSchema.optional().default(defaultCaptchaTimeouts)
|
|
143
|
+
}));
|
|
144
|
+
const ProsopoConfigSchema = ProsopoBasicConfigSchema.merge(z.object({
|
|
145
|
+
captchas: ProsopoCaptchaCountConfigSchema.optional().default({
|
|
146
|
+
solved: { count: 1 },
|
|
147
|
+
unsolved: { count: 0 }
|
|
148
|
+
}),
|
|
149
|
+
captchaSolutions: ProsopoCaptchaSolutionConfigSchema.optional().default({
|
|
150
|
+
requiredNumberOfSolutions: 3,
|
|
151
|
+
solutionWinningPercentage: 80,
|
|
152
|
+
captchaBlockRecency: 10
|
|
153
|
+
}),
|
|
154
|
+
batchCommit: BatchCommitConfigSchema.optional().default({
|
|
155
|
+
interval: 300,
|
|
156
|
+
maxBatchExtrinsicPercentage: 59
|
|
157
|
+
}),
|
|
158
|
+
captchaScheduler: z.object({
|
|
159
|
+
schedule: z.string().optional()
|
|
160
|
+
}).optional(),
|
|
161
|
+
server: ProsopoImageServerConfigSchema,
|
|
162
|
+
mongoEventsUri: z.string().optional(),
|
|
163
|
+
mongoCaptchaUri: z.string().optional(),
|
|
164
|
+
rateLimits: api.ApiPathRateLimits.default(api.ProviderDefaultRateLimits),
|
|
165
|
+
proxyCount: z.number().optional().default(0)
|
|
166
|
+
}));
|
|
167
|
+
exports.AccountCreatorConfigSchema = AccountCreatorConfigSchema;
|
|
168
|
+
exports.BatchCommitConfigSchema = BatchCommitConfigSchema;
|
|
169
|
+
exports.CaptchaTimeoutSchema = CaptchaTimeoutSchema;
|
|
170
|
+
exports.DatabaseConfigSchema = DatabaseConfigSchema;
|
|
171
|
+
exports.DatabaseTypes = DatabaseTypes;
|
|
172
|
+
exports.EnvironmentTypesSchema = EnvironmentTypesSchema;
|
|
173
|
+
exports.PolkadotSecretJSONSpec = PolkadotSecretJSONSpec;
|
|
174
|
+
exports.ProcaptchaConfigSchema = ProcaptchaConfigSchema;
|
|
175
|
+
exports.ProsopoBaseConfigSchema = ProsopoBaseConfigSchema;
|
|
176
|
+
exports.ProsopoBasicConfigSchema = ProsopoBasicConfigSchema;
|
|
177
|
+
exports.ProsopoCaptchaCountConfigSchema = ProsopoCaptchaCountConfigSchema;
|
|
178
|
+
exports.ProsopoCaptchaSolutionConfigSchema = ProsopoCaptchaSolutionConfigSchema;
|
|
179
|
+
exports.ProsopoClientConfigSchema = ProsopoClientConfigSchema;
|
|
180
|
+
exports.ProsopoConfigSchema = ProsopoConfigSchema;
|
|
181
|
+
exports.ProsopoImageServerConfigSchema = ProsopoImageServerConfigSchema;
|
|
182
|
+
exports.ProsopoServerConfigSchema = ProsopoServerConfigSchema;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const z = require("zod");
|
|
4
|
+
const enumMap = (enumeration, obj) => {
|
|
5
|
+
const validateKeysInEnum = (record) => Object.keys(record).every((key) => enumeration.safeParse(key).success);
|
|
6
|
+
return z.record(obj).refine(validateKeysInEnum);
|
|
7
|
+
};
|
|
8
|
+
exports.enumMap = enumMap;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const config = require("./config.cjs");
|
|
4
|
+
const network = require("./network.cjs");
|
|
5
|
+
const timeouts = require("./timeouts.cjs");
|
|
6
|
+
exports.AccountCreatorConfigSchema = config.AccountCreatorConfigSchema;
|
|
7
|
+
exports.BatchCommitConfigSchema = config.BatchCommitConfigSchema;
|
|
8
|
+
exports.CaptchaTimeoutSchema = config.CaptchaTimeoutSchema;
|
|
9
|
+
exports.DatabaseConfigSchema = config.DatabaseConfigSchema;
|
|
10
|
+
exports.DatabaseTypes = config.DatabaseTypes;
|
|
11
|
+
exports.EnvironmentTypesSchema = config.EnvironmentTypesSchema;
|
|
12
|
+
exports.PolkadotSecretJSONSpec = config.PolkadotSecretJSONSpec;
|
|
13
|
+
exports.ProcaptchaConfigSchema = config.ProcaptchaConfigSchema;
|
|
14
|
+
exports.ProsopoBaseConfigSchema = config.ProsopoBaseConfigSchema;
|
|
15
|
+
exports.ProsopoBasicConfigSchema = config.ProsopoBasicConfigSchema;
|
|
16
|
+
exports.ProsopoCaptchaCountConfigSchema = config.ProsopoCaptchaCountConfigSchema;
|
|
17
|
+
exports.ProsopoCaptchaSolutionConfigSchema = config.ProsopoCaptchaSolutionConfigSchema;
|
|
18
|
+
exports.ProsopoClientConfigSchema = config.ProsopoClientConfigSchema;
|
|
19
|
+
exports.ProsopoConfigSchema = config.ProsopoConfigSchema;
|
|
20
|
+
exports.ProsopoImageServerConfigSchema = config.ProsopoImageServerConfigSchema;
|
|
21
|
+
exports.ProsopoServerConfigSchema = config.ProsopoServerConfigSchema;
|
|
22
|
+
exports.NetworkConfigSchema = network.NetworkConfigSchema;
|
|
23
|
+
exports.NetworkNamesSchema = network.NetworkNamesSchema;
|
|
24
|
+
exports.NetworkPairTypeSchema = network.NetworkPairTypeSchema;
|
|
25
|
+
exports.ProsopoNetworkSchema = network.ProsopoNetworkSchema;
|
|
26
|
+
exports.DEFAULT_IMAGE_CAPTCHA_SOLUTION_TIMEOUT = timeouts.DEFAULT_IMAGE_CAPTCHA_SOLUTION_TIMEOUT;
|
|
27
|
+
exports.DEFAULT_IMAGE_CAPTCHA_TIMEOUT = timeouts.DEFAULT_IMAGE_CAPTCHA_TIMEOUT;
|
|
28
|
+
exports.DEFAULT_IMAGE_CAPTCHA_VERIFIED_TIMEOUT = timeouts.DEFAULT_IMAGE_CAPTCHA_VERIFIED_TIMEOUT;
|
|
29
|
+
exports.DEFAULT_IMAGE_MAX_VERIFIED_TIME_CACHED = timeouts.DEFAULT_IMAGE_MAX_VERIFIED_TIME_CACHED;
|
|
30
|
+
exports.DEFAULT_MAX_VERIFIED_TIME_CONTRACT = timeouts.DEFAULT_MAX_VERIFIED_TIME_CONTRACT;
|
|
31
|
+
exports.DEFAULT_POW_CAPTCHA_CACHED_TIMEOUT = timeouts.DEFAULT_POW_CAPTCHA_CACHED_TIMEOUT;
|
|
32
|
+
exports.DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT = timeouts.DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT;
|
|
33
|
+
exports.DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT = timeouts.DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const z = require("zod");
|
|
4
|
+
const enumMap = require("./enumMap.cjs");
|
|
5
|
+
const NetworkNamesSchema = z.enum([
|
|
6
|
+
"development",
|
|
7
|
+
"rococo",
|
|
8
|
+
"shiden",
|
|
9
|
+
"astar"
|
|
10
|
+
]);
|
|
11
|
+
const NetworkPairTypeSchema = z.union([
|
|
12
|
+
z.literal("sr25519"),
|
|
13
|
+
z.literal("ed25519"),
|
|
14
|
+
z.literal("ecdsa"),
|
|
15
|
+
z.literal("ethereum")
|
|
16
|
+
]);
|
|
17
|
+
const NetworkConfigSchema = z.object({
|
|
18
|
+
endpoint: z.array(z.string().url()),
|
|
19
|
+
contract: z.object({
|
|
20
|
+
address: z.string(),
|
|
21
|
+
name: z.string()
|
|
22
|
+
}),
|
|
23
|
+
pairType: NetworkPairTypeSchema,
|
|
24
|
+
ss58Format: z.number().positive().default(42)
|
|
25
|
+
});
|
|
26
|
+
const ProsopoNetworkSchema = enumMap.enumMap(NetworkNamesSchema, NetworkConfigSchema.required({
|
|
27
|
+
endpoint: true,
|
|
28
|
+
pairType: true,
|
|
29
|
+
ss58Format: true
|
|
30
|
+
}));
|
|
31
|
+
exports.NetworkConfigSchema = NetworkConfigSchema;
|
|
32
|
+
exports.NetworkNamesSchema = NetworkNamesSchema;
|
|
33
|
+
exports.NetworkPairTypeSchema = NetworkPairTypeSchema;
|
|
34
|
+
exports.ProsopoNetworkSchema = ProsopoNetworkSchema;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const ONE_MINUTE = 60 * 1e3;
|
|
4
|
+
const DEFAULT_IMAGE_CAPTCHA_TIMEOUT = ONE_MINUTE;
|
|
5
|
+
const DEFAULT_IMAGE_CAPTCHA_SOLUTION_TIMEOUT = DEFAULT_IMAGE_CAPTCHA_TIMEOUT * 2;
|
|
6
|
+
const DEFAULT_IMAGE_CAPTCHA_VERIFIED_TIMEOUT = DEFAULT_IMAGE_CAPTCHA_TIMEOUT * 3;
|
|
7
|
+
const DEFAULT_IMAGE_MAX_VERIFIED_TIME_CACHED = DEFAULT_IMAGE_CAPTCHA_TIMEOUT * 15;
|
|
8
|
+
const DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT = ONE_MINUTE;
|
|
9
|
+
const DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT = DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT * 2;
|
|
10
|
+
const DEFAULT_POW_CAPTCHA_CACHED_TIMEOUT = DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT * 3;
|
|
11
|
+
const DEFAULT_MAX_VERIFIED_TIME_CONTRACT = ONE_MINUTE * 15;
|
|
12
|
+
exports.DEFAULT_IMAGE_CAPTCHA_SOLUTION_TIMEOUT = DEFAULT_IMAGE_CAPTCHA_SOLUTION_TIMEOUT;
|
|
13
|
+
exports.DEFAULT_IMAGE_CAPTCHA_TIMEOUT = DEFAULT_IMAGE_CAPTCHA_TIMEOUT;
|
|
14
|
+
exports.DEFAULT_IMAGE_CAPTCHA_VERIFIED_TIMEOUT = DEFAULT_IMAGE_CAPTCHA_VERIFIED_TIMEOUT;
|
|
15
|
+
exports.DEFAULT_IMAGE_MAX_VERIFIED_TIME_CACHED = DEFAULT_IMAGE_MAX_VERIFIED_TIME_CACHED;
|
|
16
|
+
exports.DEFAULT_MAX_VERIFIED_TIME_CONTRACT = DEFAULT_MAX_VERIFIED_TIME_CONTRACT;
|
|
17
|
+
exports.DEFAULT_POW_CAPTCHA_CACHED_TIMEOUT = DEFAULT_POW_CAPTCHA_CACHED_TIMEOUT;
|
|
18
|
+
exports.DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT = DEFAULT_POW_CAPTCHA_SOLUTION_TIMEOUT;
|
|
19
|
+
exports.DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT = DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const native = require("@polkadot/types-codec/native");
|
|
4
|
+
const z = require("zod");
|
|
5
|
+
const AbiParamSpec = z.object({
|
|
6
|
+
name: z.string(),
|
|
7
|
+
type: z.union([z.number(), z.string()])
|
|
8
|
+
});
|
|
9
|
+
const AbiFieldSpec = z.object({
|
|
10
|
+
name: z.string().optional(),
|
|
11
|
+
type: z.number(),
|
|
12
|
+
typeName: z.string().optional()
|
|
13
|
+
});
|
|
14
|
+
const AbiVariantSpec = z.object({
|
|
15
|
+
index: z.number(),
|
|
16
|
+
name: z.string()
|
|
17
|
+
});
|
|
18
|
+
const AbiStorageEnumFieldSpec = z.object({
|
|
19
|
+
name: z.string(),
|
|
20
|
+
fields: z.array(z.any())
|
|
21
|
+
});
|
|
22
|
+
const AbiStorageEnumSpec = z.record(z.number().min(0), AbiStorageEnumFieldSpec);
|
|
23
|
+
const AbiTypeSpec = z.object({
|
|
24
|
+
id: z.number(),
|
|
25
|
+
type: z.object({
|
|
26
|
+
def: z.object({
|
|
27
|
+
composite: z.object({
|
|
28
|
+
fields: z.array(AbiFieldSpec).optional()
|
|
29
|
+
}).optional(),
|
|
30
|
+
variant: z.object({
|
|
31
|
+
variants: z.union([
|
|
32
|
+
z.array(AbiVariantSpec).optional(),
|
|
33
|
+
AbiStorageEnumSpec
|
|
34
|
+
])
|
|
35
|
+
}).optional(),
|
|
36
|
+
sequence: z.object({
|
|
37
|
+
type: z.number()
|
|
38
|
+
}).optional(),
|
|
39
|
+
array: z.object({
|
|
40
|
+
len: z.number(),
|
|
41
|
+
type: z.number()
|
|
42
|
+
}).optional(),
|
|
43
|
+
primitive: z.string().optional(),
|
|
44
|
+
tuple: z.any().optional()
|
|
45
|
+
}),
|
|
46
|
+
params: z.array(AbiParamSpec).optional(),
|
|
47
|
+
path: z.array(z.string()).optional()
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
const AbiEnumSpec = z.object({
|
|
51
|
+
dispatchKey: z.string(),
|
|
52
|
+
variants: z.any()
|
|
53
|
+
});
|
|
54
|
+
const AbiText = z.union([z.instanceof(native.Text), z.string()]);
|
|
55
|
+
const AbiCellSpec = z.object({
|
|
56
|
+
key: AbiText,
|
|
57
|
+
ty: z.union([z.number(), z.string()])
|
|
58
|
+
});
|
|
59
|
+
const AbiTypesSpec = z.array(AbiTypeSpec);
|
|
60
|
+
const AbiStorageFieldSpec = z.lazy(() => z.object({
|
|
61
|
+
name: AbiText.optional(),
|
|
62
|
+
layout: z.object({
|
|
63
|
+
leaf: AbiCellSpec.optional(),
|
|
64
|
+
enum: AbiEnumSpec.optional(),
|
|
65
|
+
root: AbiStorageFieldSpec.optional(),
|
|
66
|
+
struct: AbiStorageStructSpec.optional()
|
|
67
|
+
}),
|
|
68
|
+
root_key: AbiText.optional()
|
|
69
|
+
}));
|
|
70
|
+
const AbiStorageStructSpec = z.object({
|
|
71
|
+
fields: z.array(AbiStorageFieldSpec),
|
|
72
|
+
name: z.string()
|
|
73
|
+
});
|
|
74
|
+
const AbiStorageSpec = z.object({
|
|
75
|
+
root: z.object({
|
|
76
|
+
layout: z.object({
|
|
77
|
+
struct: AbiStorageStructSpec.optional()
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
const AbiSpecDef = z.object({
|
|
82
|
+
constructors: z.array(z.any()),
|
|
83
|
+
docs: z.array(z.any()),
|
|
84
|
+
events: z.array(z.any()),
|
|
85
|
+
messages: z.array(z.object({
|
|
86
|
+
label: z.string(),
|
|
87
|
+
selector: z.string()
|
|
88
|
+
}))
|
|
89
|
+
});
|
|
90
|
+
var metadataVersion;
|
|
91
|
+
(function(metadataVersion2) {
|
|
92
|
+
metadataVersion2["V1"] = "V1";
|
|
93
|
+
metadataVersion2["V2"] = "V2";
|
|
94
|
+
metadataVersion2["V3"] = "V3";
|
|
95
|
+
})(metadataVersion || (metadataVersion = {}));
|
|
96
|
+
const AbiDetailsSpec = z.object({
|
|
97
|
+
spec: AbiSpecDef,
|
|
98
|
+
types: AbiTypesSpec,
|
|
99
|
+
storage: AbiStorageSpec
|
|
100
|
+
});
|
|
101
|
+
const AbiMetaDataSpec = z.object({
|
|
102
|
+
metadataVersion: z.string().optional(),
|
|
103
|
+
source: z.object({
|
|
104
|
+
hash: z.string(),
|
|
105
|
+
language: z.string(),
|
|
106
|
+
compiler: z.string(),
|
|
107
|
+
wasm: z.string().optional()
|
|
108
|
+
}),
|
|
109
|
+
contract: z.object({
|
|
110
|
+
name: z.string(),
|
|
111
|
+
version: z.string(),
|
|
112
|
+
authors: z.array(z.string())
|
|
113
|
+
}),
|
|
114
|
+
[metadataVersion.V1]: AbiDetailsSpec.optional(),
|
|
115
|
+
[metadataVersion.V2]: AbiDetailsSpec.optional(),
|
|
116
|
+
[metadataVersion.V3]: AbiDetailsSpec.optional(),
|
|
117
|
+
spec: AbiSpecDef,
|
|
118
|
+
types: AbiTypesSpec,
|
|
119
|
+
storage: AbiStorageSpec
|
|
120
|
+
});
|
|
121
|
+
exports.AbiCellSpec = AbiCellSpec;
|
|
122
|
+
exports.AbiDetailsSpec = AbiDetailsSpec;
|
|
123
|
+
exports.AbiEnumSpec = AbiEnumSpec;
|
|
124
|
+
exports.AbiFieldSpec = AbiFieldSpec;
|
|
125
|
+
exports.AbiMetaDataSpec = AbiMetaDataSpec;
|
|
126
|
+
exports.AbiParamSpec = AbiParamSpec;
|
|
127
|
+
exports.AbiSpecDef = AbiSpecDef;
|
|
128
|
+
exports.AbiStorageEnumSpec = AbiStorageEnumSpec;
|
|
129
|
+
exports.AbiStorageFieldSpec = AbiStorageFieldSpec;
|
|
130
|
+
exports.AbiStorageSpec = AbiStorageSpec;
|
|
131
|
+
exports.AbiStorageStructSpec = AbiStorageStructSpec;
|
|
132
|
+
exports.AbiText = AbiText;
|
|
133
|
+
exports.AbiTypeSpec = AbiTypeSpec;
|
|
134
|
+
exports.AbiTypesSpec = AbiTypesSpec;
|
|
135
|
+
exports.AbiVariantSpec = AbiVariantSpec;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const artifacts = require("./artifacts.cjs");
|
|
4
|
+
require("./contract.cjs");
|
|
5
|
+
require("./interface.cjs");
|
|
6
|
+
require("./useWeight.cjs");
|
|
7
|
+
require("./batch.cjs");
|
|
8
|
+
exports.AbiCellSpec = artifacts.AbiCellSpec;
|
|
9
|
+
exports.AbiDetailsSpec = artifacts.AbiDetailsSpec;
|
|
10
|
+
exports.AbiEnumSpec = artifacts.AbiEnumSpec;
|
|
11
|
+
exports.AbiFieldSpec = artifacts.AbiFieldSpec;
|
|
12
|
+
exports.AbiMetaDataSpec = artifacts.AbiMetaDataSpec;
|
|
13
|
+
exports.AbiParamSpec = artifacts.AbiParamSpec;
|
|
14
|
+
exports.AbiSpecDef = artifacts.AbiSpecDef;
|
|
15
|
+
exports.AbiStorageEnumSpec = artifacts.AbiStorageEnumSpec;
|
|
16
|
+
exports.AbiStorageFieldSpec = artifacts.AbiStorageFieldSpec;
|
|
17
|
+
exports.AbiStorageSpec = artifacts.AbiStorageSpec;
|
|
18
|
+
exports.AbiStorageStructSpec = artifacts.AbiStorageStructSpec;
|
|
19
|
+
exports.AbiText = artifacts.AbiText;
|
|
20
|
+
exports.AbiTypeSpec = artifacts.AbiTypeSpec;
|
|
21
|
+
exports.AbiTypesSpec = artifacts.AbiTypesSpec;
|
|
22
|
+
exports.AbiVariantSpec = artifacts.AbiVariantSpec;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const z = require("zod");
|
|
4
|
+
exports.CaptchaTypes = void 0;
|
|
5
|
+
(function(CaptchaTypes) {
|
|
6
|
+
CaptchaTypes["SelectAll"] = "SelectAll";
|
|
7
|
+
})(exports.CaptchaTypes || (exports.CaptchaTypes = {}));
|
|
8
|
+
exports.CaptchaItemTypes = void 0;
|
|
9
|
+
(function(CaptchaItemTypes) {
|
|
10
|
+
CaptchaItemTypes["Text"] = "text";
|
|
11
|
+
CaptchaItemTypes["Image"] = "image";
|
|
12
|
+
})(exports.CaptchaItemTypes || (exports.CaptchaItemTypes = {}));
|
|
13
|
+
exports.CaptchaStates = void 0;
|
|
14
|
+
(function(CaptchaStates) {
|
|
15
|
+
CaptchaStates["Solved"] = "solved";
|
|
16
|
+
CaptchaStates["Unsolved"] = "unsolved";
|
|
17
|
+
})(exports.CaptchaStates || (exports.CaptchaStates = {}));
|
|
18
|
+
exports.CaptchaStatus = void 0;
|
|
19
|
+
(function(CaptchaStatus) {
|
|
20
|
+
CaptchaStatus["pending"] = "Pending";
|
|
21
|
+
CaptchaStatus["approved"] = "Approved";
|
|
22
|
+
CaptchaStatus["disapproved"] = "Disapproved";
|
|
23
|
+
})(exports.CaptchaStatus || (exports.CaptchaStatus = {}));
|
|
24
|
+
exports.GovernanceStatus = void 0;
|
|
25
|
+
(function(GovernanceStatus) {
|
|
26
|
+
GovernanceStatus["active"] = "Active";
|
|
27
|
+
GovernanceStatus["inactive"] = "Inactive";
|
|
28
|
+
})(exports.GovernanceStatus || (exports.GovernanceStatus = {}));
|
|
29
|
+
exports.DappPayee = void 0;
|
|
30
|
+
(function(DappPayee) {
|
|
31
|
+
DappPayee["provider"] = "Provider";
|
|
32
|
+
DappPayee["dapp"] = "Dapp";
|
|
33
|
+
DappPayee["any"] = "Any";
|
|
34
|
+
})(exports.DappPayee || (exports.DappPayee = {}));
|
|
35
|
+
const POW_SEPARATOR = "___";
|
|
36
|
+
const PowChallengeIdSchema = z.custom((val) => {
|
|
37
|
+
const valSplit = val.split(POW_SEPARATOR);
|
|
38
|
+
try {
|
|
39
|
+
parseInt(valSplit[0]);
|
|
40
|
+
return valSplit.length === 3;
|
|
41
|
+
} catch (e) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
const CaptchaSchema = z.object({
|
|
46
|
+
captchaId: z.union([z.string(), z.undefined()]),
|
|
47
|
+
captchaContentId: z.union([z.string(), z.undefined()]),
|
|
48
|
+
salt: z.string().min(34),
|
|
49
|
+
solution: z.number().array().optional(),
|
|
50
|
+
unlabelled: z.number().array().optional(),
|
|
51
|
+
timeLimit: z.number().optional()
|
|
52
|
+
});
|
|
53
|
+
const CaptchaItemSchema = z.object({
|
|
54
|
+
hash: z.string(),
|
|
55
|
+
data: z.string(),
|
|
56
|
+
type: z.nativeEnum(exports.CaptchaItemTypes)
|
|
57
|
+
});
|
|
58
|
+
const HashedCaptchaItemSchema = CaptchaItemSchema.extend({
|
|
59
|
+
hash: z.string()
|
|
60
|
+
});
|
|
61
|
+
const LabelledItemSchema = HashedCaptchaItemSchema.extend({
|
|
62
|
+
label: z.string()
|
|
63
|
+
});
|
|
64
|
+
const MaybeLabelledHashedItemSchema = HashedCaptchaItemSchema.extend({
|
|
65
|
+
label: z.string().optional()
|
|
66
|
+
});
|
|
67
|
+
const SelectAllCaptchaSchemaRaw = CaptchaSchema.extend({
|
|
68
|
+
items: z.array(CaptchaItemSchema),
|
|
69
|
+
target: z.string()
|
|
70
|
+
});
|
|
71
|
+
const SelectAllCaptchaSchema = SelectAllCaptchaSchemaRaw.extend({
|
|
72
|
+
solution: z.string().array().optional(),
|
|
73
|
+
unlabelled: z.string().array().optional()
|
|
74
|
+
});
|
|
75
|
+
const SelectAllCaptchaSchemaWithNumericSolution = SelectAllCaptchaSchema.extend({
|
|
76
|
+
solution: z.number().array().optional(),
|
|
77
|
+
unlabelled: z.number().array().optional()
|
|
78
|
+
});
|
|
79
|
+
const CaptchasSchema = z.array(SelectAllCaptchaSchemaRaw);
|
|
80
|
+
const CaptchasWithNumericSolutionSchema = z.array(SelectAllCaptchaSchemaWithNumericSolution);
|
|
81
|
+
const CaptchaSolutionSchema = z.object({
|
|
82
|
+
captchaId: z.string(),
|
|
83
|
+
captchaContentId: z.string(),
|
|
84
|
+
solution: z.string().array(),
|
|
85
|
+
salt: z.string().min(34)
|
|
86
|
+
});
|
|
87
|
+
const CaptchaSolutionArraySchema = z.array(CaptchaSolutionSchema);
|
|
88
|
+
const DataSchema = z.object({
|
|
89
|
+
items: z.array(MaybeLabelledHashedItemSchema)
|
|
90
|
+
});
|
|
91
|
+
const LabelledDataSchema = z.object({
|
|
92
|
+
items: z.array(LabelledItemSchema)
|
|
93
|
+
});
|
|
94
|
+
const CaptchasContainerSchema = z.object({
|
|
95
|
+
captchas: CaptchasSchema,
|
|
96
|
+
format: z.nativeEnum(exports.CaptchaTypes)
|
|
97
|
+
});
|
|
98
|
+
const LabelsContainerSchema = z.object({
|
|
99
|
+
labels: z.array(z.string())
|
|
100
|
+
});
|
|
101
|
+
exports.CaptchaItemSchema = CaptchaItemSchema;
|
|
102
|
+
exports.CaptchaSchema = CaptchaSchema;
|
|
103
|
+
exports.CaptchaSolutionArraySchema = CaptchaSolutionArraySchema;
|
|
104
|
+
exports.CaptchaSolutionSchema = CaptchaSolutionSchema;
|
|
105
|
+
exports.CaptchasContainerSchema = CaptchasContainerSchema;
|
|
106
|
+
exports.CaptchasSchema = CaptchasSchema;
|
|
107
|
+
exports.CaptchasWithNumericSolutionSchema = CaptchasWithNumericSolutionSchema;
|
|
108
|
+
exports.DataSchema = DataSchema;
|
|
109
|
+
exports.HashedCaptchaItemSchema = HashedCaptchaItemSchema;
|
|
110
|
+
exports.LabelledDataSchema = LabelledDataSchema;
|
|
111
|
+
exports.LabelledItemSchema = LabelledItemSchema;
|
|
112
|
+
exports.LabelsContainerSchema = LabelsContainerSchema;
|
|
113
|
+
exports.MaybeLabelledHashedItemSchema = MaybeLabelledHashedItemSchema;
|
|
114
|
+
exports.POW_SEPARATOR = POW_SEPARATOR;
|
|
115
|
+
exports.PowChallengeIdSchema = PowChallengeIdSchema;
|
|
116
|
+
exports.SelectAllCaptchaSchema = SelectAllCaptchaSchema;
|
|
117
|
+
exports.SelectAllCaptchaSchemaRaw = SelectAllCaptchaSchemaRaw;
|
|
118
|
+
exports.SelectAllCaptchaSchemaWithNumericSolution = SelectAllCaptchaSchemaWithNumericSolution;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const z = require("zod");
|
|
4
|
+
const captcha = require("./captcha.cjs");
|
|
5
|
+
const DatasetSchema = z.object({
|
|
6
|
+
datasetId: z.string().optional(),
|
|
7
|
+
datasetContentId: z.string().optional(),
|
|
8
|
+
captchas: captcha.CaptchasSchema,
|
|
9
|
+
format: z.nativeEnum(captcha.CaptchaTypes),
|
|
10
|
+
solutionTree: z.array(z.array(z.string())).optional(),
|
|
11
|
+
contentTree: z.array(z.array(z.string())).optional(),
|
|
12
|
+
timeLimit: z.number().optional()
|
|
13
|
+
});
|
|
14
|
+
const DatasetWithNumericSolutionSchema = DatasetSchema.extend({
|
|
15
|
+
captchas: captcha.CaptchasWithNumericSolutionSchema
|
|
16
|
+
});
|
|
17
|
+
const DatasetWithIdsSchema = z.object({
|
|
18
|
+
datasetId: z.string(),
|
|
19
|
+
datasetContentId: z.string().optional(),
|
|
20
|
+
captchas: z.array(captcha.SelectAllCaptchaSchema),
|
|
21
|
+
format: z.nativeEnum(captcha.CaptchaTypes),
|
|
22
|
+
solutionTree: z.array(z.array(z.string())).optional(),
|
|
23
|
+
contentTree: z.array(z.array(z.string())).optional()
|
|
24
|
+
});
|
|
25
|
+
const DatasetWithIdsAndTreeSchema = DatasetWithIdsSchema.extend({
|
|
26
|
+
solutionTree: z.array(z.array(z.string())),
|
|
27
|
+
contentTree: z.array(z.array(z.string()))
|
|
28
|
+
});
|
|
29
|
+
exports.DatasetSchema = DatasetSchema;
|
|
30
|
+
exports.DatasetWithIdsAndTreeSchema = DatasetWithIdsAndTreeSchema;
|
|
31
|
+
exports.DatasetWithIdsSchema = DatasetWithIdsSchema;
|
|
32
|
+
exports.DatasetWithNumericSolutionSchema = DatasetWithNumericSolutionSchema;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const captcha = require("./captcha.cjs");
|
|
4
|
+
const dataset = require("./dataset.cjs");
|
|
5
|
+
require("./merkle.cjs");
|
|
6
|
+
require("./assets.cjs");
|
|
7
|
+
exports.CaptchaItemSchema = captcha.CaptchaItemSchema;
|
|
8
|
+
Object.defineProperty(exports, "CaptchaItemTypes", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: () => captcha.CaptchaItemTypes
|
|
11
|
+
});
|
|
12
|
+
exports.CaptchaSchema = captcha.CaptchaSchema;
|
|
13
|
+
exports.CaptchaSolutionArraySchema = captcha.CaptchaSolutionArraySchema;
|
|
14
|
+
exports.CaptchaSolutionSchema = captcha.CaptchaSolutionSchema;
|
|
15
|
+
Object.defineProperty(exports, "CaptchaStates", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: () => captcha.CaptchaStates
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "CaptchaStatus", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: () => captcha.CaptchaStatus
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports, "CaptchaTypes", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: () => captcha.CaptchaTypes
|
|
26
|
+
});
|
|
27
|
+
exports.CaptchasContainerSchema = captcha.CaptchasContainerSchema;
|
|
28
|
+
exports.CaptchasSchema = captcha.CaptchasSchema;
|
|
29
|
+
exports.CaptchasWithNumericSolutionSchema = captcha.CaptchasWithNumericSolutionSchema;
|
|
30
|
+
Object.defineProperty(exports, "DappPayee", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: () => captcha.DappPayee
|
|
33
|
+
});
|
|
34
|
+
exports.DataSchema = captcha.DataSchema;
|
|
35
|
+
Object.defineProperty(exports, "GovernanceStatus", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: () => captcha.GovernanceStatus
|
|
38
|
+
});
|
|
39
|
+
exports.HashedCaptchaItemSchema = captcha.HashedCaptchaItemSchema;
|
|
40
|
+
exports.LabelledDataSchema = captcha.LabelledDataSchema;
|
|
41
|
+
exports.LabelledItemSchema = captcha.LabelledItemSchema;
|
|
42
|
+
exports.LabelsContainerSchema = captcha.LabelsContainerSchema;
|
|
43
|
+
exports.MaybeLabelledHashedItemSchema = captcha.MaybeLabelledHashedItemSchema;
|
|
44
|
+
exports.POW_SEPARATOR = captcha.POW_SEPARATOR;
|
|
45
|
+
exports.PowChallengeIdSchema = captcha.PowChallengeIdSchema;
|
|
46
|
+
exports.SelectAllCaptchaSchema = captcha.SelectAllCaptchaSchema;
|
|
47
|
+
exports.SelectAllCaptchaSchemaRaw = captcha.SelectAllCaptchaSchemaRaw;
|
|
48
|
+
exports.SelectAllCaptchaSchemaWithNumericSolution = captcha.SelectAllCaptchaSchemaWithNumericSolution;
|
|
49
|
+
exports.DatasetSchema = dataset.DatasetSchema;
|
|
50
|
+
exports.DatasetWithIdsAndTreeSchema = dataset.DatasetWithIdsAndTreeSchema;
|
|
51
|
+
exports.DatasetWithIdsSchema = dataset.DatasetWithIdsSchema;
|
|
52
|
+
exports.DatasetWithNumericSolutionSchema = dataset.DatasetWithNumericSolutionSchema;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
require("./api/index.cjs");
|
|
4
|
+
require("./config/index.cjs");
|
|
5
|
+
require("./contract/index.cjs");
|
|
6
|
+
require("./datasets/index.cjs");
|
|
7
|
+
require("./provider/index.cjs");
|
|
8
|
+
require("./procaptcha/index.cjs");
|
|
9
|
+
const index$1 = require("./procaptcha-bundle/index.cjs");
|
|
10
|
+
require("./procaptcha-frictionless/index.cjs");
|
|
11
|
+
const index = require("./networks/index.cjs");
|
|
12
|
+
Object.defineProperty(exports, "FeaturesEnum", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: () => index$1.FeaturesEnum
|
|
15
|
+
});
|
|
16
|
+
exports.networks = index;
|