Skip to content

Commit 1a36767

Browse files
committed
chore: cleanup modules, compilable state
Ticket: WP-4352
1 parent 44e3eff commit 1a36767

File tree

5 files changed

+24
-47
lines changed

5 files changed

+24
-47
lines changed

package.json

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,30 @@
11
{
2-
"name": "@bitgo/enclaved-express",
2+
"name": "@bitgo/enclaved-bitgo-express",
33
"version": "1.0.0",
44
"description": "BitGo Enclaved Express - Secure enclave for BitGo signing operations with mTLS",
55
"main": "./dist/src/index.js",
66
"types": "./dist/src/index.d.ts",
77
"bin": {
8-
"enclaved-express": "./bin/enclaved-express"
8+
"enclaved-bitgo-express": "./bin/enclaved-bitgo-express"
99
},
1010
"scripts": {
11-
"start": "node bin/enclaved-express",
12-
"build": "yarn tsc --build --incremental --verbose .",
11+
"start": "node bin/enclaved-bitgo-express",
12+
"build": "yarn tsc --build --incremental --verbose . && cp package.json dist/",
1313
"test": "jest",
1414
"lint": "eslint --quiet .",
1515
"generate-test-ssl": "openssl req -x509 -newkey rsa:2048 -keyout test-ssl-key.pem -out test-ssl-cert.pem -days 365 -nodes -subj '/CN=localhost'"
1616
},
1717
"dependencies": {
18-
"@bitgo/abstract-lightning": "^4.2.3",
19-
"@bitgo/sdk-core": "^32.2.0",
20-
"@bitgo/utxo-lib": "^11.3.0",
21-
"@types/proxyquire": "^1.3.31",
22-
"argparse": "^1.0.10",
23-
"bitgo": "^43.2.0",
2418
"body-parser": "^1.20.3",
2519
"connect-timeout": "^1.9.0",
2620
"debug": "^3.1.0",
27-
"dotenv": "^16.0.0",
2821
"express": "4.17.3",
29-
"io-ts": "npm:@bitgo-forks/[email protected]",
3022
"lodash": "^4.17.20",
31-
"morgan": "^1.9.1",
32-
"proxy-agent": "6.4.0",
33-
"proxyquire": "^2.1.3",
34-
"superagent": "^9.0.1"
23+
"morgan": "^1.9.1"
3524
},
3625
"devDependencies": {
37-
"@bitgo/public-types": "4.17.0",
38-
"@bitgo/sdk-lib-mpc": "^10.2.0",
39-
"@bitgo/sdk-test": "^8.0.81",
40-
"@types/argparse": "^1.0.36",
4126
"@types/body-parser": "^1.17.0",
27+
"@types/connect-timeout": "^1.9.0",
4228
"@types/express": "4.17.13",
4329
"@types/lodash": "^4.14.121",
4430
"@types/morgan": "^1.7.35",
@@ -52,10 +38,9 @@
5238
"should-sinon": "^0.0.6",
5339
"sinon": "^13.0.1",
5440
"supertest": "^4.0.2",
55-
"supertest-as-promised": "1.0.0",
5641
"typescript": "^4.2.4"
5742
},
5843
"engines": {
5944
"node": ">=14"
6045
}
61-
}
46+
}

src/enclavedApp.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**
22
* @prettier
33
*/
4-
import * as express from 'express';
4+
import express from 'express';
55
import * as path from 'path';
66
import debug from 'debug';
77
import * as https from 'https';
88
import * as http from 'http';
9-
import * as morgan from 'morgan';
9+
import morgan from 'morgan';
1010
import * as fs from 'fs';
11-
import * as timeout from 'connect-timeout';
11+
import timeout from 'connect-timeout';
1212
import * as bodyParser from 'body-parser';
1313
import * as _ from 'lodash';
1414
import { SSL_OP_NO_TLSv1 } from 'constants';
@@ -56,7 +56,7 @@ function setupLogging(app: express.Application, config: Config): void {
5656
export function startup(config: Config, baseUri: string): () => void {
5757
return function () {
5858
/* eslint-disable no-console */
59-
console.log('BitGo-Enclaved-Express running');
59+
console.log('BitGo-enclaved-bitgo-express running');
6060
console.log(`Base URI: ${baseUri}`);
6161
console.log(`TLS Mode: ${config.tlsMode}`);
6262
console.log(`mTLS Enabled: ${config.tlsMode === TlsMode.MTLS}`);
@@ -197,7 +197,7 @@ export function app(cfg: Config): express.Application {
197197
});
198198

199199
// Set timeout
200-
app.use(timeout(cfg.timeout));
200+
app.use(timeout(cfg.timeout) as any);
201201

202202
// Add body parser
203203
app.use(bodyParser.json({ limit: '20mb' }));

src/routes.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
/**
22
* @prettier
33
*/
4-
import * as express from 'express';
4+
import express from 'express';
55
import debug from 'debug';
6-
import { handleV2Sign } from './signing/multisig';
76

87
const debugLogger = debug('enclaved:routes');
98

@@ -77,7 +76,8 @@ export function promiseWrapper(promiseRequestHandler: any) {
7776
res.status(200).send(result);
7877
}
7978
} catch (e) {
80-
res.status(500).json({ error: e.message || String(e) });
79+
const err = e as any;
80+
res.status(500).json({ error: err.message || String(err) });
8181
}
8282
};
8383
}

tsconfig.json

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
{
2-
"extends": "../../tsconfig.json",
32
"compilerOptions": {
3+
"target": "es2018",
4+
"module": "commonjs",
5+
"declaration": true,
46
"outDir": "./dist",
57
"rootDir": ".",
6-
"typeRoots": ["./types", "../../types", "./node_modules/@types", "../../node_modules/@types"]
8+
"strict": true,
9+
"esModuleInterop": true,
10+
"skipLibCheck": true,
11+
"forceConsistentCasingInFileNames": true,
12+
"typeRoots": ["./types", "./node_modules/@types"]
713
},
814
"include": ["src/**/*", "test/**/*", "package.json"],
9-
"exclude": ["node_modules"],
10-
"references": [
11-
{
12-
"path": "../bitgo"
13-
},
14-
{
15-
"path": "../sdk-core"
16-
},
17-
{
18-
"path": "../statics"
19-
},
20-
{
21-
"path": "../abstract-lightning"
22-
}
23-
]
15+
"exclude": ["node_modules", "dist"]
2416
}

0 commit comments

Comments
 (0)