@spotto/contract 0.0.6 → 0.0.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.
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateEmptyBody = exports.emptyBodySchema = exports.extractBody = void 0;
|
|
4
4
|
const joi_1 = require("joi");
|
|
5
|
+
const error_1 = require("@spotto/core-lib/dist/error");
|
|
5
6
|
const schema_1 = require("./schema");
|
|
6
7
|
const extractBody = (maybeBody) => {
|
|
7
8
|
if (!maybeBody) {
|
|
8
|
-
throw
|
|
9
|
+
throw new error_1.ValidationError('You must provide a request body');
|
|
9
10
|
}
|
|
10
11
|
return JSON.parse(maybeBody);
|
|
11
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.js","sourceRoot":"","sources":["../../../src/types/shared/body.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,qCAA6C;AAMtC,MAAM,WAAW,GAAG,CAAC,SAAyB,EAAE,EAAE;IACvD,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,
|
|
1
|
+
{"version":3,"file":"body.js","sourceRoot":"","sources":["../../../src/types/shared/body.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,uDAA8D;AAC9D,qCAA6C;AAMtC,MAAM,WAAW,GAAG,CAAC,SAAyB,EAAE,EAAE;IACvD,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,uBAAe,CAAC,iCAAiC,CAAC,CAAC;KAC9D;IAED,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AAC/B,CAAC,CAAC;AANW,QAAA,WAAW,eAMtB;AAQW,QAAA,eAAe,GAAG,YAAM,CAAY,EAAE,CAAC,CAAC;AAE9C,MAAM,iBAAiB,GAAG,CAAC,OAAY,EAAE,EAAE,CAChD,0BAAiB,CAAY,uBAAe,EAAE,OAAO,CAAC,CAAC;AAD5C,QAAA,iBAAiB,qBAC2B"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spotto/contract",
|
|
3
3
|
"license": "ISC",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.8",
|
|
5
5
|
"description": "Spotto's API Contract",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"files": [
|
|
@@ -18,10 +18,14 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@airtasker/spot": "^1.4.0",
|
|
21
|
-
"@spotto/core-lib": "^0.0.
|
|
21
|
+
"@spotto/core-lib": "^0.0.8",
|
|
22
22
|
"geojson-validation": "^1.0.2",
|
|
23
23
|
"joi": "^17.2.1",
|
|
24
24
|
"qs": "^6.9.4"
|
|
25
25
|
},
|
|
26
|
-
"
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"jest": "^26.6.3",
|
|
28
|
+
"ts-jest": "^26.5.3"
|
|
29
|
+
},
|
|
30
|
+
"gitHead": "29ebf51783336725c5a36d674cfeafa10a3d9c3b"
|
|
27
31
|
}
|