@prosopo/datasets 1.0.2 → 2.0.0
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/captcha/captcha.d.ts +3 -3
- package/dist/captcha/captcha.d.ts.map +1 -1
- package/dist/captcha/captcha.js +49 -37
- package/dist/captcha/captcha.js.map +1 -1
- package/dist/captcha/dataset.d.ts +2 -2
- package/dist/captcha/dataset.d.ts.map +1 -1
- package/dist/captcha/dataset.js +15 -13
- package/dist/captcha/dataset.js.map +1 -1
- package/dist/captcha/index.d.ts +4 -4
- package/dist/captcha/index.d.ts.map +1 -1
- package/dist/captcha/index.js +4 -4
- package/dist/captcha/index.js.map +1 -1
- package/dist/captcha/merkle.d.ts +2 -1
- package/dist/captcha/merkle.d.ts.map +1 -1
- package/dist/captcha/merkle.js +22 -5
- package/dist/captcha/merkle.js.map +1 -1
- package/dist/captcha/util.d.ts.map +1 -1
- package/dist/captcha/util.js +9 -4
- package/dist/captcha/util.js.map +1 -1
- package/dist/cjs/captcha/captcha.cjs +56 -42
- package/dist/cjs/captcha/dataset.cjs +14 -9
- package/dist/cjs/captcha/merkle.cjs +22 -3
- package/dist/cjs/captcha/util.cjs +7 -2
- package/dist/cjs/tests/mocks/data/captchas.cjs +6 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/tests/captcha.test.js +149 -138
- package/dist/tests/captcha.test.js.map +1 -1
- package/dist/tests/dataset.test.js +53 -51
- package/dist/tests/dataset.test.js.map +1 -1
- package/dist/tests/merkle.test.js +86 -51
- package/dist/tests/merkle.test.js.map +1 -1
- package/dist/tests/mocks/data/captchas.d.ts +1 -1
- package/dist/tests/mocks/data/captchas.d.ts.map +1 -1
- package/dist/tests/mocks/data/captchas.js +608 -606
- package/dist/tests/mocks/data/captchas.js.map +1 -1
- package/dist/tests/mocks/data/captchas1.json +108 -27
- package/dist/tests/mocks/data/captchas2.json +144 -36
- package/dist/tests/mocks/data/captchas3.json +108 -27
- package/dist/tests/mocks/data/captchas4.json +108 -27
- package/package.json +66 -76
- package/vite.cjs.config.ts +3 -3
- package/vite.test.config.ts +12 -12
|
@@ -5,15 +5,42 @@
|
|
|
5
5
|
"salt": "0x010101",
|
|
6
6
|
"solution": [3, 6, 7],
|
|
7
7
|
"items": [
|
|
8
|
-
{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
{
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
{
|
|
8
|
+
{
|
|
9
|
+
"data": "http://localhost:4000/img/test_image_png_16.png",
|
|
10
|
+
"type": "image"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"data": "http://localhost:4000/img/test_image_png_17.png",
|
|
14
|
+
"type": "image"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"data": "http://localhost:4000/img/test_image_png_27.png",
|
|
18
|
+
"type": "image"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"data": "http://localhost:4000/img/test_image_png_33.png",
|
|
22
|
+
"type": "image"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"data": "http://localhost:4000/img/test_image_png_40.png",
|
|
26
|
+
"type": "image"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"data": "http://localhost:4000/img/test_image_png_52.png",
|
|
30
|
+
"type": "image"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"data": "http://localhost:4000/img/test_image_png_78.png",
|
|
34
|
+
"type": "image"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"data": "http://localhost:4000/img/test_image_png_93.png",
|
|
38
|
+
"type": "image"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"data": "http://localhost:4000/img/test_image_png_70.png",
|
|
42
|
+
"type": "image"
|
|
43
|
+
}
|
|
17
44
|
],
|
|
18
45
|
"target": "cat"
|
|
19
46
|
},
|
|
@@ -21,30 +48,84 @@
|
|
|
21
48
|
"salt": "0x020202",
|
|
22
49
|
"solution": [8, 5, 1],
|
|
23
50
|
"items": [
|
|
24
|
-
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{
|
|
51
|
+
{
|
|
52
|
+
"data": "http://localhost:4000/img/test_image_png_16.png",
|
|
53
|
+
"type": "image"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"data": "http://localhost:4000/img/test_image_png_17.png",
|
|
57
|
+
"type": "image"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"data": "http://localhost:4000/img/test_image_png_27.png",
|
|
61
|
+
"type": "image"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"data": "http://localhost:4000/img/test_image_png_33.png",
|
|
65
|
+
"type": "image"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"data": "http://localhost:4000/img/test_image_png_40.png",
|
|
69
|
+
"type": "image"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"data": "http://localhost:4000/img/test_image_png_52.png",
|
|
73
|
+
"type": "image"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"data": "http://localhost:4000/img/test_image_png_78.png",
|
|
77
|
+
"type": "image"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"data": "http://localhost:4000/img/test_image_png_93.png",
|
|
81
|
+
"type": "image"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"data": "http://localhost:4000/img/test_image_png_70.png",
|
|
85
|
+
"type": "image"
|
|
86
|
+
}
|
|
33
87
|
],
|
|
34
88
|
"target": "deer"
|
|
35
89
|
},
|
|
36
90
|
{
|
|
37
91
|
"salt": "0x030303",
|
|
38
92
|
"items": [
|
|
39
|
-
{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
{
|
|
93
|
+
{
|
|
94
|
+
"data": "http://localhost:4000/img/test_image_png_16.png",
|
|
95
|
+
"type": "image"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"data": "http://localhost:4000/img/test_image_png_17.png",
|
|
99
|
+
"type": "image"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"data": "http://localhost:4000/img/test_image_png_27.png",
|
|
103
|
+
"type": "image"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"data": "http://localhost:4000/img/test_image_png_33.png",
|
|
107
|
+
"type": "image"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"data": "http://localhost:4000/img/test_image_png_40.png",
|
|
111
|
+
"type": "image"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"data": "http://localhost:4000/img/test_image_png_52.png",
|
|
115
|
+
"type": "image"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"data": "http://localhost:4000/img/test_image_png_78.png",
|
|
119
|
+
"type": "image"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"data": "http://localhost:4000/img/test_image_png_93.png",
|
|
123
|
+
"type": "image"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"data": "http://localhost:4000/img/test_image_png_70.png",
|
|
127
|
+
"type": "image"
|
|
128
|
+
}
|
|
48
129
|
],
|
|
49
130
|
"target": "dog"
|
|
50
131
|
}
|
package/package.json
CHANGED
|
@@ -1,78 +1,68 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
"homepage": "https://github.com/prosopo/captcha#readme",
|
|
70
|
-
"publishConfig": {
|
|
71
|
-
"registry": "https://registry.npmjs.org"
|
|
72
|
-
},
|
|
73
|
-
"description": "Datasets for use with providers",
|
|
74
|
-
"directories": {
|
|
75
|
-
"test": "tests"
|
|
76
|
-
},
|
|
77
|
-
"sideEffects": false
|
|
2
|
+
"name": "@prosopo/datasets",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"author": "PROSOPO LIMITED <info@prosopo.io>",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"private": false,
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=20",
|
|
9
|
+
"npm": ">=9"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"clean": "tsc --build --clean",
|
|
13
|
+
"build": "tsc --build --verbose",
|
|
14
|
+
"build:cjs": "npx vite --config vite.cjs.config.ts build",
|
|
15
|
+
"test": "NODE_ENV=${NODE_ENV:-test}; npx vitest run --config ./vite.test.config.ts",
|
|
16
|
+
"cli": "node ./dist/cli.js"
|
|
17
|
+
},
|
|
18
|
+
"main": "./dist/index.js",
|
|
19
|
+
"type": "module",
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"import": "./dist/index.js",
|
|
24
|
+
"require": "./dist/cjs/index.cjs"
|
|
25
|
+
},
|
|
26
|
+
"./captcha": {
|
|
27
|
+
"types": "./dist/captcha/index.d.ts",
|
|
28
|
+
"import": "./dist/captcha/index.js",
|
|
29
|
+
"require": "./dist/cjs/captcha/index.cjs",
|
|
30
|
+
"default": "./dist/captcha/index.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"typesVersions": {
|
|
34
|
+
"*": {
|
|
35
|
+
"types": ["dist/types"],
|
|
36
|
+
"captcha": ["dist/captcha"]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@polkadot/util": "12.6.2",
|
|
41
|
+
"@prosopo/common": "2.0.0",
|
|
42
|
+
"@prosopo/types": "2.0.0",
|
|
43
|
+
"@prosopo/util": "2.0.0",
|
|
44
|
+
"vitest": "^1.3.1"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@prosopo/config": "2.0.0",
|
|
48
|
+
"dotenv": "^16.0.1",
|
|
49
|
+
"tslib": "2.6.2",
|
|
50
|
+
"typescript": "5.1.6"
|
|
51
|
+
},
|
|
52
|
+
"repository": {
|
|
53
|
+
"type": "git",
|
|
54
|
+
"url": "git+https://github.com/prosopo/captcha.git"
|
|
55
|
+
},
|
|
56
|
+
"bugs": {
|
|
57
|
+
"url": "https://github.com/prosopo/captcha/issues"
|
|
58
|
+
},
|
|
59
|
+
"homepage": "https://github.com/prosopo/captcha#readme",
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"registry": "https://registry.npmjs.org"
|
|
62
|
+
},
|
|
63
|
+
"description": "Datasets for use with providers",
|
|
64
|
+
"directories": {
|
|
65
|
+
"test": "tests"
|
|
66
|
+
},
|
|
67
|
+
"sideEffects": false
|
|
78
68
|
}
|
package/vite.cjs.config.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import path from "node:path";
|
|
1
2
|
// Copyright 2021-2024 Prosopo (UK) Ltd.
|
|
2
3
|
//
|
|
3
4
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -11,9 +12,8 @@
|
|
|
11
12
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
13
|
// See the License for the specific language governing permissions and
|
|
13
14
|
// limitations under the License.
|
|
14
|
-
import { ViteCommonJSConfig } from
|
|
15
|
-
import path from 'path'
|
|
15
|
+
import { ViteCommonJSConfig } from "@prosopo/config";
|
|
16
16
|
|
|
17
17
|
export default function () {
|
|
18
|
-
|
|
18
|
+
return ViteCommonJSConfig("datasets", path.resolve("./tsconfig.cjs.json"));
|
|
19
19
|
}
|
package/vite.test.config.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
1
3
|
// Copyright 2021-2024 Prosopo (UK) Ltd.
|
|
2
4
|
//
|
|
3
5
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -11,22 +13,20 @@
|
|
|
11
13
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
14
|
// See the License for the specific language governing permissions and
|
|
13
15
|
// limitations under the License.
|
|
14
|
-
import { ViteTestConfig } from
|
|
15
|
-
import dotenv from
|
|
16
|
-
|
|
17
|
-
import path from 'path'
|
|
18
|
-
process.env.NODE_ENV = 'test'
|
|
16
|
+
import { ViteTestConfig } from "@prosopo/config";
|
|
17
|
+
import dotenv from "dotenv";
|
|
18
|
+
process.env.NODE_ENV = "test";
|
|
19
19
|
// if .env.test exists at this level, use it, otherwise use the one at the root
|
|
20
|
-
const envFile = `.env.${process.env.NODE_ENV ||
|
|
21
|
-
let envPath = envFile
|
|
20
|
+
const envFile = `.env.${process.env.NODE_ENV || "development"}`;
|
|
21
|
+
let envPath = envFile;
|
|
22
22
|
if (fs.existsSync(envFile)) {
|
|
23
|
-
|
|
23
|
+
envPath = path.resolve(envFile);
|
|
24
24
|
} else if (fs.existsSync(`../../${envFile}`)) {
|
|
25
|
-
|
|
25
|
+
envPath = path.resolve(`../../${envFile}`);
|
|
26
26
|
} else {
|
|
27
|
-
|
|
27
|
+
throw new Error(`No ${envFile} file found`);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
dotenv.config({ path: envPath })
|
|
30
|
+
dotenv.config({ path: envPath });
|
|
31
31
|
|
|
32
|
-
export default ViteTestConfig
|
|
32
|
+
export default ViteTestConfig;
|