Skip to content

Commit 56c97ed

Browse files
author
EspressoTrip-v2
committed
fixed imports
1 parent 5704b48 commit 56c97ed

8 files changed

Lines changed: 68 additions & 12 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"proxy": "^2.2.0",
4141
"tedious": "^18.6.1",
4242
"typescript": "^5.9.3",
43+
"mssql": "^12.0.0",
4344
"vitest": "^3.2.4"
4445
},
4546
"dependencies": {

pnpm-lock.yaml

Lines changed: 54 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/HttpsProxySocket.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import * as tls from 'tls';
44
import * as url from 'url';
5-
import { proxyAgent } from './proxyAgent';
5+
import { proxyAgent } from './proxyAgent.js';
66
import { debug as nodeDebug } from 'util';
77
const debug = nodeDebug('https-proxy');
88

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export * from './HttpsProxySocket';
2-
export * from './tediousPatch';
3-
export * from './mongoPatch';
1+
export * from './HttpsProxySocket.js';
2+
export * from './tediousPatch.js';
3+
export * from './mongoPatch.js';

src/mongoPatch.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as socks from 'socks';
22
import * as tls from 'tls';
3-
import { HttpsProxySocket } from './HttpsProxySocket';
3+
import { HttpsProxySocket } from './HttpsProxySocket.js';
44

55
interface Config {
66
/** The journey apps cc egress token */
@@ -13,7 +13,7 @@ interface Config {
1313
* @param config - The configuration for the proxy
1414
*/
1515
export function useProxyForMongo(config: Config) {
16-
let socket: tls.TLSSocket
16+
let socket: tls.TLSSocket;
1717
socks.SocksClient.createConnection = async (options, callback) => {
1818
const proxy = new HttpsProxySocket(`https://${config.proxy}`, { auth: config.auth });
1919
return new Promise(async (resolve, reject) => {
@@ -24,6 +24,6 @@ export function useProxyForMongo(config: Config) {
2424
});
2525
};
2626
return {
27-
close: () => socket?.end()
28-
}
27+
close: () => socket?.end(),
28+
};
2929
}

src/proxyAgent.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { HttpsProxySocket } from './HttpsProxySocket';
1+
import { HttpsProxySocket } from './HttpsProxySocket.js';
22
import agentBase from 'agent-base';
33
import * as tls from 'tls';
44

@@ -9,14 +9,14 @@ import * as tls from 'tls';
99
* @param options - to set additional TLS options for https requests, e.g. rejectUnauthorized
1010
*/
1111
export function proxyAgent(proxy: HttpsProxySocket, options?: tls.ConnectionOptions) {
12-
return agentBase(async (req: agentBase.ClientRequest, opts: any) => {
12+
return agentBase(async (_, opts: any) => {
1313
const socket = await proxy.connect(opts);
1414

1515
if (opts.secureEndpoint) {
1616
// Upgrade to TLS
1717
let tlsOptions: tls.ConnectionOptions = {
1818
socket: socket,
19-
servername: opts.servername || opts.host
19+
servername: opts.servername || opts.host,
2020
};
2121
if (typeof opts.rejectUnauthorized != 'undefined') {
2222
// There's a difference between 'undefined' (equivalent of false) and "not set" (equivalent of true)

src/tediousPatch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { HttpsProxySocket } from './HttpsProxySocket';
1+
import { HttpsProxySocket } from './HttpsProxySocket.js';
22
const debug = require('debug')('https-proxy');
33

44
/**

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"compilerOptions": {
33
"target": "es2022",
4+
"moduleResolution": "node",
45
"declaration": true,
56
"declarationMap": true,
67
"esModuleInterop": true,

0 commit comments

Comments
 (0)