@prosopo/provider-mock 0.2.14 → 0.2.16
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.d.ts +0 -6
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +0 -27
- package/dist/api.js.map +1 -1
- package/package.json +4 -4
- package/tsconfig.tsbuildinfo +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import { Router } from 'express';
|
|
2
|
-
/**
|
|
3
|
-
* Returns a router connected to the database which can interact with the Proposo protocol
|
|
4
|
-
*
|
|
5
|
-
* @return {Router} - A middleware router that can interact with the Prosopo protocol
|
|
6
|
-
* @param {Environment} env - The Prosopo environment
|
|
7
|
-
*/
|
|
8
2
|
export declare function prosopoRouter(): Router;
|
|
9
3
|
//# sourceMappingURL=api.d.ts.map
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAgBA,OAAgB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAgBA,OAAgB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAQzC,wBAAgB,aAAa,IAAI,MAAM,CA+CtC"}
|
package/dist/api.js
CHANGED
|
@@ -1,40 +1,14 @@
|
|
|
1
|
-
// Copyright 2021-2023 Prosopo (UK) Ltd.
|
|
2
|
-
//
|
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
// you may not use this file except in compliance with the License.
|
|
5
|
-
// You may obtain a copy of the License at
|
|
6
|
-
//
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
//
|
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
14
1
|
import { ApiPaths, VerifySolutionBody } from '@prosopo/types';
|
|
15
2
|
import { ProsopoApiError } from '@prosopo/common';
|
|
16
3
|
import express from 'express';
|
|
17
|
-
/**
|
|
18
|
-
* Returns a router connected to the database which can interact with the Proposo protocol
|
|
19
|
-
*
|
|
20
|
-
* @return {Router} - A middleware router that can interact with the Prosopo protocol
|
|
21
|
-
* @param {Environment} env - The Prosopo environment
|
|
22
|
-
*/
|
|
23
4
|
export function prosopoRouter() {
|
|
24
5
|
const router = express.Router();
|
|
25
|
-
/**
|
|
26
|
-
* Verifies a user's solution as being approved or not
|
|
27
|
-
*
|
|
28
|
-
* @param {string} userAccount - Dapp User id
|
|
29
|
-
* @param {string} commitmentId - The captcha solution to look up
|
|
30
|
-
*/
|
|
31
6
|
router.post(ApiPaths.VerifyCaptchaSolution, async (req, res, next) => {
|
|
32
7
|
let parsed;
|
|
33
8
|
try {
|
|
34
9
|
parsed = VerifySolutionBody.parse(req.body);
|
|
35
10
|
}
|
|
36
11
|
catch (err) {
|
|
37
|
-
// TODO fix error handling
|
|
38
12
|
console.log('parsing error');
|
|
39
13
|
return next(new ProsopoApiError(err, undefined, 400));
|
|
40
14
|
}
|
|
@@ -59,7 +33,6 @@ export function prosopoRouter() {
|
|
|
59
33
|
});
|
|
60
34
|
}
|
|
61
35
|
catch (err) {
|
|
62
|
-
// TODO fix error handling
|
|
63
36
|
return next(new ProsopoApiError(err, undefined, 400));
|
|
64
37
|
}
|
|
65
38
|
});
|
package/dist/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAaA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C;gBACZ,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC;gBAC5B,gBAAgB,EAAE,KAAK;aAC1B,CAAC,CAAA;SACL;QAAC,OAAO,GAAG,EAAE;YAEV,OAAO,IAAI,CAAC,IAAI,eAAe,CAAC,GAAY,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC,CAAA;SACjE;IACL,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosopo/provider-mock",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.16",
|
|
4
4
|
"author": "PROSOPO LIMITED <info@prosopo.io>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"build": "tsc --build --verbose tsconfig.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@prosopo/cli": "0.2.
|
|
18
|
-
"@prosopo/common": "0.2.
|
|
19
|
-
"@prosopo/types": "0.2.
|
|
17
|
+
"@prosopo/cli": "0.2.16",
|
|
18
|
+
"@prosopo/common": "0.2.16",
|
|
19
|
+
"@prosopo/types": "0.2.16",
|
|
20
20
|
"es-main": "^1.3.0",
|
|
21
21
|
"express": "^4.18.1"
|
|
22
22
|
},
|