pinggy 0.3.3 → 0.3.5

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.ts CHANGED
@@ -1,552 +1 @@
1
1
  #!/usr/bin/env node
2
- import { PinggyOptions, TunnelInstance, TunnelUsageType, TunnelType } from '@pinggy/pinggy';
3
- import { Worker } from 'node:worker_threads';
4
- import { z } from 'zod';
5
- import winston from 'winston';
6
-
7
- interface AdditionalForwarding {
8
- localDomain: string;
9
- localPort: number;
10
- remoteDomain?: string;
11
- remotePort?: number;
12
- protocol?: 'http' | 'tcp' | 'udp' | 'tls';
13
- }
14
- declare enum TunnelStateType {
15
- New = "idle",
16
- Starting = "starting",
17
- Running = "running",
18
- Live = "live",
19
- Closed = "closed",
20
- Exited = "exited"
21
- }
22
- declare enum TunnelErrorCodeType {
23
- NonResponsive = "non_responsive",
24
- FailedToConnect = "failed_to_connect",
25
- ErrorInAdditionalForwarding = "additional_forwarding_error",
26
- WebdebuggerError = "webdebugger_error",
27
- NoError = ""
28
- }
29
- declare enum TunnelWarningCode {
30
- InvalidTunnelServePath = "INVALID_TUNNEL_SERVE_PATH",
31
- UnknownWarning = "UNKNOWN_WARNING"
32
- }
33
- interface Warning {
34
- code: TunnelWarningCode;
35
- message: string;
36
- }
37
- interface Status {
38
- state: TunnelStateType;
39
- errorcode: TunnelErrorCodeType;
40
- errormsg: string;
41
- createdtimestamp: string;
42
- starttimestamp: string;
43
- endtimestamp: string;
44
- warnings: Warning[];
45
- }
46
- type ErrorCodeType = "INVALID_REQUEST_METHOD" | "COULD_NOT_READ_BODY" | "INTERNAL_SERVER_ERROR" | "INVALID_DATA_FORMAT" | "ERROR_STARTING_TUNNEL" | "TUNNEL_WITH_ID_OR_CONFIG_ID_NOT_FOUND" | "TUNNEL_WITH_ID_OR_CONFIG_ID_ALREADY_RUNNING" | "WEBSOCKET_UPGRADE_FAILED" | "REMOTE_MANAGEMENT_ALREADY_RUNNING" | "REMOTE_MANAGEMENT_NOT_RUNNING" | "REMOTE_MANAGEMENT_DESERIALIZATION_FAILED";
47
- interface ErrorResponse {
48
- code: ErrorCodeType;
49
- message: string;
50
- }
51
- type RemoteManagementStatusType = "CONNECTING" | "DISCONNECTING" | "RECONNECTING" | "RUNNING" | "NOT_RUNNING" | "ERROR";
52
- interface RemoteManagementState {
53
- status: RemoteManagementStatusType;
54
- errorMessage: string;
55
- }
56
-
57
- /**
58
- * Manages the lifecycle and state of multiple tunnel instances.
59
- * Implements the Singleton pattern to ensure only one tunnel manager exists in the application.
60
- *
61
- * @remarks
62
- * This class provides comprehensive tunnel management capabilities including:
63
- * - Creation and initialization of tunnels
64
- * - Starting and stopping tunnels
65
- * - Managing tunnel configurations and states
66
- * - Handling additional forwarding rules
67
- * - Monitoring tunnel status
68
- *
69
- * @sealed
70
- * @singleton
71
- */
72
-
73
- interface ManagedTunnel {
74
- tunnelid: string;
75
- configid: string;
76
- tunnelName?: string;
77
- instance: TunnelInstance;
78
- tunnelConfig?: PinggyOptions;
79
- configWithForwarding?: PinggyOptions;
80
- additionalForwarding?: AdditionalForwarding[];
81
- serveWorker?: Worker | null;
82
- warnings?: Warning[];
83
- serve?: string;
84
- isStopped?: boolean;
85
- createdAt?: string;
86
- startedAt?: string | null;
87
- stoppedAt?: string | null;
88
- autoReconnect?: boolean;
89
- }
90
- interface TunnelList {
91
- tunnelid: string;
92
- configid: string;
93
- tunnelName?: string;
94
- tunnelConfig: PinggyOptions;
95
- remoteurls: string[];
96
- additionalForwarding?: AdditionalForwarding[];
97
- serve?: string;
98
- }
99
- type StatsListener = (tunnelId: string, stats: TunnelUsageType) => void;
100
- type ErrorListener = (tunnelId: string, errorMsg: string, isFatal: boolean) => void;
101
- type DisconnectListener = (tunnelId: string, error: string, messages: string[]) => void;
102
- type TunnelWorkerErrorListner = (tunnelid: string, error: Error) => void;
103
- type StartListener = (tunnelId: string, urls: string[]) => void;
104
- interface ITunnelManager {
105
- createTunnel(config: (PinggyOptions & {
106
- configid: string;
107
- tunnelid?: string;
108
- tunnelName?: string;
109
- }) & {
110
- additionalForwarding?: AdditionalForwarding[];
111
- }): Promise<ManagedTunnel>;
112
- startTunnel(tunnelId: string): Promise<string[]>;
113
- stopTunnel(tunnelId: string): {
114
- configid: string;
115
- tunnelid: string;
116
- };
117
- stopAllTunnels(): void;
118
- getTunnelUrls(tunnelId: string): Promise<string[]>;
119
- getAllTunnels(): Promise<TunnelList[]>;
120
- getTunnelStatus(tunnelId: string): Promise<string>;
121
- getTunnelInstance(configId?: string, tunnelId?: string): TunnelInstance;
122
- getTunnelConfig(configId?: string, tunnelId?: string): Promise<PinggyOptions>;
123
- restartTunnel(tunnelId: string): Promise<void>;
124
- updateConfig(newConfig: PinggyOptions & {
125
- configid: string;
126
- additionalForwarding?: AdditionalForwarding[];
127
- tunnelName?: string;
128
- }): Promise<ManagedTunnel>;
129
- getManagedTunnel(configId?: string, tunnelId?: string): ManagedTunnel;
130
- getTunnelGreetMessage(tunnelId: string): Promise<string | null>;
131
- getTunnelStats(tunnelId: string): TunnelUsageType[] | null;
132
- getLatestTunnelStats(tunnelId: string): TunnelUsageType | null;
133
- registerStatsListener(tunnelId: string, listener: StatsListener): Promise<[string, string]>;
134
- registerErrorListener(tunnelId: string, listener: ErrorListener): Promise<string>;
135
- registerWorkerErrorListner(tunnelId: string, listener: TunnelWorkerErrorListner): void;
136
- registerStartListener(tunnelId: string, listener: StartListener): Promise<string>;
137
- deregisterErrorListener(tunnelId: string, listenerId: string): void;
138
- registerDisconnectListener(tunnelId: string, listener: DisconnectListener): Promise<string>;
139
- deregisterDisconnectListener(tunnelId: string, listenerId: string): void;
140
- deregisterStatsListener(tunnelId: string, listenerId: string): void;
141
- getLocalserverTlsInfo(tunnelId: string): Promise<string | boolean>;
142
- removeStoppedTunnelByTunnelId(tunnelId: string): boolean;
143
- removeStoppedTunnelByConfigId(configId: string): boolean;
144
- }
145
- declare class TunnelManager implements ITunnelManager {
146
- private static instance;
147
- private tunnelsByTunnelId;
148
- private tunnelsByConfigId;
149
- private tunnelStats;
150
- private tunnelStatsListeners;
151
- private tunnelErrorListeners;
152
- private tunnelDisconnectListeners;
153
- private tunnelWorkerErrorListeners;
154
- private tunnelStartListeners;
155
- private constructor();
156
- static getInstance(): TunnelManager;
157
- /**
158
- * Creates a new managed tunnel instance with the given configuration.
159
- * Builds the config with forwarding rules and creates the tunnel instance.
160
- *
161
- * @param config - The tunnel configuration options
162
- * @param config.configid - Unique identifier for the tunnel configuration
163
- * @param config.tunnelid - Optional custom tunnel identifier. If not provided, a random UUID will be generated
164
- * @param config.additionalForwarding - Optional array of additional forwarding configurations
165
- *
166
- * @throws {Error} When configId is invalid or empty
167
- * @throws {Error} When a tunnel with the given configId already exists
168
- *
169
- * @returns {ManagedTunnel} A new managed tunnel instance containing the tunnel details,
170
- * status information, and statistics
171
- */
172
- createTunnel(config: (PinggyOptions & {
173
- tunnelType: string[] | undefined;
174
- } & {
175
- configid: string;
176
- tunnelid?: string;
177
- tunnelName?: string;
178
- }) & {
179
- additionalForwarding?: AdditionalForwarding[];
180
- } & {
181
- serve?: string;
182
- }): Promise<ManagedTunnel>;
183
- /**
184
- * Internal method to create a tunnel with an already-processed configuration.
185
- * This is used by createTunnel, restartTunnel, and updateConfig to avoid config processing.
186
- *
187
- * @param params - Configuration parameters with already-processed forwarding rules
188
- * @returns The created ManagedTunnel instance
189
- * @private
190
- */
191
- private _createTunnelWithProcessedConfig;
192
- /**
193
- * Builds the Pinggy configuration by merging the default forwarding rule
194
- * with additional forwarding rules from additionalForwarding array.
195
- *
196
- * @param config - The base Pinggy configuration
197
- * @param additionalForwarding - Optional array of additional forwarding rules
198
- * @returns Modified PinggyOptions
199
- */
200
- private buildPinggyConfig;
201
- /**
202
- * Start a tunnel that was created but not yet started
203
- */
204
- startTunnel(tunnelId: string): Promise<string[]>;
205
- /**
206
- * Stops a running tunnel and updates its status.
207
- *
208
- * @param tunnelId - The unique identifier of the tunnel to stop
209
- * @throws {Error} If the tunnel with the given tunnelId is not found
210
- * @remarks
211
- * - Clears the tunnel's remote URLs
212
- * - Updates the tunnel's state to Exited if stopped successfully
213
- * - Logs the stop operation with tunnelId and configId
214
- */
215
- stopTunnel(tunnelId: string): {
216
- configid: string;
217
- tunnelid: string;
218
- };
219
- /**
220
- * Get all public URLs for a tunnel
221
- */
222
- getTunnelUrls(tunnelId: string): Promise<string[]>;
223
- /**
224
- * Get all TunnelStatus currently managed by this TunnelManager
225
- * @returns An array of all TunnelStatus objects
226
- */
227
- getAllTunnels(): Promise<TunnelList[]>;
228
- /**
229
- * Get status of a tunnel
230
- */
231
- getTunnelStatus(tunnelId: string): Promise<string>;
232
- /**
233
- * Stop all tunnels
234
- */
235
- stopAllTunnels(): void;
236
- /**
237
- * Remove a stopped tunnel's records so it will no longer be returned by list methods.
238
- *
239
- *
240
- * @param tunnelId - the tunnel id to remove
241
- * @returns true if the record was removed, false otherwise
242
- */
243
- removeStoppedTunnelByTunnelId(tunnelId: string): boolean;
244
- /**
245
- * Remove a stopped tunnel by its config id.
246
- * @param configId - the config id to remove
247
- * @returns true if the record was removed, false otherwise
248
- */
249
- removeStoppedTunnelByConfigId(configId: string): boolean;
250
- private _cleanupTunnelRecords;
251
- /**
252
- * Get tunnel instance by either configId or tunnelId
253
- * @param configId - The configuration ID of the tunnel
254
- * @param tunnelId - The tunnel ID
255
- * @returns The tunnel instance
256
- * @throws Error if neither configId nor tunnelId is provided, or if tunnel is not found
257
- */
258
- getTunnelInstance(configId?: string, tunnelId?: string): TunnelInstance;
259
- /**
260
- * Get tunnel config by either configId or tunnelId
261
- * @param configId - The configuration ID of the tunnel
262
- * @param tunnelId - The tunnel ID
263
- * @returns The tunnel config
264
- * @throws Error if neither configId nor tunnelId is provided, or if tunnel is not found
265
- */
266
- getTunnelConfig(configId?: string, tunnelId?: string): Promise<PinggyOptions>;
267
- /**
268
- * Restarts a tunnel with its current configuration.
269
- * This function will stop the tunnel if it's running and start it again.
270
- * All configurations including additional forwarding rules are preserved.
271
- */
272
- restartTunnel(tunnelid: string): Promise<void>;
273
- /**
274
- * Updates the configuration of an existing tunnel.
275
- *
276
- * This method handles the process of updating a tunnel's configuration while preserving
277
- * its state. If the tunnel is running, it will be stopped, updated, and restarted.
278
- * In case of failure, it attempts to restore the original configuration.
279
- *
280
- * @param newConfig - The new configuration to apply, including configid and optional additional forwarding
281
- *
282
- * @returns Promise resolving to the updated ManagedTunnel
283
- * @throws Error if the tunnel is not found or if the update process fails
284
- */
285
- updateConfig(newConfig: PinggyOptions & {
286
- tunnelType: string[] | undefined;
287
- } & {
288
- configid: string;
289
- additionalForwarding?: AdditionalForwarding[];
290
- tunnelName?: string;
291
- serve?: string;
292
- }): Promise<ManagedTunnel>;
293
- /**
294
- * Retrieve the ManagedTunnel object by either configId or tunnelId.
295
- * Throws an error if neither id is provided or the tunnel is not found.
296
- */
297
- getManagedTunnel(configId?: string, tunnelId?: string): ManagedTunnel;
298
- getTunnelGreetMessage(tunnelId: string): Promise<string | null>;
299
- getTunnelStats(tunnelId: string): TunnelUsageType[] | null;
300
- getLatestTunnelStats(tunnelId: string): TunnelUsageType | null;
301
- /**
302
- * Registers a listener function to receive tunnel statistics updates.
303
- * The listener will be called whenever any tunnel's stats are updated.
304
- *
305
- * @param tunnelId - The tunnel ID to listen to stats for
306
- * @param listener - Function that receives tunnelId and stats when updates occur
307
- * @returns A unique listener ID that can be used to deregister the listener and tunnelId
308
- *
309
- * @throws {Error} When the specified tunnelId does not exist
310
- */
311
- registerStatsListener(tunnelId: string, listener: StatsListener): Promise<[string, string]>;
312
- registerErrorListener(tunnelId: string, listener: ErrorListener): Promise<string>;
313
- registerDisconnectListener(tunnelId: string, listener: DisconnectListener): Promise<string>;
314
- registerWorkerErrorListner(tunnelId: string, listener: TunnelWorkerErrorListner): Promise<void>;
315
- registerStartListener(tunnelId: string, listener: StartListener): Promise<string>;
316
- /**
317
- * Removes a previously registered stats listener.
318
- *
319
- * @param tunnelId - The tunnel ID the listener was registered for
320
- * @param listenerId - The unique ID returned when the listener was registered
321
- */
322
- deregisterStatsListener(tunnelId: string, listenerId: string): void;
323
- deregisterErrorListener(tunnelId: string, listenerId: string): void;
324
- deregisterDisconnectListener(tunnelId: string, listenerId: string): void;
325
- getLocalserverTlsInfo(tunnelId: string): Promise<string | false>;
326
- /**
327
- * Sets up the stats callback for a tunnel during creation.
328
- * This callback will update stored stats and notify all registered listeners.
329
- */
330
- private setupStatsCallback;
331
- private notifyErrorListeners;
332
- private setupErrorCallback;
333
- private setupDisconnectCallback;
334
- private setUpTunnelWorkerErrorCallback;
335
- /**
336
- * Updates the stored stats for a tunnel and notifies all registered listeners.
337
- */
338
- private updateStats;
339
- /**
340
- * Normalizes raw usage data from the SDK into a consistent TunnelStats format.
341
- */
342
- private normalizeStats;
343
- private parseNumber;
344
- private startStaticFileServer;
345
- }
346
-
347
- declare const TunnelConfigSchema: z.ZodPipe<z.ZodObject<{
348
- allowPreflight: z.ZodOptional<z.ZodBoolean>;
349
- allowpreflight: z.ZodOptional<z.ZodBoolean>;
350
- autoreconnect: z.ZodBoolean;
351
- basicauth: z.ZodNullable<z.ZodArray<z.ZodObject<{
352
- username: z.ZodString;
353
- password: z.ZodString;
354
- }, z.core.$strip>>>;
355
- bearerauth: z.ZodNullable<z.ZodString>;
356
- configid: z.ZodString;
357
- configname: z.ZodString;
358
- greetmsg: z.ZodOptional<z.ZodString>;
359
- force: z.ZodBoolean;
360
- forwardedhost: z.ZodString;
361
- fullRequestUrl: z.ZodBoolean;
362
- headermodification: z.ZodArray<z.ZodObject<{
363
- key: z.ZodString;
364
- value: z.ZodOptional<z.ZodArray<z.ZodString>>;
365
- type: z.ZodEnum<{
366
- add: "add";
367
- remove: "remove";
368
- update: "update";
369
- }>;
370
- }, z.core.$strip>>;
371
- httpsOnly: z.ZodBoolean;
372
- internalwebdebuggerport: z.ZodNumber;
373
- ipwhitelist: z.ZodNullable<z.ZodArray<z.ZodString>>;
374
- localport: z.ZodNumber;
375
- localsservertls: z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>;
376
- localservertlssni: z.ZodNullable<z.ZodString>;
377
- regioncode: z.ZodString;
378
- noReverseProxy: z.ZodBoolean;
379
- serveraddress: z.ZodString;
380
- serverport: z.ZodNumber;
381
- statusCheckInterval: z.ZodNumber;
382
- token: z.ZodString;
383
- tunnelTimeout: z.ZodNumber;
384
- type: z.ZodEnum<{
385
- http: TunnelType.Http;
386
- tcp: TunnelType.Tcp;
387
- tls: TunnelType.Tls;
388
- udp: TunnelType.Udp;
389
- tlstcp: TunnelType.TlsTcp;
390
- }>;
391
- webdebuggerport: z.ZodNumber;
392
- xff: z.ZodString;
393
- additionalForwarding: z.ZodOptional<z.ZodArray<z.ZodObject<{
394
- remoteDomain: z.ZodOptional<z.ZodString>;
395
- remotePort: z.ZodOptional<z.ZodNumber>;
396
- localDomain: z.ZodString;
397
- localPort: z.ZodNumber;
398
- }, z.core.$strip>>>;
399
- serve: z.ZodOptional<z.ZodString>;
400
- }, z.core.$strip>, z.ZodTransform<{
401
- allowPreflight: boolean | undefined;
402
- allowpreflight: boolean | undefined;
403
- autoreconnect: boolean;
404
- basicauth: {
405
- username: string;
406
- password: string;
407
- }[] | null;
408
- bearerauth: string | null;
409
- configid: string;
410
- configname: string;
411
- force: boolean;
412
- forwardedhost: string;
413
- fullRequestUrl: boolean;
414
- headermodification: {
415
- key: string;
416
- type: "add" | "remove" | "update";
417
- value?: string[] | undefined;
418
- }[];
419
- httpsOnly: boolean;
420
- internalwebdebuggerport: number;
421
- ipwhitelist: string[] | null;
422
- localport: number;
423
- localsservertls: string | boolean;
424
- localservertlssni: string | null;
425
- regioncode: string;
426
- noReverseProxy: boolean;
427
- serveraddress: string;
428
- serverport: number;
429
- statusCheckInterval: number;
430
- token: string;
431
- tunnelTimeout: number;
432
- type: TunnelType;
433
- webdebuggerport: number;
434
- xff: string;
435
- greetmsg?: string | undefined;
436
- additionalForwarding?: {
437
- localDomain: string;
438
- localPort: number;
439
- remoteDomain?: string | undefined;
440
- remotePort?: number | undefined;
441
- }[] | undefined;
442
- serve?: string | undefined;
443
- }, {
444
- autoreconnect: boolean;
445
- basicauth: {
446
- username: string;
447
- password: string;
448
- }[] | null;
449
- bearerauth: string | null;
450
- configid: string;
451
- configname: string;
452
- force: boolean;
453
- forwardedhost: string;
454
- fullRequestUrl: boolean;
455
- headermodification: {
456
- key: string;
457
- type: "add" | "remove" | "update";
458
- value?: string[] | undefined;
459
- }[];
460
- httpsOnly: boolean;
461
- internalwebdebuggerport: number;
462
- ipwhitelist: string[] | null;
463
- localport: number;
464
- localsservertls: string | boolean;
465
- localservertlssni: string | null;
466
- regioncode: string;
467
- noReverseProxy: boolean;
468
- serveraddress: string;
469
- serverport: number;
470
- statusCheckInterval: number;
471
- token: string;
472
- tunnelTimeout: number;
473
- type: TunnelType;
474
- webdebuggerport: number;
475
- xff: string;
476
- allowPreflight?: boolean | undefined;
477
- allowpreflight?: boolean | undefined;
478
- greetmsg?: string | undefined;
479
- additionalForwarding?: {
480
- localDomain: string;
481
- localPort: number;
482
- remoteDomain?: string | undefined;
483
- remotePort?: number | undefined;
484
- }[] | undefined;
485
- serve?: string | undefined;
486
- }>>;
487
- type TunnelConfig = z.infer<typeof TunnelConfigSchema>;
488
-
489
- interface TunnelResponse {
490
- tunnelid: string;
491
- remoteurls: string[];
492
- tunnelconfig: TunnelConfig;
493
- status: Status;
494
- stats: TunnelUsageType;
495
- }
496
- interface TunnelHandler {
497
- handleStart(config: TunnelConfig): Promise<TunnelResponse | ErrorResponse>;
498
- handleUpdateConfig(config: TunnelConfig): Promise<TunnelResponse | ErrorResponse>;
499
- handleList(): Promise<TunnelResponse[] | ErrorResponse>;
500
- handleStop(tunnelid: string): Promise<TunnelResponse | ErrorResponse>;
501
- handleGet(tunnelid: string): Promise<TunnelResponse | ErrorResponse>;
502
- handleRestart(tunnelid: string): Promise<TunnelResponse | ErrorResponse>;
503
- handleRegisterStatsListener(tunnelid: string, listener: (tunnelId: string, stats: TunnelUsageType) => void): void;
504
- handleUnregisterStatsListener(tunnelid: string, listnerId: string): void;
505
- handleGetTunnelStats(tunnelid: string): TunnelUsageType[] | ErrorResponse;
506
- handleRegisterDisconnectListener(tunnelid: string, listener: DisconnectListener): void;
507
- handleRemoveStoppedTunnelByTunnelId(tunnelId: string): boolean | ErrorResponse;
508
- handleRemoveStoppedTunnelByConfigId(configId: string): boolean | ErrorResponse;
509
- }
510
- declare class TunnelOperations implements TunnelHandler {
511
- private tunnelManager;
512
- constructor();
513
- private buildStatus;
514
- private buildTunnelResponse;
515
- private error;
516
- handleStart(config: TunnelConfig): Promise<TunnelResponse | ErrorResponse>;
517
- handleUpdateConfig(config: TunnelConfig): Promise<TunnelResponse | ErrorResponse>;
518
- handleList(): Promise<TunnelResponse[] | ErrorResponse>;
519
- handleStop(tunnelid: string): Promise<TunnelResponse | ErrorResponse>;
520
- handleGet(tunnelid: string): Promise<TunnelResponse | ErrorResponse>;
521
- handleRestart(tunnelid: string): Promise<TunnelResponse | ErrorResponse>;
522
- handleRegisterStatsListener(tunnelid: string, listener: (tunnelId: string, stats: TunnelUsageType) => void): void;
523
- handleUnregisterStatsListener(tunnelid: string, listnerId: string): void;
524
- handleGetTunnelStats(tunnelid: string): TunnelUsageType[] | ErrorResponse;
525
- handleRegisterDisconnectListener(tunnelid: string, listener: DisconnectListener): void;
526
- handleRemoveStoppedTunnelByConfigId(configId: string): boolean | ErrorResponse;
527
- handleRemoveStoppedTunnelByTunnelId(tunnelId: string): boolean | ErrorResponse;
528
- }
529
-
530
- interface BaseLogConfig {
531
- level?: string;
532
- filePath?: string;
533
- stdout?: boolean;
534
- source?: boolean;
535
- silent?: boolean;
536
- enableSdkLog?: boolean;
537
- }
538
- type BaseLogConfigType = BaseLogConfig;
539
- declare function enablePackageLogging(opts?: BaseLogConfigType): winston.Logger;
540
-
541
- /**
542
- * Initiate remote management mode with a WebSocket connection.
543
- * - Connect with Authorization: Bearer <token>
544
- * - On HTTP 401: print Unauthorized and exit
545
- * - On other failures: retry every 15 seconds
546
- * - Keep running until closed or SIGINT
547
- */
548
- declare function initiateRemoteManagement(token: string, manage?: string): Promise<RemoteManagementState>;
549
- declare function closeRemoteManagement(timeoutMs?: number): Promise<RemoteManagementState>;
550
- declare function getRemoteManagementState(): RemoteManagementState;
551
-
552
- export { TunnelManager, TunnelOperations, type TunnelResponse, closeRemoteManagement, enablePackageLogging, getRemoteManagementState, initiateRemoteManagement };