@hestia-earth/data-api 0.0.2-1 → 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.
- package/.gitlab-ci.yml +1 -1
- package/.mocharc.js +1 -1
- package/Dockerfile +1 -1
- package/package.json +24 -24
- package/src/routes.ts +2 -3
- package/test/prepare.ts +4 -6
- package/tsconfig.json +5 -0
- package/src/routes.spec.ts +0 -33
package/.gitlab-ci.yml
CHANGED
package/.mocharc.js
CHANGED
package/Dockerfile
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hestia-earth/data-api",
|
|
3
|
-
"version": "0.0.2-
|
|
3
|
+
"version": "0.0.2-2",
|
|
4
4
|
"description": "Hestia Data API definitions",
|
|
5
5
|
"main": "dist/models.js",
|
|
6
6
|
"typings": "dist/models.d.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"build:lambdas": "rm -rf build-lambdas && tsc -p tsconfig.lambdas.json",
|
|
11
11
|
"start": "node index.js",
|
|
12
12
|
"dev": "ts-node-dev --respawn --rs dev.ts --files --ignore-watch node_modules",
|
|
13
|
-
"lint": "eslint .",
|
|
13
|
+
"lint": "tsc --noEmit && eslint .",
|
|
14
14
|
"lint:fix": "npm run lint -- --fix",
|
|
15
15
|
"test": "nyc mocha \"./**/*.spec.ts\"",
|
|
16
16
|
"migrate": "ts-node scripts/run-migrations.ts",
|
|
@@ -39,31 +39,14 @@
|
|
|
39
39
|
"@hestia-earth/schema": "^22.1.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
+
"@commitlint/cli": "^17.6.5",
|
|
43
|
+
"@commitlint/config-conventional": "^17.6.5",
|
|
44
|
+
"@hestia-earth/eslint-config": "^0.0.5",
|
|
42
45
|
"@hestia-earth/pipeline-utils": "^0.10.4",
|
|
43
46
|
"@sentry/node": "^7.51.2",
|
|
44
47
|
"@sentry/serverless": "^7.55.2",
|
|
45
48
|
"@sentry/tracing": "^7.51.2",
|
|
46
49
|
"@slack/web-api": "^6.8.1",
|
|
47
|
-
"compression": "^1.7.4",
|
|
48
|
-
"cors": "^2.8.5",
|
|
49
|
-
"csvtojson": "^2.0.10",
|
|
50
|
-
"dotenv": "^16.0.3",
|
|
51
|
-
"exit-hook": "^3.2.0",
|
|
52
|
-
"express": "^4.17.3",
|
|
53
|
-
"express-async-errors": "^3.1.1",
|
|
54
|
-
"http2-express-bridge": "^1.0.7",
|
|
55
|
-
"lodash.chunk": "^4.2.0",
|
|
56
|
-
"lodash.uniqby": "^4.7.0",
|
|
57
|
-
"map-obj": "^5.0.2",
|
|
58
|
-
"morgan": "^1.10.0",
|
|
59
|
-
"pg": "^8.11.0",
|
|
60
|
-
"rxjs": "^7.8.1",
|
|
61
|
-
"swagger-jsdoc": "^6.2.8",
|
|
62
|
-
"swagger-ui-express": "^4.6.3",
|
|
63
|
-
"winston": "^3.8.2",
|
|
64
|
-
"@commitlint/cli": "^17.6.5",
|
|
65
|
-
"@commitlint/config-conventional": "^17.6.5",
|
|
66
|
-
"@hestia-earth/eslint-config": "^0.0.5",
|
|
67
50
|
"@types/chai": "^4.3.5",
|
|
68
51
|
"@types/chai-as-promised": "^7.1.5",
|
|
69
52
|
"@types/compression": "^1.7.2",
|
|
@@ -82,20 +65,37 @@
|
|
|
82
65
|
"@types/swagger-ui-express": "^4.1.3",
|
|
83
66
|
"chai": "^4.3.7",
|
|
84
67
|
"chai-as-promised": "^7.1.1",
|
|
68
|
+
"compression": "^1.7.4",
|
|
69
|
+
"cors": "^2.8.5",
|
|
70
|
+
"csvtojson": "^2.0.10",
|
|
71
|
+
"dotenv": "^16.0.3",
|
|
85
72
|
"eslint": "^7.32.0",
|
|
73
|
+
"exit-hook": "^3.2.0",
|
|
74
|
+
"express": "^4.17.3",
|
|
75
|
+
"express-async-errors": "^3.1.1",
|
|
76
|
+
"http2-express-bridge": "^1.0.7",
|
|
86
77
|
"husky": "^4.3.8",
|
|
87
|
-
"
|
|
78
|
+
"lodash.chunk": "^4.2.0",
|
|
79
|
+
"lodash.uniqby": "^4.7.0",
|
|
80
|
+
"map-obj": "^5.0.2",
|
|
81
|
+
"mocha": "^10.2.0",
|
|
82
|
+
"morgan": "^1.10.0",
|
|
88
83
|
"nyc": "^15.1.0",
|
|
84
|
+
"pg": "^8.11.0",
|
|
89
85
|
"postgrator": "^7.1.1",
|
|
86
|
+
"rxjs": "^7.8.1",
|
|
90
87
|
"serverless": "^3.32.2",
|
|
91
88
|
"serverless-deployment-bucket": "^1.6.0",
|
|
92
89
|
"serverless-offline": "^12.0.4",
|
|
93
90
|
"sinon": "^15.1.0",
|
|
94
91
|
"standard-version": "^9.5.0",
|
|
95
92
|
"supertest": "^6.3.3",
|
|
93
|
+
"swagger-jsdoc": "^6.2.8",
|
|
94
|
+
"swagger-ui-express": "^4.6.3",
|
|
96
95
|
"ts-node": "^10.9.1",
|
|
97
96
|
"ts-node-dev": "^2.0.0",
|
|
98
|
-
"typescript": "^5.0.0"
|
|
97
|
+
"typescript": "^5.0.0",
|
|
98
|
+
"winston": "^3.8.2"
|
|
99
99
|
},
|
|
100
100
|
"husky": {
|
|
101
101
|
"hooks": {
|
package/src/routes.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Express } from 'express';
|
|
2
|
+
import aggregatedNodes from './aggregated-nodes/routes';
|
|
2
3
|
|
|
3
4
|
const routes = (app: Express) => {
|
|
4
|
-
app.use('/', (
|
|
5
|
-
res.send('Hello World!');
|
|
6
|
-
});
|
|
5
|
+
app.use('/aggregated-nodes', aggregatedNodes());
|
|
7
6
|
};
|
|
8
7
|
|
|
9
8
|
export default routes;
|
package/test/prepare.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import prepare from 'mocha-prepare';
|
|
2
1
|
import * as dotenv from 'dotenv';
|
|
3
2
|
dotenv.config({ path: '.env.test' });
|
|
4
3
|
|
|
5
4
|
let endPool: () => Promise<void>;
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
(
|
|
6
|
+
export const mochaHooks = {
|
|
7
|
+
beforeAll() {
|
|
9
8
|
({ endPool } = require('../database/'));
|
|
10
|
-
done();
|
|
11
9
|
},
|
|
12
|
-
(done)
|
|
10
|
+
afterAll(done) {
|
|
13
11
|
endPool().finally(() => done());
|
|
14
12
|
}
|
|
15
|
-
|
|
13
|
+
};
|
package/tsconfig.json
CHANGED
package/src/routes.spec.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { expect } from 'chai';
|
|
2
|
-
import * as sinon from 'sinon';
|
|
3
|
-
import 'mocha';
|
|
4
|
-
import express from 'express';
|
|
5
|
-
import supertest from 'supertest';
|
|
6
|
-
import bodyParser from 'body-parser';
|
|
7
|
-
|
|
8
|
-
import routes from './routes';
|
|
9
|
-
import { errorHandler } from './errors';
|
|
10
|
-
|
|
11
|
-
let stubs: sinon.SinonStub[] = [];
|
|
12
|
-
|
|
13
|
-
const app = express();
|
|
14
|
-
app.use(bodyParser.json());
|
|
15
|
-
routes(app);
|
|
16
|
-
app.use(errorHandler);
|
|
17
|
-
|
|
18
|
-
describe('routes', () => {
|
|
19
|
-
beforeEach(() => {
|
|
20
|
-
stubs = [];
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
afterEach(() => {
|
|
24
|
-
stubs.forEach((stub) => stub.restore());
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
describe('GET /', () => {
|
|
28
|
-
it('returns hello world', async () => {
|
|
29
|
-
const result = await supertest(app).get('/');
|
|
30
|
-
expect(result.text).to.equal('Hello World!');
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
});
|