@prosopo/datasets 0.2.0 → 0.2.2

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.
@@ -15,7 +15,7 @@ import { ProsopoEnvError } from '@prosopo/common';
15
15
  import client from 'axios';
16
16
  export async function downloadImage(url) {
17
17
  try {
18
- return new Uint8Array((await client.default.get(url, { url, method: 'GET', responseType: 'arraybuffer' })).data);
18
+ return new Uint8Array((await client.get(url, { url, method: 'GET', responseType: 'arraybuffer' })).data);
19
19
  }
20
20
  catch (error) {
21
21
  // TODO fix/improve error handling
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/captcha/util.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,MAAM,MAAM,OAAO,CAAA;AAE1B,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,GAAW;IAC3C,IAAI;QACA,OAAO,IAAI,UAAU,CACjB,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,GAAG,CAAc,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,IAAI,CACzG,CAAA;KACJ;IAAC,OAAO,KAAK,EAAE;QACZ,kCAAkC;QAClC,MAAM,IAAI,eAAe,CAAC,KAAc,CAAC,CAAA;KAC5C;AACL,CAAC"}
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/captcha/util.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,MAAM,MAAM,OAAO,CAAA;AAE1B,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,GAAW;IAC3C,IAAI;QACA,OAAO,IAAI,UAAU,CACjB,CAAC,MAAM,MAAM,CAAC,GAAG,CAAc,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,IAAI,CACjG,CAAA;KACJ;IAAC,OAAO,KAAK,EAAE;QACZ,kCAAkC;QAClC,MAAM,IAAI,eAAe,CAAC,KAAc,CAAC,CAAA;KAC5C;AACL,CAAC"}
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const types = require("@prosopo/types");
4
+ const common = require("@prosopo/common");
5
+ const util = require("@prosopo/util");
6
+ const util$1 = require("./util.cjs");
7
+ const util$2 = require("@polkadot/util");
8
+ const NO_SOLUTION_VALUE = "NO_SOLUTION";
9
+ function parseCaptchaDataset(datasetJSON) {
10
+ try {
11
+ const result = types.DatasetSchema.parse(datasetJSON);
12
+ const result2 = {
13
+ format: result.format,
14
+ captchas: result.captchas.map((captcha) => {
15
+ return {
16
+ ...captcha,
17
+ solution: captcha.solution || [],
18
+ unlabelled: captcha.unlabelled || []
19
+ };
20
+ })
21
+ };
22
+ if (result.datasetId !== void 0)
23
+ result2.datasetId = result.datasetId;
24
+ if (result.contentTree !== void 0)
25
+ result2.contentTree = result.contentTree;
26
+ if (result.datasetContentId !== void 0)
27
+ result2.datasetContentId = result.datasetContentId;
28
+ if (result.solutionTree !== void 0)
29
+ result2.solutionTree = result.solutionTree;
30
+ return result2;
31
+ } catch (err) {
32
+ throw new common.ProsopoEnvError(err);
33
+ }
34
+ }
35
+ function parseAndSortCaptchaSolutions(captchaJSON) {
36
+ try {
37
+ return types.CaptchaSolutionArraySchema.parse(captchaJSON).map((captcha) => ({
38
+ ...captcha,
39
+ solution: captcha.solution.sort()
40
+ }));
41
+ } catch (err) {
42
+ throw new common.ProsopoEnvError(err);
43
+ }
44
+ }
45
+ function captchaSort(a, b) {
46
+ return a.captchaId.localeCompare(b.captchaId);
47
+ }
48
+ function sortAndComputeHashes(received, stored) {
49
+ received.sort(captchaSort);
50
+ stored.sort(captchaSort);
51
+ return stored.map(({ salt, items = [], target = "", captchaId, solved }, index) => {
52
+ const item = util.at(received, index);
53
+ if (captchaId != item.captchaId) {
54
+ throw new common.ProsopoEnvError("CAPTCHA.ID_MISMATCH");
55
+ }
56
+ return {
57
+ hash: computeCaptchaHash(
58
+ {
59
+ solution: solved ? item.solution : [],
60
+ salt,
61
+ items,
62
+ target
63
+ },
64
+ true,
65
+ true,
66
+ false
67
+ ),
68
+ captchaId
69
+ };
70
+ });
71
+ }
72
+ function compareCaptchaSolutions(received, stored) {
73
+ if (received.length && stored.length && received.length === stored.length) {
74
+ const hashes = sortAndComputeHashes(received, stored);
75
+ return hashes.every(({ hash, captchaId }) => hash === captchaId);
76
+ }
77
+ return false;
78
+ }
79
+ function computeCaptchaHash(captcha, includeSolution = false, includeSalt = false, sortItemHashes) {
80
+ try {
81
+ const itemHashes = captcha.items.map((item, index) => {
82
+ if (item.hash) {
83
+ return item.hash;
84
+ } else {
85
+ throw new common.ProsopoEnvError("CAPTCHA.MISSING_ITEM_HASH", computeCaptchaHash.name, void 0, index);
86
+ }
87
+ });
88
+ return common.hexHashArray([
89
+ captcha.target,
90
+ // empty array hashes as empty string, undefined solution results in the array [`NO_SOLUTION`]
91
+ // [undefined] also hashes as empty string, which is why we don't use it
92
+ ...includeSolution ? getSolutionValueToHash(captcha.solution) : [],
93
+ includeSalt ? captcha.salt : "",
94
+ sortItemHashes ? itemHashes.sort() : itemHashes
95
+ ]);
96
+ } catch (err) {
97
+ throw new common.ProsopoEnvError(err);
98
+ }
99
+ }
100
+ function getSolutionValueToHash(solution) {
101
+ return solution !== void 0 ? solution.sort() : [NO_SOLUTION_VALUE];
102
+ }
103
+ async function computeItemHash(item) {
104
+ if (item.type === "text") {
105
+ return { ...item, hash: common.hexHash(item.data) };
106
+ } else if (item.type === "image") {
107
+ return { ...item, hash: common.hexHash(await util$1.downloadImage(item.data)) };
108
+ } else {
109
+ throw new common.ProsopoEnvError("CAPTCHA.INVALID_ITEM_FORMAT");
110
+ }
111
+ }
112
+ function matchItemsToSolutions(solutions, items) {
113
+ return (solutions == null ? void 0 : solutions.map((solution) => {
114
+ var _a;
115
+ const index = parseInt(solution.toString());
116
+ const hash = items && items[index] && (((_a = items[index]) == null ? void 0 : _a.hash) || solution);
117
+ if (!hash) {
118
+ throw new common.ProsopoEnvError("CAPTCHA.MISSING_ITEM_HASH");
119
+ }
120
+ if (!util$2.isHex(hash)) {
121
+ throw new common.ProsopoEnvError("CAPTCHA.INVALID_ITEM_HASH");
122
+ }
123
+ return hash;
124
+ })) || [];
125
+ }
126
+ function computeCaptchaSolutionHash(captcha) {
127
+ return common.hexHashArray([captcha.captchaId, captcha.captchaContentId, [...captcha.solution].sort(), captcha.salt]);
128
+ }
129
+ function computePendingRequestHash(captchaIds, userAccount, salt) {
130
+ return common.hexHashArray([...captchaIds.sort(), userAccount, salt]);
131
+ }
132
+ function parseCaptchaAssets(item, assetsResolver) {
133
+ return { ...item, path: (assetsResolver == null ? void 0 : assetsResolver.resolveAsset(item.data).getURL()) || item.data };
134
+ }
135
+ exports.NO_SOLUTION_VALUE = NO_SOLUTION_VALUE;
136
+ exports.captchaSort = captchaSort;
137
+ exports.compareCaptchaSolutions = compareCaptchaSolutions;
138
+ exports.computeCaptchaHash = computeCaptchaHash;
139
+ exports.computeCaptchaSolutionHash = computeCaptchaSolutionHash;
140
+ exports.computeItemHash = computeItemHash;
141
+ exports.computePendingRequestHash = computePendingRequestHash;
142
+ exports.getSolutionValueToHash = getSolutionValueToHash;
143
+ exports.matchItemsToSolutions = matchItemsToSolutions;
144
+ exports.parseAndSortCaptchaSolutions = parseAndSortCaptchaSolutions;
145
+ exports.parseCaptchaAssets = parseCaptchaAssets;
146
+ exports.parseCaptchaDataset = parseCaptchaDataset;
147
+ exports.sortAndComputeHashes = sortAndComputeHashes;
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const merkle = require("./merkle.cjs");
4
+ const common = require("@prosopo/common");
5
+ const util = require("@prosopo/util");
6
+ const captcha = require("./captcha.cjs");
7
+ const logger = common.getLogger(`Info`, `dataset.ts`);
8
+ async function hashDatasetItems(datasetRaw) {
9
+ return datasetRaw.captchas.map(async (captcha$1) => {
10
+ const items = await Promise.all(captcha$1.items.map(async (item) => captcha.computeItemHash(item)));
11
+ return {
12
+ ...captcha$1,
13
+ items
14
+ };
15
+ });
16
+ }
17
+ async function validateDatasetContent(datasetOriginal) {
18
+ const captchaPromises = await hashDatasetItems(datasetOriginal);
19
+ const captchas = await Promise.all(captchaPromises);
20
+ const dataset = {
21
+ ...datasetOriginal,
22
+ captchas
23
+ };
24
+ const hashes = dataset.captchas.map((captcha2) => {
25
+ const captchaRaw = datasetOriginal.captchas.find(
26
+ (captchaRaw2) => "captchaId" in captchaRaw2 ? captchaRaw2.captchaId === captcha2.captchaId : false
27
+ );
28
+ if (captchaRaw) {
29
+ return captcha2.items.every((item, index) => item.hash === util.at(captchaRaw.items, index).hash);
30
+ } else {
31
+ return false;
32
+ }
33
+ });
34
+ return hashes.every((hash) => hash);
35
+ }
36
+ async function buildDataset(datasetRaw) {
37
+ var _a, _b;
38
+ logger.info(`Adding solution hashes to dataset`);
39
+ const dataset = await addSolutionHashesToDataset(datasetRaw);
40
+ logger.info(`Building dataset merkle trees`);
41
+ const contentTree = await buildCaptchaTree(dataset, false, false, true);
42
+ const solutionTree = await buildCaptchaTree(dataset, true, true, false);
43
+ dataset.captchas = dataset.captchas.map(
44
+ (captcha2, index) => {
45
+ var _a2, _b2;
46
+ return {
47
+ ...captcha2,
48
+ captchaId: util.at(solutionTree.leaves, index).hash,
49
+ captchaContentId: util.at(contentTree.leaves, index).hash,
50
+ datasetId: (_a2 = solutionTree.root) == null ? void 0 : _a2.hash,
51
+ datasetContentId: (_b2 = contentTree.root) == null ? void 0 : _b2.hash
52
+ };
53
+ }
54
+ );
55
+ dataset.solutionTree = solutionTree.layers;
56
+ dataset.contentTree = contentTree.layers;
57
+ dataset.datasetId = (_a = solutionTree.root) == null ? void 0 : _a.hash;
58
+ dataset.datasetContentId = (_b = contentTree.root) == null ? void 0 : _b.hash;
59
+ return dataset;
60
+ }
61
+ async function buildCaptchaTree(dataset, includeSolution, includeSalt, sortItemHashes) {
62
+ try {
63
+ const tree = new merkle.CaptchaMerkleTree();
64
+ const datasetWithItemHashes = { ...dataset };
65
+ const captchaHashes = datasetWithItemHashes.captchas.map(
66
+ (captcha$1) => captcha.computeCaptchaHash(captcha$1, includeSolution, includeSalt, sortItemHashes)
67
+ );
68
+ tree.build(captchaHashes);
69
+ return tree;
70
+ } catch (err) {
71
+ throw new common.ProsopoEnvError("DATASET.HASH_ERROR");
72
+ }
73
+ }
74
+ async function addSolutionHashesToDataset(datasetRaw) {
75
+ const captchaPromises = datasetRaw.captchas.map(async (captcha$1) => {
76
+ return {
77
+ ...captcha$1,
78
+ items: captcha$1.items,
79
+ // some captcha challenges will not have a solution
80
+ ...captcha$1.solution !== void 0 && { solution: captcha.matchItemsToSolutions(captcha$1.solution, captcha$1.items) }
81
+ };
82
+ });
83
+ const captchas = await Promise.all(captchaPromises);
84
+ return {
85
+ ...datasetRaw,
86
+ captchas
87
+ };
88
+ }
89
+ exports.addSolutionHashesToDataset = addSolutionHashesToDataset;
90
+ exports.buildCaptchaTree = buildCaptchaTree;
91
+ exports.buildDataset = buildDataset;
92
+ exports.hashDatasetItems = hashDatasetItems;
93
+ exports.validateDatasetContent = validateDatasetContent;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const captcha = require("./captcha.cjs");
4
+ const merkle = require("./merkle.cjs");
5
+ const util = require("./util.cjs");
6
+ const dataset = require("./dataset.cjs");
7
+ exports.NO_SOLUTION_VALUE = captcha.NO_SOLUTION_VALUE;
8
+ exports.captchaSort = captcha.captchaSort;
9
+ exports.compareCaptchaSolutions = captcha.compareCaptchaSolutions;
10
+ exports.computeCaptchaHash = captcha.computeCaptchaHash;
11
+ exports.computeCaptchaSolutionHash = captcha.computeCaptchaSolutionHash;
12
+ exports.computeItemHash = captcha.computeItemHash;
13
+ exports.computePendingRequestHash = captcha.computePendingRequestHash;
14
+ exports.getSolutionValueToHash = captcha.getSolutionValueToHash;
15
+ exports.matchItemsToSolutions = captcha.matchItemsToSolutions;
16
+ exports.parseAndSortCaptchaSolutions = captcha.parseAndSortCaptchaSolutions;
17
+ exports.parseCaptchaAssets = captcha.parseCaptchaAssets;
18
+ exports.parseCaptchaDataset = captcha.parseCaptchaDataset;
19
+ exports.sortAndComputeHashes = captcha.sortAndComputeHashes;
20
+ exports.CaptchaMerkleTree = merkle.CaptchaMerkleTree;
21
+ exports.verifyProof = merkle.verifyProof;
22
+ exports.downloadImage = util.downloadImage;
23
+ exports.addSolutionHashesToDataset = dataset.addSolutionHashesToDataset;
24
+ exports.buildCaptchaTree = dataset.buildCaptchaTree;
25
+ exports.buildDataset = dataset.buildDataset;
26
+ exports.hashDatasetItems = dataset.hashDatasetItems;
27
+ exports.validateDatasetContent = dataset.validateDatasetContent;
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const util = require("@prosopo/util");
4
+ const common = require("@prosopo/common");
5
+ class MerkleNode {
6
+ constructor(hash) {
7
+ this.hash = hash;
8
+ this.parent = null;
9
+ }
10
+ }
11
+ class CaptchaMerkleTree {
12
+ constructor() {
13
+ this.leaves = [];
14
+ this.layers = [];
15
+ }
16
+ build(leaves) {
17
+ if (this.layers.length) {
18
+ this.layers = [];
19
+ }
20
+ const layerZero = [];
21
+ for (const leaf of leaves) {
22
+ const node = new MerkleNode(leaf);
23
+ this.leaves.push(node);
24
+ layerZero.push(node.hash);
25
+ }
26
+ this.layers.push(layerZero);
27
+ this.root = this.buildMerkleTree(this.leaves)[0];
28
+ }
29
+ buildMerkleTree(leaves) {
30
+ const numLeaves = leaves.length;
31
+ if (numLeaves === 1) {
32
+ return leaves;
33
+ }
34
+ const parents = [];
35
+ let leafIndex = 0;
36
+ const newLayer = [];
37
+ while (leafIndex < numLeaves) {
38
+ const leftChild = leaves[leafIndex];
39
+ if (leftChild === void 0) {
40
+ throw new Error("leftChild undefined");
41
+ }
42
+ const rightChild = leafIndex + 1 < numLeaves ? util.at(leaves, leafIndex + 1) : leftChild;
43
+ const parentNode = this.createParent(leftChild, rightChild);
44
+ newLayer.push(parentNode.hash);
45
+ parents.push(parentNode);
46
+ leafIndex += 2;
47
+ }
48
+ this.layers.push(newLayer);
49
+ return this.buildMerkleTree(parents);
50
+ }
51
+ createParent(leftChild, rightChild) {
52
+ const parent = new MerkleNode(common.hexHashArray([leftChild.hash, rightChild.hash]));
53
+ leftChild.parent = parent.hash;
54
+ rightChild.parent = parent.hash;
55
+ return parent;
56
+ }
57
+ proof(leafHash) {
58
+ const proofTree = [];
59
+ let layerNum = 0;
60
+ while (layerNum < this.layers.length - 1) {
61
+ const layer = this.layers[layerNum];
62
+ if (layer === void 0) {
63
+ throw new Error("layer undefined");
64
+ }
65
+ const leafIndex = layer.indexOf(leafHash);
66
+ let partnerIndex = leafIndex % 2 && leafIndex > 0 ? leafIndex - 1 : leafIndex + 1;
67
+ if (partnerIndex > layer.length - 1) {
68
+ partnerIndex = leafIndex;
69
+ }
70
+ const pair = [leafHash];
71
+ const partner = util.at(layer, partnerIndex);
72
+ if (partnerIndex > leafIndex) {
73
+ pair.push(partner);
74
+ } else {
75
+ pair.unshift(partner);
76
+ }
77
+ proofTree.push([util.at(pair, 0), util.at(pair, 1)]);
78
+ layerNum += 1;
79
+ leafHash = common.hexHashArray(pair);
80
+ }
81
+ const last = util.at(this.layers, this.layers.length - 1);
82
+ return [...proofTree, [util.at(last, 0)]];
83
+ }
84
+ }
85
+ function verifyProof(leaf, proof) {
86
+ try {
87
+ if (util.at(proof, 0).indexOf(leaf) === -1) {
88
+ return false;
89
+ }
90
+ for (const [layerIndex, layer] of proof.entries()) {
91
+ leaf = common.hexHashArray(layer);
92
+ if (util.at(proof, layerIndex + 1).indexOf(leaf) === -1) {
93
+ return false;
94
+ }
95
+ const last = util.at(proof, proof.length - 1);
96
+ if (leaf === util.at(last, 0)) {
97
+ return true;
98
+ }
99
+ }
100
+ return false;
101
+ } catch (err) {
102
+ return false;
103
+ }
104
+ }
105
+ exports.CaptchaMerkleTree = CaptchaMerkleTree;
106
+ exports.verifyProof = verifyProof;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const common = require("@prosopo/common");
4
+ const client = require("axios");
5
+ async function downloadImage(url) {
6
+ try {
7
+ return new Uint8Array(
8
+ (await client.get(url, { url, method: "GET", responseType: "arraybuffer" })).data
9
+ );
10
+ } catch (error) {
11
+ throw new common.ProsopoEnvError(error);
12
+ }
13
+ }
14
+ exports.downloadImage = downloadImage;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ require("./captcha/index.cjs");
4
+ const captcha = require("./captcha/captcha.cjs");
5
+ const merkle = require("./captcha/merkle.cjs");
6
+ const util = require("./captcha/util.cjs");
7
+ const dataset = require("./captcha/dataset.cjs");
8
+ exports.NO_SOLUTION_VALUE = captcha.NO_SOLUTION_VALUE;
9
+ exports.captchaSort = captcha.captchaSort;
10
+ exports.compareCaptchaSolutions = captcha.compareCaptchaSolutions;
11
+ exports.computeCaptchaHash = captcha.computeCaptchaHash;
12
+ exports.computeCaptchaSolutionHash = captcha.computeCaptchaSolutionHash;
13
+ exports.computeItemHash = captcha.computeItemHash;
14
+ exports.computePendingRequestHash = captcha.computePendingRequestHash;
15
+ exports.getSolutionValueToHash = captcha.getSolutionValueToHash;
16
+ exports.matchItemsToSolutions = captcha.matchItemsToSolutions;
17
+ exports.parseAndSortCaptchaSolutions = captcha.parseAndSortCaptchaSolutions;
18
+ exports.parseCaptchaAssets = captcha.parseCaptchaAssets;
19
+ exports.parseCaptchaDataset = captcha.parseCaptchaDataset;
20
+ exports.sortAndComputeHashes = captcha.sortAndComputeHashes;
21
+ exports.CaptchaMerkleTree = merkle.CaptchaMerkleTree;
22
+ exports.verifyProof = merkle.verifyProof;
23
+ exports.downloadImage = util.downloadImage;
24
+ exports.addSolutionHashesToDataset = dataset.addSolutionHashesToDataset;
25
+ exports.buildCaptchaTree = dataset.buildCaptchaTree;
26
+ exports.buildDataset = dataset.buildDataset;
27
+ exports.hashDatasetItems = dataset.hashDatasetItems;
28
+ exports.validateDatasetContent = dataset.validateDatasetContent;
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@prosopo/datasets",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "author": "PROSOPO LIMITED <info@prosopo.io>",
5
5
  "license": "Apache-2.0",
6
6
  "private": false,
7
7
  "scripts": {
8
8
  "clean": "tsc --build --clean",
9
- "build": "tsc --build --verbose",
9
+ "build": "tsc --build --verbose tsconfig.json",
10
+ "build:cjs": "npx vite --config vite.cjs.config.ts build",
10
11
  "lint": "npx eslint .",
11
12
  "lint:fix": "npx eslint . --fix --config ../../.eslintrc.js",
12
13
  "cli": "node ./dist/cli.js",
@@ -16,8 +17,10 @@
16
17
  "type": "module",
17
18
  "types": "./dist/index.d.ts",
18
19
  "exports": {
19
- ".": "./dist/index.js",
20
- "./types": "./dist/types/index.js",
20
+ ".": {
21
+ "import": "./dist/index.js",
22
+ "require": "./dist/cjs/index.cjs"
23
+ },
21
24
  "./captcha": "./dist/captcha/index.js"
22
25
  },
23
26
  "typesVersions": {
@@ -32,11 +35,11 @@
32
35
  },
33
36
  "dependencies": {
34
37
  "@polkadot/util": "^12.3.2",
35
- "@prosopo/common": "0.2.0",
36
- "@prosopo/contract": "0.2.0",
37
- "@prosopo/types": "0.2.0",
38
- "@prosopo/util": "0.2.0",
39
- "axios": "^0.27.2"
38
+ "@prosopo/common": "0.2.2",
39
+ "@prosopo/contract": "0.2.2",
40
+ "@prosopo/types": "0.2.2",
41
+ "@prosopo/util": "0.2.2",
42
+ "axios": "^1.5.0"
40
43
  },
41
44
  "devDependencies": {
42
45
  "@types/mocha": "^10.0.0",
@@ -0,0 +1,6 @@
1
+ import { ViteCommonJSConfig } from '@prosopo/config'
2
+ import path from 'path'
3
+
4
+ export default function () {
5
+ return ViteCommonJSConfig('datasets', path.resolve('./tsconfig.cjs.json'))
6
+ }