@saptools/cf-debugger 0.1.13 → 0.1.15

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
@@ -3,11 +3,22 @@ interface SessionKey {
3
3
  readonly org: string;
4
4
  readonly space: string;
5
5
  readonly app: string;
6
+ readonly process?: string;
7
+ readonly instance?: number;
8
+ readonly apiEndpoint?: string;
9
+ readonly nodePid?: number;
10
+ }
11
+ interface ResolvedSessionKey extends SessionKey {
12
+ readonly process: string;
13
+ readonly instance: number;
6
14
  }
7
15
  type SessionStatus = "starting" | "logging-in" | "targeting" | "ssh-enabling" | "ssh-restarting" | "signaling" | "tunneling" | "ready" | "stopping" | "stopped" | "error";
8
16
  interface ActiveSession extends SessionKey {
9
17
  readonly sessionId: string;
18
+ /** Compatibility alias for the currently active controller or tunnel PID. */
10
19
  readonly pid: number;
20
+ readonly controllerPid?: number;
21
+ readonly tunnelPid?: number;
11
22
  readonly hostname: string;
12
23
  readonly localPort: number;
13
24
  readonly remotePort: number;
@@ -15,14 +26,17 @@ interface ActiveSession extends SessionKey {
15
26
  readonly cfHomeDir: string;
16
27
  readonly startedAt: string;
17
28
  readonly status: SessionStatus;
29
+ readonly remoteNodePid?: number;
30
+ readonly stopRequestedAt?: string;
18
31
  readonly message?: string;
19
32
  }
20
33
  interface StartDebuggerOptions extends SessionKey {
21
34
  readonly email?: string;
22
35
  readonly password?: string;
23
- readonly apiEndpoint?: string;
24
36
  readonly preferredPort?: number;
25
37
  readonly tunnelReadyTimeoutMs?: number;
38
+ /** Set false when the caller must not enable SSH or restart the deployed app. Defaults to true. */
39
+ readonly allowSshEnableRestart?: boolean;
26
40
  readonly verbose?: boolean;
27
41
  readonly onStatus?: (status: SessionStatus, message?: string) => void;
28
42
  readonly signal?: AbortSignal;
@@ -44,7 +58,11 @@ interface StopOptions {
44
58
  readonly sessionId?: string;
45
59
  readonly key?: SessionKey;
46
60
  }
47
- declare function stopDebugger(options: StopOptions): Promise<ActiveSession | undefined>;
61
+ interface StopDebuggerResult extends ActiveSession {
62
+ readonly stale: boolean;
63
+ readonly pending: boolean;
64
+ }
65
+ declare function stopDebugger(options: StopOptions): Promise<StopDebuggerResult | undefined>;
48
66
  declare function stopAllDebuggers(): Promise<number>;
49
67
  declare function listSessions(): Promise<readonly ActiveSession[]>;
50
68
  declare function getSession(key: SessionKey): Promise<ActiveSession | undefined>;
@@ -69,4 +87,21 @@ declare function readCurrentCfTarget(options?: CurrentCfTargetReadOptions): Prom
69
87
  declare function parseCurrentCfTarget(stdout: string): CurrentCfTarget | undefined;
70
88
  declare function requireCurrentCfRegion(target: Pick<CurrentCfTarget, "apiEndpoint" | "region">, instruction?: string): string;
71
89
 
72
- export { type ActiveSession, CfDebuggerError, type CurrentCfTarget, type CurrentCfTargetReadOptions, type DebuggerHandle, type SessionKey, type SessionStatus, type StartDebuggerOptions, getSession, listKnownRegionKeys, listSessions, parseCurrentCfTarget, readCurrentCfTarget, requireCurrentCfRegion, resolveApiEndpoint, sessionKeyString, startDebugger, stopAllDebuggers, stopDebugger };
90
+ interface NodeTargetSelectors {
91
+ readonly process?: string;
92
+ readonly instance?: number;
93
+ readonly nodePid?: number;
94
+ }
95
+ interface ResolvedNodeTarget {
96
+ readonly process: string;
97
+ readonly instance: number;
98
+ readonly nodePid?: number;
99
+ }
100
+ interface NodeProcessSelection {
101
+ readonly remoteNodePid: number;
102
+ }
103
+ declare function resolveNodeTarget(input: NodeTargetSelectors): ResolvedNodeTarget;
104
+ declare function buildNodeInspectorCommand(nodePid?: number): string;
105
+ declare function parseNodeInspectorMarkers(stdout: string): NodeProcessSelection;
106
+
107
+ export { type ActiveSession, CfDebuggerError, type CurrentCfTarget, type CurrentCfTargetReadOptions, type DebuggerHandle, type NodeProcessSelection, type NodeTargetSelectors, type ResolvedNodeTarget, type ResolvedSessionKey, type SessionKey, type SessionStatus, type StartDebuggerOptions, buildNodeInspectorCommand, getSession, listKnownRegionKeys, listSessions, parseCurrentCfTarget, parseNodeInspectorMarkers, readCurrentCfTarget, requireCurrentCfRegion, resolveApiEndpoint, resolveNodeTarget, sessionKeyString, startDebugger, stopAllDebuggers, stopDebugger };