bdy 1.22.18-dev → 1.22.20-dev

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.22.18-dev",
4
+ "version": "1.22.20-dev",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -7,10 +7,9 @@ const events_1 = __importDefault(require("events"));
7
7
  const logger_1 = __importDefault(require("../logger"));
8
8
  const texts_1 = require("../texts");
9
9
  const utils_1 = require("../utils");
10
- const tunnel_1 = __importDefault(require("../tunnel/tunnel"));
11
10
  const output_1 = __importDefault(require("../output"));
12
11
  const client_1 = __importDefault(require("./socket/client"));
13
- const tunnel_2 = require("../types/tunnel");
12
+ const tunnel_1 = require("../types/tunnel");
14
13
  class Agent extends events_1.default {
15
14
  id;
16
15
  host;
@@ -44,12 +43,12 @@ class Agent extends events_1.default {
44
43
  this.manager = null;
45
44
  this.onRefresh = null;
46
45
  this.socket = new client_1.default(host, id, token);
47
- this.socket.on(tunnel_2.TUNNEL_SOCKET_EVENT.FETCH_SUCCESS, (data) => this._onSocketFetch(data));
48
- this.socket.on(tunnel_2.TUNNEL_SOCKET_EVENT.FETCH_FAILED, (err) => this._onSocketFetchFailed(err));
49
- this.socket.on(tunnel_2.TUNNEL_SOCKET_EVENT.CONNECTED, () => this._onSocketConnected());
50
- this.socket.on(tunnel_2.TUNNEL_SOCKET_EVENT.DISCONNECTED, () => this._onSocketDisconnected());
51
- this.socket.on(tunnel_2.TUNNEL_SOCKET_EVENT.TUNNEL, (tunnel, action) => this._onSocketTunnel(tunnel, action));
52
- this.socket.on(tunnel_2.TUNNEL_SOCKET_EVENT.AGENT, (agent, action) => this._onSocketAgent(agent, action));
46
+ this.socket.on(tunnel_1.TUNNEL_SOCKET_EVENT.FETCH_SUCCESS, (data) => this._onSocketFetch(data));
47
+ this.socket.on(tunnel_1.TUNNEL_SOCKET_EVENT.FETCH_FAILED, (err) => this._onSocketFetchFailed(err));
48
+ this.socket.on(tunnel_1.TUNNEL_SOCKET_EVENT.CONNECTED, () => this._onSocketConnected());
49
+ this.socket.on(tunnel_1.TUNNEL_SOCKET_EVENT.DISCONNECTED, () => this._onSocketDisconnected());
50
+ this.socket.on(tunnel_1.TUNNEL_SOCKET_EVENT.TUNNEL, (tunnel, action) => this._onSocketTunnel(tunnel, action));
51
+ this.socket.on(tunnel_1.TUNNEL_SOCKET_EVENT.AGENT, (agent, action) => this._onSocketAgent(agent, action));
53
52
  }
54
53
  destroy() {
55
54
  if (this.socket) {
@@ -245,7 +244,7 @@ class Agent extends events_1.default {
245
244
  }
246
245
  }
247
246
  async makeAction(action) {
248
- if (action === tunnel_2.TUNNEL_AGENT_ACTION.DELETE) {
247
+ if (action === tunnel_1.TUNNEL_AGENT_ACTION.DELETE) {
249
248
  if (this.manager) {
250
249
  return this.manager.disableAgentAndExit(texts_1.ERR_AGENT_REMOVED);
251
250
  }
@@ -270,7 +269,8 @@ class Agent extends events_1.default {
270
269
  sshHostKey = this.manager.sshHostKey;
271
270
  const tunnel = tt.find((tunnel) => data.id === tunnel.id);
272
271
  if (!tunnel) {
273
- this.addTunnel(new tunnel_1.default({
272
+ const TunnelImpl = require('../tunnel/tunnel').default;
273
+ this.addTunnel(new TunnelImpl({
274
274
  ...data,
275
275
  sshHostKey,
276
276
  agent: {
@@ -298,7 +298,7 @@ class Agent extends events_1.default {
298
298
  this.tunnels.forEach((t) => {
299
299
  update.push({
300
300
  id: t.id,
301
- active: t.status === tunnel_2.TUNNEL_STATUS.OPEN && !forceInactive,
301
+ active: t.status === tunnel_1.TUNNEL_STATUS.OPEN && !forceInactive,
302
302
  regionLatency: t.regionLatency ? t.regionLatency.latency : -1,
303
303
  targetLatency: t.targetLatency ? t.targetLatency.latency : -1,
304
304
  totalConnections: t.totalConnections,
@@ -311,25 +311,25 @@ class Agent extends events_1.default {
311
311
  canStartTunnel(tunnel) {
312
312
  if (this.disabled)
313
313
  return false;
314
- if (!this.proxy && !this.target && tunnel.type === tunnel_2.TUNNEL_TYPE.SSH)
314
+ if (!this.proxy && !this.target && tunnel.type === tunnel_1.TUNNEL_TYPE.SSH)
315
315
  return false;
316
- return !(!this.tunneling && tunnel.type !== tunnel_2.TUNNEL_TYPE.SSH);
316
+ return !(!this.tunneling && tunnel.type !== tunnel_1.TUNNEL_TYPE.SSH);
317
317
  }
318
318
  addTunnel(tunnel) {
319
319
  this.tunnels.push(tunnel);
320
320
  if (this.canStartTunnel(tunnel))
321
321
  tunnel.start();
322
- tunnel.on(tunnel_2.TUNNEL_EVENT.OPEN, () => this.update(true));
323
- tunnel.on(tunnel_2.TUNNEL_EVENT.CLOSED, () => this.update());
324
- tunnel.on(tunnel_2.TUNNEL_EVENT.TCP_OPEN, () => this.update());
325
- tunnel.on(tunnel_2.TUNNEL_EVENT.TCP_CLOSED, () => this.update());
326
- tunnel.on(tunnel_2.TUNNEL_EVENT.TLS_OPEN, () => this.update());
327
- tunnel.on(tunnel_2.TUNNEL_EVENT.TLS_CLOSED, () => this.update());
328
- tunnel.on(tunnel_2.TUNNEL_EVENT.HTTP_IDENTIFIED, () => this.update());
329
- tunnel.on(tunnel_2.TUNNEL_EVENT.HTTP_OPEN, () => this.update());
330
- tunnel.on(tunnel_2.TUNNEL_EVENT.HTTP_CLOSED, () => this.update());
331
- tunnel.on(tunnel_2.TUNNEL_EVENT.STOPPED, () => this.update());
332
- tunnel.on(tunnel_2.TUNNEL_EVENT.HTTP_REQUEST, (t, logRequest) => this.httpRequest(t.id, logRequest));
322
+ tunnel.on(tunnel_1.TUNNEL_EVENT.OPEN, () => this.update(true));
323
+ tunnel.on(tunnel_1.TUNNEL_EVENT.CLOSED, () => this.update());
324
+ tunnel.on(tunnel_1.TUNNEL_EVENT.TCP_OPEN, () => this.update());
325
+ tunnel.on(tunnel_1.TUNNEL_EVENT.TCP_CLOSED, () => this.update());
326
+ tunnel.on(tunnel_1.TUNNEL_EVENT.TLS_OPEN, () => this.update());
327
+ tunnel.on(tunnel_1.TUNNEL_EVENT.TLS_CLOSED, () => this.update());
328
+ tunnel.on(tunnel_1.TUNNEL_EVENT.HTTP_IDENTIFIED, () => this.update());
329
+ tunnel.on(tunnel_1.TUNNEL_EVENT.HTTP_OPEN, () => this.update());
330
+ tunnel.on(tunnel_1.TUNNEL_EVENT.HTTP_CLOSED, () => this.update());
331
+ tunnel.on(tunnel_1.TUNNEL_EVENT.STOPPED, () => this.update());
332
+ tunnel.on(tunnel_1.TUNNEL_EVENT.HTTP_REQUEST, (t, logRequest) => this.httpRequest(t.id, logRequest));
333
333
  }
334
334
  destroyTunnel(id) {
335
335
  const tunnel = this.tunnels.find((t) => t.id === id);
@@ -42,13 +42,13 @@ const commandPre = async (_, command) => {
42
42
  if (command.hideVersionUpdate) {
43
43
  return;
44
44
  }
45
- const newCli = command.currentVersion !== command.latestVersion;
46
- const newAgent = command.agentStatus &&
45
+ const newCli = !!command.latestVersion && command.currentVersion !== command.latestVersion;
46
+ const newAgent = !!command.agentStatus && !!command.latestVersion &&
47
47
  command.agentStatus.version !== command.latestVersion;
48
- if ((0, utils_1.isDocker)() && newCli) {
48
+ if ((0, utils_1.isDocker)() && newCli && command.latestVersion) {
49
49
  output_1.default.newCliDockerVersion(command.latestVersion);
50
50
  }
51
- else if (newCli) {
51
+ else if (newCli && command.latestVersion) {
52
52
  output_1.default.newCliVersion(command.latestVersion);
53
53
  }
54
54
  else if (newAgent) {
@@ -3,14 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const tunnel_1 = __importDefault(require("./tunnel/output/noninteractive/tunnel"));
7
- const tunnel_2 = __importDefault(require("./tunnel/output/noninteractive/config/tunnel"));
8
- const tunnels_1 = __importDefault(require("./tunnel/output/noninteractive/config/tunnels"));
9
6
  const texts_1 = require("./texts");
10
- const tunnels_2 = __importDefault(require("./tunnel/output/noninteractive/agent/tunnels"));
11
7
  const utils_1 = require("./utils");
12
8
  const chalk_1 = __importDefault(require("chalk"));
13
- const undici_1 = __importDefault(require("undici"));
14
9
  let _terminal = null;
15
10
  function getTerminal() {
16
11
  if (!_terminal) {
@@ -178,7 +173,8 @@ class Output {
178
173
  }
179
174
  }
180
175
  static agentTunnels(tunnels) {
181
- const on = new tunnels_2.default(getTerminal(), tunnels);
176
+ const OutputNoninteractiveAgentTunnels = require('./tunnel/output/noninteractive/agent/tunnels').default;
177
+ const on = new OutputNoninteractiveAgentTunnels(getTerminal(), tunnels);
182
178
  on.start(this);
183
179
  }
184
180
  static tunnelInteractive(tunnel) {
@@ -189,7 +185,8 @@ class Output {
189
185
  }
190
186
  static tunnelNonInteractive(tunnel) {
191
187
  this.killSpinner();
192
- const on = new tunnel_1.default(getTerminal(), tunnel);
188
+ const OutputNoninteractiveTunnel = require('./tunnel/output/noninteractive/tunnel').default;
189
+ const on = new OutputNoninteractiveTunnel(getTerminal(), tunnel);
193
190
  on.start();
194
191
  }
195
192
  static newCliVersion(version) {
@@ -241,11 +238,13 @@ class Output {
241
238
  });
242
239
  }
243
240
  static configTunnels(tunnels) {
244
- const on = new tunnels_1.default(getTerminal(), tunnels);
241
+ const OutputNoninteractiveConfigTunnels = require('./tunnel/output/noninteractive/config/tunnels').default;
242
+ const on = new OutputNoninteractiveConfigTunnels(getTerminal(), tunnels);
245
243
  on.start(this);
246
244
  }
247
245
  static configTunnel(tunnel) {
248
- const on = new tunnel_2.default(getTerminal(), tunnel);
246
+ const OutputNoninteractiveConfigTunnel = require('./tunnel/output/noninteractive/config/tunnel').default;
247
+ const on = new OutputNoninteractiveConfigTunnel(getTerminal(), tunnel);
249
248
  on.start(this);
250
249
  }
251
250
  static handleSignals() {
@@ -409,7 +408,8 @@ class Output {
409
408
  }
410
409
  static getUndiciUnauthorizedAgent() {
411
410
  if (!this._a) {
412
- this._a = new undici_1.default.Agent({
411
+ const undici = require('undici');
412
+ this._a = new undici.Agent({
413
413
  connect: {
414
414
  rejectUnauthorized: false,
415
415
  },
@@ -418,7 +418,8 @@ class Output {
418
418
  return this._a;
419
419
  }
420
420
  static clearUndici() {
421
- undici_1.default.getGlobalDispatcher().destroy(() => { });
421
+ const undici = require('undici');
422
+ undici.getGlobalDispatcher().destroy(() => { });
422
423
  if (this._a)
423
424
  this._a.destroy(() => { });
424
425
  }
@@ -1151,23 +1151,23 @@ EXAMPLES:
1151
1151
  exports.EXAMPLE_ARTIFACT_PUBLISH = `
1152
1152
  EXAMPLES:
1153
1153
  # publish new version of file artifact:
1154
- bdy art pub artifact-identifier@version /path/to/dir
1154
+ bdy art pub artifact-identifier:version /path/to/dir
1155
1155
 
1156
1156
  # create new file artifact:
1157
1157
  bdy art pub artifact-identifier --create
1158
1158
 
1159
1159
  # overwrite existing version:
1160
- bdy art pub artifact-identifier@version /path/to/dir -f`;
1160
+ bdy art pub artifact-identifier:version /path/to/dir -f`;
1161
1161
  exports.EXAMPLE_ARTIFACT_DOWNLOAD = `
1162
1162
  EXAMPLES:
1163
1163
  # download file artifact version to local directory:
1164
- bdy art dd artifact-identifier@version /path/to/dir
1164
+ bdy art dd artifact-identifier:version /path/to/dir
1165
1165
 
1166
1166
  # download latest file artifact version and replace contents of existing local directory:
1167
1167
  bdy art dd artifact-identifier /path/to/dir --replace
1168
1168
 
1169
1169
  # download file artifact version and merge it with existing local directory:
1170
- bdy art dd artifact-identifier@version /path/to/dir --merge`;
1170
+ bdy art dd artifact-identifier:version /path/to/dir --merge`;
1171
1171
  exports.EXAMPLE_ARTIFACT_DELETE = `
1172
1172
  EXAMPLES:
1173
1173
  # delete artifact:
@@ -5,9 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.TunnelHttpLogRequest = void 0;
7
7
  const events_1 = __importDefault(require("events"));
8
- const uuid_1 = require("uuid");
9
8
  const stream_1 = __importDefault(require("./stream"));
10
- const isbinaryfile_1 = require("isbinaryfile");
11
9
  const utils_1 = require("../../utils");
12
10
  const tunnel_1 = require("../../types/tunnel");
13
11
  class TunnelHttpLogRequest extends events_1.default {
@@ -32,7 +30,7 @@ class TunnelHttpLogRequest extends events_1.default {
32
30
  this.status = 'NEW';
33
31
  this.start = process.hrtime();
34
32
  this.finished = false;
35
- this.id = (0, uuid_1.v4)();
33
+ this.id = require('uuid').v4();
36
34
  this.requestBody = new stream_1.default(utils_1.TUNNEL_HTTP_LOG_MAX_BODY);
37
35
  this.requestBody.once('close', () => {
38
36
  this.emit(tunnel_1.TUNNEL_EVENT_HTTP.NEW_REQUEST_END);
@@ -62,7 +60,7 @@ class TunnelHttpLogRequest extends events_1.default {
62
60
  requestBodyLength = this.requestBody.realLength;
63
61
  requestBodyTooLarge =
64
62
  requestBodyLength >= utils_1.TUNNEL_MAX_REQUEST_SIZE_TO_SYNC;
65
- requestBodyBinary = (0, isbinaryfile_1.isBinaryFileSync)(this.requestBody.data);
63
+ requestBodyBinary = require('isbinaryfile').isBinaryFileSync(this.requestBody.data);
66
64
  if (!requestBodyTooLarge && !requestBodyBinary) {
67
65
  requestBody = this.requestBody.data.toString('base64');
68
66
  }
@@ -71,7 +69,7 @@ class TunnelHttpLogRequest extends events_1.default {
71
69
  responseBodyLength = this.responseBody.realLength;
72
70
  responseBodyTooLarge =
73
71
  requestBodyLength >= utils_1.TUNNEL_MAX_REQUEST_SIZE_TO_SYNC;
74
- responseBodyBinary = (0, isbinaryfile_1.isBinaryFileSync)(this.responseBody.data);
72
+ responseBodyBinary = require('isbinaryfile').isBinaryFileSync(this.responseBody.data);
75
73
  if (!responseBodyTooLarge && !responseBodyBinary) {
76
74
  responseBody = this.responseBody.data.toString('base64');
77
75
  }
@@ -3,24 +3,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const stream_1 = require("stream");
4
4
  class TunnelHttpStream extends stream_1.Transform {
5
5
  maxSize;
6
- data;
6
+ chunks;
7
+ chunksLength;
7
8
  realLength;
8
9
  tooLarge;
9
10
  constructor(maxSize) {
10
11
  super();
11
12
  this.maxSize = maxSize;
12
- this.data = Buffer.alloc(0);
13
+ this.chunks = [];
14
+ this.chunksLength = 0;
13
15
  this.realLength = 0;
14
16
  this.tooLarge = false;
15
17
  }
18
+ get data() {
19
+ if (this.chunks.length === 0)
20
+ return Buffer.alloc(0);
21
+ if (this.chunks.length === 1)
22
+ return this.chunks[0];
23
+ const buf = Buffer.concat(this.chunks, this.chunksLength);
24
+ this.chunks = [buf];
25
+ return buf;
26
+ }
16
27
  _transform(chunk, _, callback) {
17
28
  if (!this.tooLarge) {
18
- if (this.data.length + chunk.length > this.maxSize) {
29
+ if (this.chunksLength + chunk.length > this.maxSize) {
19
30
  this.tooLarge = true;
20
- this.data = Buffer.alloc(0);
31
+ this.chunks = [];
32
+ this.chunksLength = 0;
21
33
  }
22
34
  else {
23
- this.data = Buffer.concat([this.data, chunk]);
35
+ this.chunks.push(chunk);
36
+ this.chunksLength += chunk.length;
24
37
  }
25
38
  }
26
39
  this.realLength += chunk.length;
@@ -251,9 +251,21 @@ class ServerSsh extends events_1.default {
251
251
  session.on('close', () => closeSession());
252
252
  session.on('end', () => closeSession());
253
253
  session.on('eof', () => {
254
- // @ts-ignore fix for sftp channel not ending properly https://github.com/mscdex/ssh2/pull/1111
255
- if (session._channel)
256
- session._channel.end();
254
+ try {
255
+ // @ts-ignore fix for sftp channel not ending properly https://github.com/mscdex/ssh2/pull/1111
256
+ if (session._channel) {
257
+ // fix for sftp/scp exit status -1: send exit-status before EOF https://github.com/mscdex/ssh2/pull/1492
258
+ if (sftp) {
259
+ // @ts-ignore
260
+ session._channel.exit(0);
261
+ }
262
+ // @ts-ignore
263
+ session._channel.end();
264
+ }
265
+ }
266
+ catch {
267
+ // do nothing
268
+ }
257
269
  });
258
270
  session.on('pty', (accept, reject, info) => {
259
271
  logger_1.default.debug('ssh pty');
@@ -1,42 +1,8 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
36
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
4
  };
38
5
  Object.defineProperty(exports, "__esModule", { value: true });
39
- const basic_auth_1 = __importDefault(require("basic-auth"));
40
6
  const utils_1 = require("../utils");
41
7
  const latency_1 = __importDefault(require("./latency"));
42
8
  const events_1 = __importDefault(require("events"));
@@ -49,10 +15,6 @@ const http1_1 = __importDefault(require("./server/http1"));
49
15
  const log_1 = __importDefault(require("./http/log"));
50
16
  const format_1 = __importDefault(require("../format"));
51
17
  const node_crypto_1 = __importDefault(require("node:crypto"));
52
- const cookie = __importStar(require("cookie"));
53
- const uuid_1 = require("uuid");
54
- const jsonwebtoken_1 = require("jsonwebtoken");
55
- const undici_1 = require("undici");
56
18
  const texts_1 = require("../texts");
57
19
  const dns_1 = __importDefault(require("./dns"));
58
20
  const tunnel_1 = require("../types/tunnel");
@@ -669,7 +631,7 @@ class Tunnel extends events_1.default {
669
631
  }
670
632
  async httpBasicAuth(req, res) {
671
633
  if (this.authType === tunnel_1.TUNNEL_HTTP_AUTH_TYPE.BASIC) {
672
- const user = (0, basic_auth_1.default)(req);
634
+ const user = require('basic-auth')(req);
673
635
  if (user && user.name === this.login && user.pass === this.password) {
674
636
  return true;
675
637
  }
@@ -686,7 +648,7 @@ class Tunnel extends events_1.default {
686
648
  return true;
687
649
  }
688
650
  async _checkHttpPat(req, res, setCookie) {
689
- const user = (0, basic_auth_1.default)(req);
651
+ const user = require('basic-auth')(req);
690
652
  if (!user || !user.name || !user.pass)
691
653
  return false;
692
654
  const client = this._getHttpAuthClient();
@@ -722,7 +684,8 @@ class Tunnel extends events_1.default {
722
684
  _getHttpAuthClient() {
723
685
  const host = this.agent.host;
724
686
  if (!this.httpAuthClient[host]) {
725
- this.httpAuthClient[host] = new undici_1.Pool(host, {
687
+ const { Pool: UndiciPool } = require('undici');
688
+ this.httpAuthClient[host] = new UndiciPool(host, {
726
689
  connect: {
727
690
  rejectUnauthorized: false,
728
691
  },
@@ -761,7 +724,7 @@ class Tunnel extends events_1.default {
761
724
  reject(new Error(msg));
762
725
  return;
763
726
  }
764
- const data = (0, jsonwebtoken_1.decode)(token);
727
+ const data = require('jsonwebtoken').decode(token);
765
728
  if (!data || !data.iss) {
766
729
  reject(new Error(msg));
767
730
  return;
@@ -771,7 +734,7 @@ class Tunnel extends events_1.default {
771
734
  cert = ISSUERS[data.iss];
772
735
  else
773
736
  cert = ISSUERS['*'];
774
- (0, jsonwebtoken_1.verify)(token, cert, {
737
+ require('jsonwebtoken').verify(token, cert, {
775
738
  complete: true,
776
739
  issuer: data.iss,
777
740
  }, (err, data) => {
@@ -796,7 +759,7 @@ class Tunnel extends events_1.default {
796
759
  });
797
760
  }
798
761
  _httpSetAuthCookie(res, token) {
799
- res.setHeader('set-cookie', cookie.serialize(COOKIE_NAME, token, {
762
+ res.setHeader('set-cookie', require('cookie').serialize(COOKIE_NAME, token, {
800
763
  maxAge: 3600,
801
764
  path: '/',
802
765
  secure: true,
@@ -810,7 +773,7 @@ class Tunnel extends events_1.default {
810
773
  token = await this._httpExchangeAuthCode(code, verifier);
811
774
  }
812
775
  if (!token) {
813
- const cookies = cookie.parse(req.headers.cookie || '');
776
+ const cookies = require('cookie').parse(req.headers.cookie || '');
814
777
  token = cookies[COOKIE_NAME] || '';
815
778
  fromCookie = true;
816
779
  }
@@ -877,7 +840,7 @@ class Tunnel extends events_1.default {
877
840
  if (/^https:\/\/\d+\.\d+\.\d+\.\d+$/.test(host)) {
878
841
  host = 'https://app.local.io';
879
842
  }
880
- const verifier = (0, uuid_1.v4)();
843
+ const verifier = require('uuid').v4();
881
844
  const challenge = node_crypto_1.default
882
845
  .createHash('sha256')
883
846
  .update(verifier)
@@ -929,7 +892,7 @@ class Tunnel extends events_1.default {
929
892
  this.httpEndFast(req, res, 404, 'Not found');
930
893
  return false;
931
894
  }
932
- const auth = (0, basic_auth_1.default)(req);
895
+ const auth = require('basic-auth')(req);
933
896
  if (auth) {
934
897
  const authorized = await this._checkHttpPat(req, res, true);
935
898
  if (authorized) {
@@ -54,7 +54,6 @@ exports.getPopularTlds = getPopularTlds;
54
54
  exports.getAppHostByApiBaseUrl = getAppHostByApiBaseUrl;
55
55
  const node_path_1 = __importDefault(require("node:path"));
56
56
  const node_fs_1 = require("node:fs");
57
- const undici_1 = __importDefault(require("undici"));
58
57
  const texts_1 = require("./texts");
59
58
  const node_sea_1 = require("node:sea");
60
59
  const commander_1 = require("commander");
@@ -461,7 +460,7 @@ const getLatestVersion = async () => {
461
460
  setTimeout(() => {
462
461
  c.abort();
463
462
  }, 10000);
464
- const response = await undici_1.default.fetch(`https://es.buddy.works/bdy/${env}/latest`, {
463
+ const response = await require('undici').fetch(`https://es.buddy.works/bdy/${env}/latest`, {
465
464
  method: 'GET',
466
465
  signal: c.signal,
467
466
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.22.18-dev",
4
+ "version": "1.22.20-dev",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "scripts": {