@prosopo/datasets 0.1.8
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/.eslintignore +3 -0
- package/.eslintrc.js +24 -0
- package/LICENSE +201 -0
- package/README.md +25 -0
- package/captchas.json +184 -0
- package/dist/js/captcha/captcha.d.ts +65 -0
- package/dist/js/captcha/captcha.d.ts.map +1 -0
- package/dist/js/captcha/captcha.js +194 -0
- package/dist/js/captcha/captcha.js.map +1 -0
- package/dist/js/captcha/dataset.d.ts +6 -0
- package/dist/js/captcha/dataset.d.ts.map +1 -0
- package/dist/js/captcha/dataset.js +46 -0
- package/dist/js/captcha/dataset.js.map +1 -0
- package/dist/js/captcha/index.d.ts +5 -0
- package/dist/js/captcha/index.d.ts.map +1 -0
- package/dist/js/captcha/index.js +23 -0
- package/dist/js/captcha/index.js.map +1 -0
- package/dist/js/captcha/merkle.d.ts +19 -0
- package/dist/js/captcha/merkle.d.ts.map +1 -0
- package/dist/js/captcha/merkle.js +119 -0
- package/dist/js/captcha/merkle.js.map +1 -0
- package/dist/js/captcha/util.d.ts +3 -0
- package/dist/js/captcha/util.d.ts.map +1 -0
- package/dist/js/captcha/util.js +26 -0
- package/dist/js/captcha/util.js.map +1 -0
- package/dist/js/index.d.ts +3 -0
- package/dist/js/index.d.ts.map +1 -0
- package/dist/js/index.js +21 -0
- package/dist/js/index.js.map +1 -0
- package/dist/js/types/assets.d.ts +8 -0
- package/dist/js/types/assets.d.ts.map +1 -0
- package/dist/js/types/assets.js +18 -0
- package/dist/js/types/assets.js.map +1 -0
- package/dist/js/types/captcha.d.ts +285 -0
- package/dist/js/types/captcha.d.ts.map +1 -0
- package/dist/js/types/captcha.js +67 -0
- package/dist/js/types/captcha.js.map +1 -0
- package/dist/js/types/dataset.d.ts +312 -0
- package/dist/js/types/dataset.d.ts.map +1 -0
- package/dist/js/types/dataset.js +28 -0
- package/dist/js/types/dataset.js.map +1 -0
- package/dist/js/types/index.d.ts +5 -0
- package/dist/js/types/index.d.ts.map +1 -0
- package/dist/js/types/index.js +8 -0
- package/dist/js/types/index.js.map +1 -0
- package/dist/js/types/merkle.d.ts +16 -0
- package/dist/js/types/merkle.d.ts.map +1 -0
- package/dist/js/types/merkle.js +24 -0
- package/dist/js/types/merkle.js.map +1 -0
- package/package.json +67 -0
- package/tsconfig.json +12 -0
|
@@ -0,0 +1,28 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataset.js","sourceRoot":"","sources":["../../../src/js/types/dataset.ts"],"names":[],"mappings":";;;AAGA,uCAOmB;AACnB,6BAAsB;AAgCtB,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/js/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/js/types/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,oDAA0B;AAC1B,mDAAyB;AACzB,mDAAwB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export interface MerkleNodeInterface {
|
|
3
|
+
hash: string;
|
|
4
|
+
parent: string | null;
|
|
5
|
+
}
|
|
6
|
+
export declare const MerkleNodeSchema: z.ZodObject<{
|
|
7
|
+
hash: z.ZodString;
|
|
8
|
+
parent: z.ZodUnion<[z.ZodString, z.ZodNull]>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
hash: string;
|
|
11
|
+
parent: string | null;
|
|
12
|
+
}, {
|
|
13
|
+
hash: string;
|
|
14
|
+
parent: string | null;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=merkle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merkle.d.ts","sourceRoot":"","sources":["../../../src/js/types/merkle.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;EAG3B,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MerkleNodeSchema = void 0;
|
|
4
|
+
// Copyright (C) 2021-2022 Prosopo (UK) Ltd.
|
|
5
|
+
// This file is part of provider <https://github.com/prosopo/provider>.
|
|
6
|
+
//
|
|
7
|
+
// provider is free software: you can redistribute it and/or modify
|
|
8
|
+
// it under the terms of the GNU General Public License as published by
|
|
9
|
+
// the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
// (at your option) any later version.
|
|
11
|
+
//
|
|
12
|
+
// provider is distributed in the hope that it will be useful,
|
|
13
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
// GNU General Public License for more details.
|
|
16
|
+
//
|
|
17
|
+
// You should have received a copy of the GNU General Public License
|
|
18
|
+
// along with provider. If not, see <http://www.gnu.org/licenses/>.
|
|
19
|
+
const zod_1 = require("zod");
|
|
20
|
+
exports.MerkleNodeSchema = zod_1.z.object({
|
|
21
|
+
hash: zod_1.z.string(),
|
|
22
|
+
parent: zod_1.z.union([zod_1.z.string(), zod_1.z.null()])
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=merkle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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;AACpE,6BAAuB;AAOV,QAAA,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IACrC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,IAAI,EAAE,CAAC,CAAC;CAC1C,CAAC,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@prosopo/datasets",
|
|
3
|
+
"version": "0.1.8",
|
|
4
|
+
"author": "PROSOPO LIMITED <info@prosopo.io>",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"private": false,
|
|
7
|
+
"scripts": {
|
|
8
|
+
"clean": "tsc --build --clean",
|
|
9
|
+
"build": "tsc --build --verbose",
|
|
10
|
+
"lint": "npx eslint .",
|
|
11
|
+
"lint:fix": "npx eslint . --fix",
|
|
12
|
+
"test": "NODE_ENV=test ts-mocha \"tests/**/*.test.ts\" --timeout 120000"
|
|
13
|
+
},
|
|
14
|
+
"main": "./dist/js/index.js",
|
|
15
|
+
"types": "./dist/js/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": "./dist/js/index.js",
|
|
18
|
+
"./types": "./dist/js/types/index.js",
|
|
19
|
+
"./captcha": "./dist/js/captcha/index.js"
|
|
20
|
+
},
|
|
21
|
+
"typesVersions": {
|
|
22
|
+
"*": {
|
|
23
|
+
"types": [
|
|
24
|
+
"dist/js/types"
|
|
25
|
+
],
|
|
26
|
+
"captcha": [
|
|
27
|
+
"dist/js/captcha"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@polkadot/api": "^8.13.1",
|
|
33
|
+
"@polkadot/api-contract": "^8.13.1",
|
|
34
|
+
"@polkadot/keyring": "^10.0.2",
|
|
35
|
+
"@polkadot/rpc-provider": "^8.13.1",
|
|
36
|
+
"@polkadot/types": "^8.13.1",
|
|
37
|
+
"@polkadot/types-create": "^8.13.1",
|
|
38
|
+
"@polkadot/util": "^10.0.2",
|
|
39
|
+
"@polkadot/util-crypto": "^10.0.2",
|
|
40
|
+
"@prosopo/contract": "^0.1.7",
|
|
41
|
+
"bn.js": "^5.2.1",
|
|
42
|
+
"consola": "^2.15.3",
|
|
43
|
+
"zod": "^3.17.9"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/mocha": "^10.0.0",
|
|
47
|
+
"@typescript-eslint/eslint-plugin": "^5.30.7",
|
|
48
|
+
"@typescript-eslint/parser": "^5.30.7",
|
|
49
|
+
"eslint": "^8.20.0",
|
|
50
|
+
"typescript": "^4.7.4"
|
|
51
|
+
},
|
|
52
|
+
"repository": {
|
|
53
|
+
"type": "git",
|
|
54
|
+
"url": "git+https://github.com/prosopo/datasets.git"
|
|
55
|
+
},
|
|
56
|
+
"bugs": {
|
|
57
|
+
"url": "https://github.com/prosopo/datasets/issues"
|
|
58
|
+
},
|
|
59
|
+
"homepage": "https://github.com/prosopo/datasets#readme",
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"registry": "https://registry.npmjs.org"
|
|
62
|
+
},
|
|
63
|
+
"description": "Datasets for use with providers",
|
|
64
|
+
"directories": {
|
|
65
|
+
"test": "tests"
|
|
66
|
+
}
|
|
67
|
+
}
|