pinggy 0.4.5 → 0.4.7

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/dist/index.d.cts CHANGED
@@ -589,15 +589,15 @@ interface TunnelResponseV2 {
589
589
  greetmsg?: string;
590
590
  }
591
591
  interface TunnelHandler {
592
- handleStart(config: TunnelConfig): Promise<TunnelResponse | ErrorResponse>;
593
- handleStartV2(config: TunnelConfigV1): Promise<TunnelResponseV2 | ErrorResponse>;
594
- handleUpdateConfig(config: TunnelConfig): Promise<TunnelResponse | ErrorResponse>;
595
- handleUpdateConfigV2(config: TunnelConfigV1): Promise<TunnelResponseV2 | ErrorResponse>;
592
+ handleStart(config: TunnelConfig, noWait?: boolean): Promise<TunnelResponse | ErrorResponse>;
593
+ handleStartV2(config: TunnelConfigV1, noWait?: boolean): Promise<TunnelResponseV2 | ErrorResponse>;
594
+ handleUpdateConfig(config: TunnelConfig, noWait?: boolean): Promise<TunnelResponse | ErrorResponse>;
595
+ handleUpdateConfigV2(config: TunnelConfigV1, noWait?: boolean): Promise<TunnelResponseV2 | ErrorResponse>;
596
596
  handleList(): Promise<TunnelResponse[] | ErrorResponse>;
597
597
  handleListV2(): Promise<TunnelResponseV2[] | ErrorResponse>;
598
598
  handleStop(tunnelid: string): Promise<TunnelResponse | ErrorResponse>;
599
599
  handleGet(tunnelid: string): Promise<TunnelResponse | ErrorResponse>;
600
- handleRestart(tunnelid: string): Promise<TunnelResponse | ErrorResponse>;
600
+ handleRestart(tunnelid: string, noWait?: boolean): Promise<TunnelResponse | ErrorResponse>;
601
601
  handleRegisterStatsListener(tunnelid: string, listener: (tunnelId: string, stats: TunnelUsageType) => void): void;
602
602
  handleUnregisterStatsListener(tunnelid: string, listnerId: string): void;
603
603
  handleGetTunnelStats(tunnelid: string): TunnelUsageType[] | ErrorResponse;
@@ -609,18 +609,20 @@ declare class TunnelOperations implements TunnelHandler {
609
609
  private tunnelManager;
610
610
  constructor();
611
611
  private buildStatus;
612
+ private buildPendingTunnelResponse;
613
+ private buildPendingTunnelResponseV2;
612
614
  private buildTunnelResponse;
613
615
  private buildTunnelResponseV2;
614
616
  private error;
615
- handleStart(config: TunnelConfig): Promise<TunnelResponse | ErrorResponse>;
616
- handleStartV2(config: TunnelConfigV1): Promise<TunnelResponseV2 | ErrorResponse>;
617
- handleUpdateConfig(config: TunnelConfig): Promise<TunnelResponse | ErrorResponse>;
618
- handleUpdateConfigV2(config: TunnelConfigV1): Promise<TunnelResponseV2 | ErrorResponse>;
617
+ handleStart(config: TunnelConfig, noWait?: boolean): Promise<TunnelResponse | ErrorResponse>;
618
+ handleStartV2(config: TunnelConfigV1, noWait?: boolean): Promise<TunnelResponseV2 | ErrorResponse>;
619
+ handleUpdateConfig(config: TunnelConfig, noWait?: boolean): Promise<TunnelResponse | ErrorResponse>;
620
+ handleUpdateConfigV2(config: TunnelConfigV1, noWait?: boolean): Promise<TunnelResponseV2 | ErrorResponse>;
619
621
  handleListV2(): Promise<TunnelResponseV2[] | ErrorResponse>;
620
622
  handleList(): Promise<TunnelResponse[] | ErrorResponse>;
621
623
  handleStop(tunnelid: string): Promise<TunnelResponse | ErrorResponse>;
622
624
  handleGet(tunnelid: string): Promise<TunnelResponse | ErrorResponse>;
623
- handleRestart(tunnelid: string): Promise<TunnelResponse | ErrorResponse>;
625
+ handleRestart(tunnelid: string, noWait?: boolean): Promise<TunnelResponse | ErrorResponse>;
624
626
  handleRegisterStatsListener(tunnelid: string, listener: (tunnelId: string, stats: TunnelUsageType) => void): void;
625
627
  handleUnregisterStatsListener(tunnelid: string, listnerId: string): void;
626
628
  handleGetTunnelStats(tunnelid: string): TunnelUsageType[] | ErrorResponse;
@@ -640,6 +642,9 @@ interface BaseLogConfig {
640
642
  type BaseLogConfigType = BaseLogConfig;
641
643
  declare function enablePackageLogging(opts?: BaseLogConfigType): winston.Logger;
642
644
 
645
+ declare class RemoteManagementUnauthorizedError extends Error {
646
+ constructor();
647
+ }
643
648
  /**
644
649
  * Initiate remote management mode with a WebSocket connection.
645
650
  * - Connect with Authorization: Bearer <token>
@@ -649,6 +654,10 @@ declare function enablePackageLogging(opts?: BaseLogConfigType): winston.Logger;
649
654
  */
650
655
  declare function initiateRemoteManagement(remoteManagementConfig: RemoteManagementConfig): Promise<RemoteManagementState>;
651
656
  declare function closeRemoteManagement(timeoutMs?: number): Promise<RemoteManagementState>;
657
+ /**
658
+ * Start remote management loop in background; returns after first connection attempt.
659
+ */
660
+ declare function startRemoteManagement(remoteManagementConfig: RemoteManagementConfig): Promise<RemoteManagementState>;
652
661
  declare function getRemoteManagementState(): RemoteManagementState;
653
662
 
654
- export { type AdditionalForwarding, type DisconnectListener, type ErrorListener, type FinalConfig, type ITunnelManager, type ManagedTunnel, type ReconnectingListener, type ReconnectionCompletedListener, type ReconnectionFailedListener, type StartListener, type StatsListener, type Status, TunnelErrorCodeType, type TunnelList, TunnelManager, TunnelOperations, type TunnelResponse, TunnelStateType, type TunnelStatus, TunnelWarningCode, type TunnelWorkerErrorListner, type Warning, type WillReconnectListener, closeRemoteManagement, enablePackageLogging, getRemoteManagementState, initiateRemoteManagement };
663
+ export { type AdditionalForwarding, type DisconnectListener, type ErrorListener, type FinalConfig, type ITunnelManager, type ManagedTunnel, type ReconnectingListener, type ReconnectionCompletedListener, type ReconnectionFailedListener, RemoteManagementUnauthorizedError, type StartListener, type StatsListener, type Status, TunnelErrorCodeType, type TunnelList, TunnelManager, TunnelOperations, type TunnelResponse, TunnelStateType, type TunnelStatus, TunnelWarningCode, type TunnelWorkerErrorListner, type Warning, type WillReconnectListener, closeRemoteManagement, enablePackageLogging, getRemoteManagementState, initiateRemoteManagement, startRemoteManagement };
package/dist/index.d.ts CHANGED
@@ -589,15 +589,15 @@ interface TunnelResponseV2 {
589
589
  greetmsg?: string;
590
590
  }
591
591
  interface TunnelHandler {
592
- handleStart(config: TunnelConfig): Promise<TunnelResponse | ErrorResponse>;
593
- handleStartV2(config: TunnelConfigV1): Promise<TunnelResponseV2 | ErrorResponse>;
594
- handleUpdateConfig(config: TunnelConfig): Promise<TunnelResponse | ErrorResponse>;
595
- handleUpdateConfigV2(config: TunnelConfigV1): Promise<TunnelResponseV2 | ErrorResponse>;
592
+ handleStart(config: TunnelConfig, noWait?: boolean): Promise<TunnelResponse | ErrorResponse>;
593
+ handleStartV2(config: TunnelConfigV1, noWait?: boolean): Promise<TunnelResponseV2 | ErrorResponse>;
594
+ handleUpdateConfig(config: TunnelConfig, noWait?: boolean): Promise<TunnelResponse | ErrorResponse>;
595
+ handleUpdateConfigV2(config: TunnelConfigV1, noWait?: boolean): Promise<TunnelResponseV2 | ErrorResponse>;
596
596
  handleList(): Promise<TunnelResponse[] | ErrorResponse>;
597
597
  handleListV2(): Promise<TunnelResponseV2[] | ErrorResponse>;
598
598
  handleStop(tunnelid: string): Promise<TunnelResponse | ErrorResponse>;
599
599
  handleGet(tunnelid: string): Promise<TunnelResponse | ErrorResponse>;
600
- handleRestart(tunnelid: string): Promise<TunnelResponse | ErrorResponse>;
600
+ handleRestart(tunnelid: string, noWait?: boolean): Promise<TunnelResponse | ErrorResponse>;
601
601
  handleRegisterStatsListener(tunnelid: string, listener: (tunnelId: string, stats: TunnelUsageType) => void): void;
602
602
  handleUnregisterStatsListener(tunnelid: string, listnerId: string): void;
603
603
  handleGetTunnelStats(tunnelid: string): TunnelUsageType[] | ErrorResponse;
@@ -609,18 +609,20 @@ declare class TunnelOperations implements TunnelHandler {
609
609
  private tunnelManager;
610
610
  constructor();
611
611
  private buildStatus;
612
+ private buildPendingTunnelResponse;
613
+ private buildPendingTunnelResponseV2;
612
614
  private buildTunnelResponse;
613
615
  private buildTunnelResponseV2;
614
616
  private error;
615
- handleStart(config: TunnelConfig): Promise<TunnelResponse | ErrorResponse>;
616
- handleStartV2(config: TunnelConfigV1): Promise<TunnelResponseV2 | ErrorResponse>;
617
- handleUpdateConfig(config: TunnelConfig): Promise<TunnelResponse | ErrorResponse>;
618
- handleUpdateConfigV2(config: TunnelConfigV1): Promise<TunnelResponseV2 | ErrorResponse>;
617
+ handleStart(config: TunnelConfig, noWait?: boolean): Promise<TunnelResponse | ErrorResponse>;
618
+ handleStartV2(config: TunnelConfigV1, noWait?: boolean): Promise<TunnelResponseV2 | ErrorResponse>;
619
+ handleUpdateConfig(config: TunnelConfig, noWait?: boolean): Promise<TunnelResponse | ErrorResponse>;
620
+ handleUpdateConfigV2(config: TunnelConfigV1, noWait?: boolean): Promise<TunnelResponseV2 | ErrorResponse>;
619
621
  handleListV2(): Promise<TunnelResponseV2[] | ErrorResponse>;
620
622
  handleList(): Promise<TunnelResponse[] | ErrorResponse>;
621
623
  handleStop(tunnelid: string): Promise<TunnelResponse | ErrorResponse>;
622
624
  handleGet(tunnelid: string): Promise<TunnelResponse | ErrorResponse>;
623
- handleRestart(tunnelid: string): Promise<TunnelResponse | ErrorResponse>;
625
+ handleRestart(tunnelid: string, noWait?: boolean): Promise<TunnelResponse | ErrorResponse>;
624
626
  handleRegisterStatsListener(tunnelid: string, listener: (tunnelId: string, stats: TunnelUsageType) => void): void;
625
627
  handleUnregisterStatsListener(tunnelid: string, listnerId: string): void;
626
628
  handleGetTunnelStats(tunnelid: string): TunnelUsageType[] | ErrorResponse;
@@ -640,6 +642,9 @@ interface BaseLogConfig {
640
642
  type BaseLogConfigType = BaseLogConfig;
641
643
  declare function enablePackageLogging(opts?: BaseLogConfigType): winston.Logger;
642
644
 
645
+ declare class RemoteManagementUnauthorizedError extends Error {
646
+ constructor();
647
+ }
643
648
  /**
644
649
  * Initiate remote management mode with a WebSocket connection.
645
650
  * - Connect with Authorization: Bearer <token>
@@ -649,6 +654,10 @@ declare function enablePackageLogging(opts?: BaseLogConfigType): winston.Logger;
649
654
  */
650
655
  declare function initiateRemoteManagement(remoteManagementConfig: RemoteManagementConfig): Promise<RemoteManagementState>;
651
656
  declare function closeRemoteManagement(timeoutMs?: number): Promise<RemoteManagementState>;
657
+ /**
658
+ * Start remote management loop in background; returns after first connection attempt.
659
+ */
660
+ declare function startRemoteManagement(remoteManagementConfig: RemoteManagementConfig): Promise<RemoteManagementState>;
652
661
  declare function getRemoteManagementState(): RemoteManagementState;
653
662
 
654
- export { type AdditionalForwarding, type DisconnectListener, type ErrorListener, type FinalConfig, type ITunnelManager, type ManagedTunnel, type ReconnectingListener, type ReconnectionCompletedListener, type ReconnectionFailedListener, type StartListener, type StatsListener, type Status, TunnelErrorCodeType, type TunnelList, TunnelManager, TunnelOperations, type TunnelResponse, TunnelStateType, type TunnelStatus, TunnelWarningCode, type TunnelWorkerErrorListner, type Warning, type WillReconnectListener, closeRemoteManagement, enablePackageLogging, getRemoteManagementState, initiateRemoteManagement };
663
+ export { type AdditionalForwarding, type DisconnectListener, type ErrorListener, type FinalConfig, type ITunnelManager, type ManagedTunnel, type ReconnectingListener, type ReconnectionCompletedListener, type ReconnectionFailedListener, RemoteManagementUnauthorizedError, type StartListener, type StatsListener, type Status, TunnelErrorCodeType, type TunnelList, TunnelManager, TunnelOperations, type TunnelResponse, TunnelStateType, type TunnelStatus, TunnelWarningCode, type TunnelWorkerErrorListner, type Warning, type WillReconnectListener, closeRemoteManagement, enablePackageLogging, getRemoteManagementState, initiateRemoteManagement, startRemoteManagement };
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
+ RemoteManagementUnauthorizedError,
3
4
  TunnelErrorCodeType,
4
5
  TunnelManager,
5
6
  TunnelOperations,
@@ -8,11 +9,12 @@ import {
8
9
  closeRemoteManagement,
9
10
  getRemoteManagementState,
10
11
  initiateRemoteManagement,
11
- printer_default
12
- } from "./chunk-MBN3YBO4.js";
12
+ printer_default,
13
+ startRemoteManagement
14
+ } from "./chunk-443UO6IY.js";
13
15
  import {
14
16
  enablePackageLogging
15
- } from "./chunk-HUN2MRZO.js";
17
+ } from "./chunk-3RTRUYNW.js";
16
18
 
17
19
  // src/utils/detect_vc_redist_on_windows.ts
18
20
  import fs from "fs";
@@ -104,13 +106,13 @@ async function verifyAndLoad() {
104
106
  process.exit(1);
105
107
  }
106
108
  }
107
- await import("./main-2RDHMQT7.js");
109
+ await import("./main-PUM4SD6B.js");
108
110
  }
109
111
  verifyAndLoad().catch((err) => {
110
- printer_default.error(`Failed to start CLI:, ${err}`);
111
- process.exit(1);
112
+ printer_default.fatal(`Failed to start CLI:, ${err}`);
112
113
  });
113
114
  export {
115
+ RemoteManagementUnauthorizedError,
114
116
  TunnelErrorCodeType,
115
117
  TunnelManager,
116
118
  TunnelOperations,
@@ -119,5 +121,6 @@ export {
119
121
  closeRemoteManagement,
120
122
  enablePackageLogging,
121
123
  getRemoteManagementState,
122
- initiateRemoteManagement
124
+ initiateRemoteManagement,
125
+ startRemoteManagement
123
126
  };