@prosopo/datasets 0.1.10 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/js/captcha/captcha.d.ts +8 -4
  2. package/dist/js/captcha/captcha.d.ts.map +1 -1
  3. package/dist/js/captcha/captcha.js +22 -17
  4. package/dist/js/captcha/captcha.js.map +1 -1
  5. package/dist/js/captcha/dataset.d.ts +1 -1
  6. package/dist/js/captcha/dataset.d.ts.map +1 -1
  7. package/dist/js/captcha/dataset.js +7 -11
  8. package/dist/js/captcha/dataset.js.map +1 -1
  9. package/dist/js/captcha/merkle.d.ts +1 -1
  10. package/dist/js/captcha/merkle.d.ts.map +1 -1
  11. package/dist/js/captcha/merkle.js +4 -19
  12. package/dist/js/captcha/merkle.js.map +1 -1
  13. package/dist/js/captcha/util.d.ts +0 -5
  14. package/dist/js/captcha/util.d.ts.map +1 -1
  15. package/dist/js/captcha/util.js +3 -19
  16. package/dist/js/captcha/util.js.map +1 -1
  17. package/dist/js/index.d.ts +0 -1
  18. package/dist/js/index.d.ts.map +1 -1
  19. package/dist/js/index.js +0 -1
  20. package/dist/js/index.js.map +1 -1
  21. package/package.json +12 -21
  22. package/.eslintignore +0 -3
  23. package/.eslintrc.js +0 -36
  24. package/.prettierrc.js +0 -7
  25. package/LICENSE +0 -201
  26. package/dist/js/types/assets.d.ts +0 -8
  27. package/dist/js/types/assets.d.ts.map +0 -1
  28. package/dist/js/types/assets.js +0 -18
  29. package/dist/js/types/assets.js.map +0 -1
  30. package/dist/js/types/captcha.d.ts +0 -285
  31. package/dist/js/types/captcha.d.ts.map +0 -1
  32. package/dist/js/types/captcha.js +0 -67
  33. package/dist/js/types/captcha.js.map +0 -1
  34. package/dist/js/types/dataset.d.ts +0 -311
  35. package/dist/js/types/dataset.d.ts.map +0 -1
  36. package/dist/js/types/dataset.js +0 -28
  37. package/dist/js/types/dataset.js.map +0 -1
  38. package/dist/js/types/error.d.ts +0 -14
  39. package/dist/js/types/error.d.ts.map +0 -1
  40. package/dist/js/types/error.js +0 -51
  41. package/dist/js/types/error.js.map +0 -1
  42. package/dist/js/types/index.d.ts +0 -6
  43. package/dist/js/types/index.d.ts.map +0 -1
  44. package/dist/js/types/index.js +0 -9
  45. package/dist/js/types/index.js.map +0 -1
  46. package/dist/js/types/merkle.d.ts +0 -10
  47. package/dist/js/types/merkle.d.ts.map +0 -1
  48. package/dist/js/types/merkle.js +0 -18
  49. package/dist/js/types/merkle.js.map +0 -1
  50. package/tsconfig.json +0 -17
@@ -1,311 +0,0 @@
1
- import { HexString } from '@polkadot/util/types';
2
- import { Captcha, CaptchaTypes, CaptchaWithoutId } from './captcha';
3
- import { z } from 'zod';
4
- export type DatasetBase = {
5
- datasetId?: HexString | string | null;
6
- datasetContentId?: HexString | string | null;
7
- format: CaptchaTypes;
8
- contentTree?: string[][];
9
- solutionTree?: string[][];
10
- };
11
- export interface Dataset extends DatasetBase {
12
- captchas: CaptchaWithoutId[] | Captcha[];
13
- }
14
- export interface DatasetRaw extends DatasetBase {
15
- captchas: CaptchaWithoutId[];
16
- }
17
- export type DatasetWithIds = {
18
- datasetId: HexString | string;
19
- datasetContentId: HexString | string | null;
20
- captchas: Captcha[];
21
- format: CaptchaTypes;
22
- contentTree?: string[][];
23
- solutionTree?: string[][];
24
- };
25
- export interface DatasetWithIdsAndTree extends DatasetWithIds {
26
- contentTree: string[][];
27
- }
28
- export declare const DatasetSchema: z.ZodObject<{
29
- datasetId: z.ZodOptional<z.ZodString>;
30
- datasetContentId: z.ZodOptional<z.ZodString>;
31
- captchas: z.ZodArray<z.ZodObject<z.extendShape<{
32
- captchaId: z.ZodUnion<[z.ZodString, z.ZodUndefined]>;
33
- captchaContentId: z.ZodUnion<[z.ZodString, z.ZodUndefined]>;
34
- salt: z.ZodString;
35
- solution: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
36
- timeLimit: z.ZodOptional<z.ZodNumber>;
37
- }, {
38
- items: z.ZodArray<z.ZodObject<{
39
- hash: z.ZodOptional<z.ZodString>;
40
- data: z.ZodString;
41
- type: z.ZodNativeEnum<typeof import("./captcha").CaptchaItemTypes>;
42
- }, "strip", z.ZodTypeAny, {
43
- hash?: string | undefined;
44
- data: string;
45
- type: import("./captcha").CaptchaItemTypes;
46
- }, {
47
- hash?: string | undefined;
48
- data: string;
49
- type: import("./captcha").CaptchaItemTypes;
50
- }>, "many">;
51
- target: z.ZodString;
52
- }>, "strip", z.ZodTypeAny, {
53
- captchaId?: string | undefined;
54
- captchaContentId?: string | undefined;
55
- solution?: number[] | undefined;
56
- timeLimit?: number | undefined;
57
- salt: string;
58
- items: {
59
- hash?: string | undefined;
60
- data: string;
61
- type: import("./captcha").CaptchaItemTypes;
62
- }[];
63
- target: string;
64
- }, {
65
- captchaId?: string | undefined;
66
- captchaContentId?: string | undefined;
67
- solution?: number[] | undefined;
68
- timeLimit?: number | undefined;
69
- salt: string;
70
- items: {
71
- hash?: string | undefined;
72
- data: string;
73
- type: import("./captcha").CaptchaItemTypes;
74
- }[];
75
- target: string;
76
- }>, "many">;
77
- format: z.ZodNativeEnum<typeof CaptchaTypes>;
78
- solutionTree: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
79
- contentTree: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
80
- timeLimit: z.ZodOptional<z.ZodNumber>;
81
- }, "strip", z.ZodTypeAny, {
82
- timeLimit?: number | undefined;
83
- datasetId?: string | undefined;
84
- datasetContentId?: string | undefined;
85
- solutionTree?: string[][] | undefined;
86
- contentTree?: string[][] | undefined;
87
- captchas: {
88
- captchaId?: string | undefined;
89
- captchaContentId?: string | undefined;
90
- solution?: number[] | undefined;
91
- timeLimit?: number | undefined;
92
- salt: string;
93
- items: {
94
- hash?: string | undefined;
95
- data: string;
96
- type: import("./captcha").CaptchaItemTypes;
97
- }[];
98
- target: string;
99
- }[];
100
- format: CaptchaTypes.SelectAll;
101
- }, {
102
- timeLimit?: number | undefined;
103
- datasetId?: string | undefined;
104
- datasetContentId?: string | undefined;
105
- solutionTree?: string[][] | undefined;
106
- contentTree?: string[][] | undefined;
107
- captchas: {
108
- captchaId?: string | undefined;
109
- captchaContentId?: string | undefined;
110
- solution?: number[] | undefined;
111
- timeLimit?: number | undefined;
112
- salt: string;
113
- items: {
114
- hash?: string | undefined;
115
- data: string;
116
- type: import("./captcha").CaptchaItemTypes;
117
- }[];
118
- target: string;
119
- }[];
120
- format: CaptchaTypes.SelectAll;
121
- }>;
122
- export declare const DatasetWithIdsSchema: z.ZodObject<{
123
- datasetId: z.ZodString;
124
- datasetContentId: z.ZodOptional<z.ZodString>;
125
- captchas: z.ZodArray<z.ZodObject<z.extendShape<z.extendShape<{
126
- captchaId: z.ZodUnion<[z.ZodString, z.ZodUndefined]>;
127
- captchaContentId: z.ZodUnion<[z.ZodString, z.ZodUndefined]>;
128
- salt: z.ZodString;
129
- solution: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
130
- timeLimit: z.ZodOptional<z.ZodNumber>;
131
- }, {
132
- items: z.ZodArray<z.ZodObject<{
133
- hash: z.ZodOptional<z.ZodString>;
134
- data: z.ZodString;
135
- type: z.ZodNativeEnum<typeof import("./captcha").CaptchaItemTypes>;
136
- }, "strip", z.ZodTypeAny, {
137
- hash?: string | undefined;
138
- data: string;
139
- type: import("./captcha").CaptchaItemTypes;
140
- }, {
141
- hash?: string | undefined;
142
- data: string;
143
- type: import("./captcha").CaptchaItemTypes;
144
- }>, "many">;
145
- target: z.ZodString;
146
- }>, {
147
- solution: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
148
- }>, "strip", z.ZodTypeAny, {
149
- captchaId?: string | undefined;
150
- captchaContentId?: string | undefined;
151
- solution?: string[] | undefined;
152
- timeLimit?: number | undefined;
153
- salt: string;
154
- items: {
155
- hash?: string | undefined;
156
- data: string;
157
- type: import("./captcha").CaptchaItemTypes;
158
- }[];
159
- target: string;
160
- }, {
161
- captchaId?: string | undefined;
162
- captchaContentId?: string | undefined;
163
- solution?: string[] | undefined;
164
- timeLimit?: number | undefined;
165
- salt: string;
166
- items: {
167
- hash?: string | undefined;
168
- data: string;
169
- type: import("./captcha").CaptchaItemTypes;
170
- }[];
171
- target: string;
172
- }>, "many">;
173
- format: z.ZodNativeEnum<typeof CaptchaTypes>;
174
- solutionTree: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
175
- contentTree: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
176
- }, "strip", z.ZodTypeAny, {
177
- datasetContentId?: string | undefined;
178
- solutionTree?: string[][] | undefined;
179
- contentTree?: string[][] | undefined;
180
- datasetId: string;
181
- captchas: {
182
- captchaId?: string | undefined;
183
- captchaContentId?: string | undefined;
184
- solution?: string[] | undefined;
185
- timeLimit?: number | undefined;
186
- salt: string;
187
- items: {
188
- hash?: string | undefined;
189
- data: string;
190
- type: import("./captcha").CaptchaItemTypes;
191
- }[];
192
- target: string;
193
- }[];
194
- format: CaptchaTypes.SelectAll;
195
- }, {
196
- datasetContentId?: string | undefined;
197
- solutionTree?: string[][] | undefined;
198
- contentTree?: string[][] | undefined;
199
- datasetId: string;
200
- captchas: {
201
- captchaId?: string | undefined;
202
- captchaContentId?: string | undefined;
203
- solution?: string[] | undefined;
204
- timeLimit?: number | undefined;
205
- salt: string;
206
- items: {
207
- hash?: string | undefined;
208
- data: string;
209
- type: import("./captcha").CaptchaItemTypes;
210
- }[];
211
- target: string;
212
- }[];
213
- format: CaptchaTypes.SelectAll;
214
- }>;
215
- export declare const DatasetWithIdsAndTreeSchema: z.ZodObject<z.extendShape<{
216
- datasetId: z.ZodString;
217
- datasetContentId: z.ZodOptional<z.ZodString>;
218
- captchas: z.ZodArray<z.ZodObject<z.extendShape<z.extendShape<{
219
- captchaId: z.ZodUnion<[z.ZodString, z.ZodUndefined]>;
220
- captchaContentId: z.ZodUnion<[z.ZodString, z.ZodUndefined]>;
221
- salt: z.ZodString;
222
- solution: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
223
- timeLimit: z.ZodOptional<z.ZodNumber>;
224
- }, {
225
- items: z.ZodArray<z.ZodObject<{
226
- hash: z.ZodOptional<z.ZodString>;
227
- data: z.ZodString;
228
- type: z.ZodNativeEnum<typeof import("./captcha").CaptchaItemTypes>;
229
- }, "strip", z.ZodTypeAny, {
230
- hash?: string | undefined;
231
- data: string;
232
- type: import("./captcha").CaptchaItemTypes;
233
- }, {
234
- hash?: string | undefined;
235
- data: string;
236
- type: import("./captcha").CaptchaItemTypes;
237
- }>, "many">;
238
- target: z.ZodString;
239
- }>, {
240
- solution: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
241
- }>, "strip", z.ZodTypeAny, {
242
- captchaId?: string | undefined;
243
- captchaContentId?: string | undefined;
244
- solution?: string[] | undefined;
245
- timeLimit?: number | undefined;
246
- salt: string;
247
- items: {
248
- hash?: string | undefined;
249
- data: string;
250
- type: import("./captcha").CaptchaItemTypes;
251
- }[];
252
- target: string;
253
- }, {
254
- captchaId?: string | undefined;
255
- captchaContentId?: string | undefined;
256
- solution?: string[] | undefined;
257
- timeLimit?: number | undefined;
258
- salt: string;
259
- items: {
260
- hash?: string | undefined;
261
- data: string;
262
- type: import("./captcha").CaptchaItemTypes;
263
- }[];
264
- target: string;
265
- }>, "many">;
266
- format: z.ZodNativeEnum<typeof CaptchaTypes>;
267
- solutionTree: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
268
- contentTree: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
269
- }, {
270
- solutionTree: z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">;
271
- contentTree: z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">;
272
- }>, "strip", z.ZodTypeAny, {
273
- datasetContentId?: string | undefined;
274
- datasetId: string;
275
- captchas: {
276
- captchaId?: string | undefined;
277
- captchaContentId?: string | undefined;
278
- solution?: string[] | undefined;
279
- timeLimit?: number | undefined;
280
- salt: string;
281
- items: {
282
- hash?: string | undefined;
283
- data: string;
284
- type: import("./captcha").CaptchaItemTypes;
285
- }[];
286
- target: string;
287
- }[];
288
- format: CaptchaTypes.SelectAll;
289
- solutionTree: string[][];
290
- contentTree: string[][];
291
- }, {
292
- datasetContentId?: string | undefined;
293
- datasetId: string;
294
- captchas: {
295
- captchaId?: string | undefined;
296
- captchaContentId?: string | undefined;
297
- solution?: string[] | undefined;
298
- timeLimit?: number | undefined;
299
- salt: string;
300
- items: {
301
- hash?: string | undefined;
302
- data: string;
303
- type: import("./captcha").CaptchaItemTypes;
304
- }[];
305
- target: string;
306
- }[];
307
- format: CaptchaTypes.SelectAll;
308
- solutionTree: string[][];
309
- contentTree: string[][];
310
- }>;
311
- //# sourceMappingURL=dataset.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dataset.d.ts","sourceRoot":"","sources":["../../../src/js/types/dataset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAA0C,MAAM,WAAW,CAAA;AAC3G,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,MAAM,WAAW,GAAG;IACtB,SAAS,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAAA;IACrC,gBAAgB,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAAA;IAC5C,MAAM,EAAE,YAAY,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,EAAE,EAAE,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,EAAE,CAAA;CAC5B,CAAA;AAED,MAAM,WAAW,OAAQ,SAAQ,WAAW;IACxC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,OAAO,EAAE,CAAA;CAC3C;AAED,MAAM,WAAW,UAAW,SAAQ,WAAW;IAC3C,QAAQ,EAAE,gBAAgB,EAAE,CAAA;CAC/B;AAED,MAAM,MAAM,cAAc,GAAG;IACzB,SAAS,EAAE,SAAS,GAAG,MAAM,CAAA;IAC7B,gBAAgB,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAAA;IAC3C,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,MAAM,EAAE,YAAY,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,EAAE,EAAE,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,EAAE,CAAA;CAC5B,CAAA;AAED,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IACzD,WAAW,EAAE,MAAM,EAAE,EAAE,CAAA;CAC1B;AAID,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQxB,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO/B,CAAA;AAEF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGtC,CAAA"}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DatasetWithIdsAndTreeSchema = exports.DatasetWithIdsSchema = exports.DatasetSchema = void 0;
4
- const captcha_1 = require("./captcha");
5
- const zod_1 = require("zod");
6
- // Zod schemas
7
- exports.DatasetSchema = zod_1.z.object({
8
- datasetId: zod_1.z.string().optional(),
9
- datasetContentId: zod_1.z.string().optional(),
10
- captchas: captcha_1.CaptchasSchema,
11
- format: zod_1.z.nativeEnum(captcha_1.CaptchaTypes),
12
- solutionTree: zod_1.z.array(zod_1.z.array(zod_1.z.string())).optional(),
13
- contentTree: zod_1.z.array(zod_1.z.array(zod_1.z.string())).optional(),
14
- timeLimit: zod_1.z.number().optional(),
15
- });
16
- exports.DatasetWithIdsSchema = zod_1.z.object({
17
- datasetId: zod_1.z.string(),
18
- datasetContentId: zod_1.z.string().optional(),
19
- captchas: zod_1.z.array(captcha_1.SelectAllCaptchaSchema),
20
- format: zod_1.z.nativeEnum(captcha_1.CaptchaTypes),
21
- solutionTree: zod_1.z.array(zod_1.z.array(zod_1.z.string())).optional(),
22
- contentTree: zod_1.z.array(zod_1.z.array(zod_1.z.string())).optional(),
23
- });
24
- exports.DatasetWithIdsAndTreeSchema = exports.DatasetWithIdsSchema.extend({
25
- solutionTree: zod_1.z.array(zod_1.z.array(zod_1.z.string())),
26
- contentTree: zod_1.z.array(zod_1.z.array(zod_1.z.string())),
27
- });
28
- //# sourceMappingURL=dataset.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dataset.js","sourceRoot":"","sources":["../../../src/js/types/dataset.ts"],"names":[],"mappings":";;;AACA,uCAA2G;AAC3G,6BAAuB;AA+BvB,cAAc;AAED,QAAA,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACvC,QAAQ,EAAE,wBAAc;IACxB,MAAM,EAAE,OAAC,CAAC,UAAU,CAAC,sBAAY,CAAC;IAClC,YAAY,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE;IACrD,WAAW,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE;IACpD,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAA;AAEW,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACvC,QAAQ,EAAE,OAAC,CAAC,KAAK,CAAC,gCAAsB,CAAC;IACzC,MAAM,EAAE,OAAC,CAAC,UAAU,CAAC,sBAAY,CAAC;IAClC,YAAY,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE;IACrD,WAAW,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE;CACvD,CAAC,CAAA;AAEW,QAAA,2BAA2B,GAAG,4BAAoB,CAAC,MAAM,CAAC;IACnE,YAAY,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1C,WAAW,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC;CAC5C,CAAC,CAAA"}
@@ -1,14 +0,0 @@
1
- import { TranslationKey, i18n as i18next } from '@prosopo/i18n';
2
- export type TOptions = Record<string, string>;
3
- export declare function translateOrFallback(key: string | undefined, options?: TOptions, fallback?: string, i18n?: import("i18next").i18n): string;
4
- export declare abstract class ProsopoBaseError extends Error {
5
- protected tKey: TranslationKey | undefined;
6
- protected tParams: Record<string, string>;
7
- getTranslated(i18n: typeof i18next): string;
8
- }
9
- export declare class ProsopoEnvError extends ProsopoBaseError {
10
- constructor(error: ProsopoBaseError);
11
- constructor(error: Error, context?: TranslationKey, options?: TOptions, ...params: any[]);
12
- constructor(error: TranslationKey, context?: string, options?: TOptions, ...params: any[]);
13
- }
14
- //# sourceMappingURL=error.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../src/js/types/error.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAQ,IAAI,IAAI,OAAO,EAAmB,MAAM,eAAe,CAAA;AAEtF,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAE7C,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,yBAAU,GAAG,MAAM,CAU1H;AAED,8BAAsB,gBAAiB,SAAQ,KAAK;IAChD,SAAS,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,CAAA;IAC1C,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAEzC,aAAa,CAAC,IAAI,EAAE,OAAO,OAAO,GAAG,MAAM;CAG9C;AAED,qBAAa,eAAgB,SAAQ,gBAAgB;gBACrC,KAAK,EAAE,gBAAgB;gBACvB,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE;gBAC5E,KAAK,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE;CA6B5F"}
@@ -1,51 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProsopoEnvError = exports.ProsopoBaseError = exports.translateOrFallback = void 0;
4
- const i18n_1 = require("@prosopo/i18n");
5
- function translateOrFallback(key, options, fallback, i18n = i18n_1.i18n) {
6
- try {
7
- if (key) {
8
- return i18n.t(key, options);
9
- }
10
- else {
11
- return fallback || key;
12
- }
13
- }
14
- catch (_a) {
15
- return fallback || key;
16
- }
17
- }
18
- exports.translateOrFallback = translateOrFallback;
19
- class ProsopoBaseError extends Error {
20
- getTranslated(i18n) {
21
- return translateOrFallback(this.tKey, this.tParams, this.message, i18n);
22
- }
23
- }
24
- exports.ProsopoBaseError = ProsopoBaseError;
25
- class ProsopoEnvError extends ProsopoBaseError {
26
- constructor(error, context, options, ...params) {
27
- const isError = error instanceof Error;
28
- super(isError ? error.message : translateOrFallback(error, options));
29
- this.name =
30
- (context && `${ProsopoEnvError.name}@${translateOrFallback(context, options)}`) || ProsopoEnvError.name;
31
- if (isError) {
32
- this.cause = error;
33
- if (error instanceof ProsopoBaseError) {
34
- this.tKey = error['tKey'];
35
- this.tParams = error['tParams'];
36
- }
37
- else if (i18n_1.translationKeys.includes(context)) {
38
- this.tKey = context;
39
- this.tParams = options || {};
40
- }
41
- }
42
- else {
43
- this.tKey = error;
44
- this.tParams = options || {};
45
- }
46
- console.error('\n********************* ERROR *********************\n');
47
- console.error(this.cause, this.stack, ...params);
48
- }
49
- }
50
- exports.ProsopoEnvError = ProsopoEnvError;
51
- //# sourceMappingURL=error.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../../../src/js/types/error.ts"],"names":[],"mappings":";;;AACA,wCAAsF;AAItF,SAAgB,mBAAmB,CAAC,GAAuB,EAAE,OAAkB,EAAE,QAAiB,EAAE,IAAI,GAAG,WAAO;IAC9G,IAAI;QACA,IAAI,GAAG,EAAE;YACL,OAAO,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;SAC9B;aAAM;YACH,OAAO,QAAQ,IAAI,GAAI,CAAA;SAC1B;KACJ;IAAC,WAAM;QACJ,OAAO,QAAQ,IAAI,GAAI,CAAA;KAC1B;AACL,CAAC;AAVD,kDAUC;AAED,MAAsB,gBAAiB,SAAQ,KAAK;IAIhD,aAAa,CAAC,IAAoB;QAC9B,OAAO,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IAC3E,CAAC;CACJ;AAPD,4CAOC;AAED,MAAa,eAAgB,SAAQ,gBAAgB;IAKjD,YACI,KAA6B,EAC7B,OAAiC,EACjC,OAAkB,EAClB,GAAG,MAAa;QAEhB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAA;QACtC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAA;QACpE,IAAI,CAAC,IAAI;YACL,CAAC,OAAO,IAAI,GAAG,eAAe,CAAC,IAAI,IAAI,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC,IAAI,eAAe,CAAC,IAAI,CAAA;QAC3G,IAAI,OAAO,EAAE;YACT,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;YAClB,IAAI,KAAK,YAAY,gBAAgB,EAAE;gBACnC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAA;gBACzB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,CAAA;aAClC;iBAAM,IAAI,sBAAe,CAAC,QAAQ,CAAC,OAAyB,CAAC,EAAE;gBAC5D,IAAI,CAAC,IAAI,GAAG,OAAyB,CAAA;gBACrC,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,EAAE,CAAA;aAC/B;SACJ;aAAM;YACH,IAAI,CAAC,IAAI,GAAG,KAAuB,CAAA;YACnC,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,EAAE,CAAA;SAC/B;QAED,OAAO,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAA;QACtE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,MAAM,CAAC,CAAA;IACpD,CAAC;CACJ;AAhCD,0CAgCC"}
@@ -1,6 +0,0 @@
1
- export * from './captcha';
2
- export * from './dataset';
3
- export * from './merkle';
4
- export * from './assets';
5
- export * from './error';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/js/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./captcha"), exports);
5
- tslib_1.__exportStar(require("./dataset"), exports);
6
- tslib_1.__exportStar(require("./merkle"), exports);
7
- tslib_1.__exportStar(require("./assets"), exports);
8
- tslib_1.__exportStar(require("./error"), exports);
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/js/types/index.ts"],"names":[],"mappings":";;;AAAA,oDAAyB;AACzB,oDAAyB;AACzB,mDAAwB;AACxB,mDAAwB;AACxB,kDAAuB"}
@@ -1,10 +0,0 @@
1
- export interface MerkleNodeInterface {
2
- hash: string;
3
- parent: string | null;
4
- }
5
- export type MerkleLeaf = string;
6
- export type MerkleLayer = MerkleLeaf[];
7
- export type MerkleProofLayer = [MerkleLeaf, MerkleLeaf];
8
- export type MerkleRootLayer = [MerkleLeaf];
9
- export type MerkleProof = [...MerkleProofLayer[], MerkleRootLayer];
10
- //# sourceMappingURL=merkle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"merkle.d.ts","sourceRoot":"","sources":["../../../src/js/types/merkle.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,CAAA;AAE/B,MAAM,MAAM,WAAW,GAAG,UAAU,EAAE,CAAA;AAEtC,MAAM,MAAM,gBAAgB,GAAG,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;AAEvD,MAAM,MAAM,eAAe,GAAG,CAAC,UAAU,CAAC,CAAA;AAE1C,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,gBAAgB,EAAE,EAAE,eAAe,CAAC,CAAA"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- // Copyright (C) 2021-2022 Prosopo (UK) Ltd.
3
- // This file is part of provider <https://github.com/prosopo/provider>.
4
- //
5
- // provider is free software: you can redistribute it and/or modify
6
- // it under the terms of the GNU General Public License as published by
7
- // the Free Software Foundation, either version 3 of the License, or
8
- // (at your option) any later version.
9
- //
10
- // provider is distributed in the hope that it will be useful,
11
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- // GNU General Public License for more details.
14
- //
15
- // You should have received a copy of the GNU General Public License
16
- // along with provider. If not, see <http://www.gnu.org/licenses/>.
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- //# sourceMappingURL=merkle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"merkle.js","sourceRoot":"","sources":["../../../src/js/types/merkle.ts"],"names":[],"mappings":";AAAA,4CAA4C;AAC5C,uEAAuE;AACvE,EAAE;AACF,mEAAmE;AACnE,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,8DAA8D;AAC9D,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,oEAAoE"}
package/tsconfig.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.build.json",
3
- "compilerOptions": {
4
- "rootDir": "./src/js",
5
- "outDir": "./dist/js",
6
- },
7
- "include": [
8
- "./src/js/**/*.ts",
9
- "./src/js/abi/*.json"
10
- ],
11
- "exclude": ["**/*.test.ts"],
12
- "references": [
13
- {
14
- "path": "../i18n"
15
- },
16
- ]
17
- }