@saptools/cf-inspector 0.5.0 → 0.6.0
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/README.md +51 -0
- package/dist/cli.js +380 -153
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +102 -7
- package/dist/index.js +495 -141
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -30,24 +30,80 @@ interface BreakpointHandle {
|
|
|
30
30
|
readonly urlRegex: string;
|
|
31
31
|
readonly resolvedLocations: readonly ResolvedLocation[];
|
|
32
32
|
}
|
|
33
|
-
interface
|
|
33
|
+
interface ScriptLocation {
|
|
34
34
|
readonly scriptId: string;
|
|
35
|
-
readonly url?: string;
|
|
36
35
|
readonly lineNumber: number;
|
|
37
36
|
readonly columnNumber?: number;
|
|
38
37
|
}
|
|
38
|
+
interface BreakLocation extends ScriptLocation {
|
|
39
|
+
readonly type?: string;
|
|
40
|
+
}
|
|
41
|
+
interface ResolvedLocation extends ScriptLocation {
|
|
42
|
+
readonly url?: string;
|
|
43
|
+
}
|
|
44
|
+
interface GetPossibleBreakpointsOptions {
|
|
45
|
+
readonly start: ScriptLocation;
|
|
46
|
+
readonly end?: ScriptLocation;
|
|
47
|
+
readonly restrictToFunction?: boolean;
|
|
48
|
+
}
|
|
49
|
+
interface SetBreakpointAtLocationInput {
|
|
50
|
+
readonly location: ScriptLocation;
|
|
51
|
+
readonly condition?: string;
|
|
52
|
+
}
|
|
53
|
+
interface ExactBreakpointHandle {
|
|
54
|
+
readonly breakpointId: string;
|
|
55
|
+
readonly requestedLocation: ScriptLocation;
|
|
56
|
+
readonly actualLocation: ScriptLocation;
|
|
57
|
+
}
|
|
58
|
+
interface RemoteObjectInfo {
|
|
59
|
+
readonly type: string;
|
|
60
|
+
readonly subtype?: string;
|
|
61
|
+
readonly className?: string;
|
|
62
|
+
readonly completeness?: "truncated" | "unavailable";
|
|
63
|
+
readonly value?: unknown;
|
|
64
|
+
readonly unserializableValue?: string;
|
|
65
|
+
readonly description?: string;
|
|
66
|
+
readonly deepSerializedValue?: unknown;
|
|
67
|
+
readonly objectId?: string;
|
|
68
|
+
readonly preview?: unknown;
|
|
69
|
+
readonly customPreview?: unknown;
|
|
70
|
+
}
|
|
71
|
+
interface StackTraceIdInfo {
|
|
72
|
+
readonly id: string;
|
|
73
|
+
readonly debuggerId?: string;
|
|
74
|
+
}
|
|
75
|
+
interface StackTraceFrameInfo {
|
|
76
|
+
readonly functionName: string;
|
|
77
|
+
readonly scriptId: string;
|
|
78
|
+
readonly url: string;
|
|
79
|
+
readonly lineNumber: number;
|
|
80
|
+
readonly columnNumber: number;
|
|
81
|
+
}
|
|
82
|
+
interface StackTraceInfo {
|
|
83
|
+
readonly description?: string;
|
|
84
|
+
readonly callFrames: readonly StackTraceFrameInfo[];
|
|
85
|
+
readonly parent?: StackTraceInfo;
|
|
86
|
+
readonly parentId?: StackTraceIdInfo;
|
|
87
|
+
}
|
|
39
88
|
interface CallFrameInfo {
|
|
40
89
|
readonly callFrameId: string;
|
|
41
90
|
readonly functionName: string;
|
|
91
|
+
readonly scriptId?: string;
|
|
92
|
+
readonly functionLocation?: ScriptLocation;
|
|
42
93
|
readonly url?: string;
|
|
43
94
|
readonly lineNumber: number;
|
|
44
95
|
readonly columnNumber: number;
|
|
45
96
|
readonly scopeChain: readonly ScopeInfo[];
|
|
97
|
+
readonly thisObject?: RemoteObjectInfo;
|
|
98
|
+
readonly returnValue?: RemoteObjectInfo;
|
|
46
99
|
}
|
|
47
100
|
interface ScopeInfo {
|
|
48
101
|
readonly type: string;
|
|
49
102
|
readonly objectId?: string;
|
|
103
|
+
readonly object?: RemoteObjectInfo;
|
|
50
104
|
readonly name?: string;
|
|
105
|
+
readonly startLocation?: ScriptLocation;
|
|
106
|
+
readonly endLocation?: ScriptLocation;
|
|
51
107
|
}
|
|
52
108
|
interface PauseEvent {
|
|
53
109
|
readonly reason: string;
|
|
@@ -55,6 +111,9 @@ interface PauseEvent {
|
|
|
55
111
|
readonly callFrames: readonly CallFrameInfo[];
|
|
56
112
|
readonly receivedAtMs?: number;
|
|
57
113
|
readonly data?: unknown;
|
|
114
|
+
readonly asyncStackTrace?: StackTraceInfo;
|
|
115
|
+
readonly asyncStackTraceId?: StackTraceIdInfo;
|
|
116
|
+
readonly asyncCallStackTraceId?: StackTraceIdInfo;
|
|
58
117
|
}
|
|
59
118
|
interface VariableSnapshot {
|
|
60
119
|
readonly name: string;
|
|
@@ -129,6 +188,19 @@ interface WatchEvent {
|
|
|
129
188
|
interface ScriptInfo {
|
|
130
189
|
readonly scriptId: string;
|
|
131
190
|
readonly url: string;
|
|
191
|
+
readonly startLine?: number;
|
|
192
|
+
readonly startColumn?: number;
|
|
193
|
+
readonly endLine?: number;
|
|
194
|
+
readonly endColumn?: number;
|
|
195
|
+
readonly executionContextId?: number;
|
|
196
|
+
readonly hash?: string;
|
|
197
|
+
readonly buildId?: string;
|
|
198
|
+
readonly executionContextAuxData?: unknown;
|
|
199
|
+
readonly sourceMapURL?: string;
|
|
200
|
+
readonly hasSourceURL?: boolean;
|
|
201
|
+
readonly isModule?: boolean;
|
|
202
|
+
readonly length?: number;
|
|
203
|
+
readonly stackTrace?: StackTraceInfo;
|
|
132
204
|
}
|
|
133
205
|
interface InspectorConnectOptions {
|
|
134
206
|
readonly port: number;
|
|
@@ -168,6 +240,11 @@ interface CdpClientOptions {
|
|
|
168
240
|
readonly requestTimeoutMs?: number;
|
|
169
241
|
readonly connectTimeoutMs?: number;
|
|
170
242
|
}
|
|
243
|
+
interface CdpWaitOptions<T> {
|
|
244
|
+
readonly timeoutMs: number;
|
|
245
|
+
readonly predicate?: (params: T) => boolean;
|
|
246
|
+
readonly signal?: AbortSignal;
|
|
247
|
+
}
|
|
171
248
|
declare class CdpClient {
|
|
172
249
|
private readonly transport;
|
|
173
250
|
private readonly requestTimeoutMs;
|
|
@@ -184,16 +261,16 @@ declare class CdpClient {
|
|
|
184
261
|
static connect(options: CdpClientOptions): Promise<CdpClient>;
|
|
185
262
|
send<TResult = unknown>(method: string, params?: Record<string, unknown>): Promise<TResult>;
|
|
186
263
|
on(method: string, listener: (params: unknown) => void): () => void;
|
|
187
|
-
waitFor<T = unknown>(method: string, options?:
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}): Promise<T>;
|
|
264
|
+
waitFor<T = unknown>(method: string, options?: CdpWaitOptions<T>): Promise<T>;
|
|
265
|
+
private createEventWait;
|
|
266
|
+
private eventMatches;
|
|
191
267
|
onClose(listener: (err: Error) => void): () => void;
|
|
192
268
|
dispose(): void;
|
|
193
269
|
get isClosed(): boolean;
|
|
194
270
|
private handleResponse;
|
|
195
271
|
private createRequestTimer;
|
|
196
272
|
private createWaitTimeoutError;
|
|
273
|
+
private createWaitAbortError;
|
|
197
274
|
private sendPayload;
|
|
198
275
|
private markClosed;
|
|
199
276
|
}
|
|
@@ -285,17 +362,24 @@ interface WaitForPauseOptions {
|
|
|
285
362
|
readonly pauseReasons?: readonly string[];
|
|
286
363
|
readonly unmatchedPausePolicy?: "wait-for-resume" | "fail";
|
|
287
364
|
readonly onUnmatchedPause?: (pause: PauseEvent) => void;
|
|
365
|
+
readonly signal?: AbortSignal;
|
|
288
366
|
}
|
|
289
367
|
|
|
290
368
|
declare function buildHitCountedCondition(hitCount: number, counterKey: string, userCondition: string | undefined): string;
|
|
291
369
|
declare function setBreakpoint(session: InspectorSession, input: SetBreakpointInput): Promise<BreakpointHandle>;
|
|
292
370
|
declare function removeBreakpoint(session: InspectorSession, breakpointId: string): Promise<void>;
|
|
371
|
+
declare function getPossibleBreakpoints(session: InspectorSession, options: GetPossibleBreakpointsOptions): Promise<readonly BreakLocation[]>;
|
|
372
|
+
declare function setBreakpointAtLocation(session: InspectorSession, input: SetBreakpointAtLocationInput): Promise<ExactBreakpointHandle>;
|
|
293
373
|
|
|
294
374
|
declare function waitForPause(session: InspectorSession, options: WaitForPauseOptions): Promise<PauseEvent>;
|
|
295
375
|
|
|
296
376
|
type PauseOnExceptionsState = "none" | "uncaught" | "caught" | "all";
|
|
297
377
|
interface EvaluateOnFrameOptions {
|
|
298
378
|
readonly throwOnSideEffect?: boolean;
|
|
379
|
+
readonly objectGroup?: string;
|
|
380
|
+
}
|
|
381
|
+
interface StepIntoOptions {
|
|
382
|
+
readonly breakOnAsyncCall?: boolean;
|
|
299
383
|
}
|
|
300
384
|
declare function resume(session: InspectorSession): Promise<void>;
|
|
301
385
|
declare function setPauseOnExceptions(session: InspectorSession, state: PauseOnExceptionsState): Promise<void>;
|
|
@@ -305,6 +389,12 @@ declare function runSetupEvals(session: InspectorSession, expressions: readonly
|
|
|
305
389
|
declare function listScripts(session: InspectorSession): readonly ScriptInfo[];
|
|
306
390
|
declare function validateExpression(session: InspectorSession, expression: string): Promise<void>;
|
|
307
391
|
declare function getProperties(session: InspectorSession, objectId: string): Promise<readonly CdpProperty[]>;
|
|
392
|
+
declare function getScriptSource(session: InspectorSession, scriptId: string): Promise<string>;
|
|
393
|
+
declare function stepInto(session: InspectorSession, options?: StepIntoOptions): Promise<void>;
|
|
394
|
+
declare function stepOver(session: InspectorSession): Promise<void>;
|
|
395
|
+
declare function stepOut(session: InspectorSession): Promise<void>;
|
|
396
|
+
declare function releaseObject(session: InspectorSession, objectId: string): Promise<void>;
|
|
397
|
+
declare function releaseObjectGroup(session: InspectorSession, objectGroup: string): Promise<void>;
|
|
308
398
|
|
|
309
399
|
declare function connectInspector(options: InspectorConnectOptions): Promise<InspectorSession>;
|
|
310
400
|
|
|
@@ -373,6 +463,10 @@ interface TunnelTarget {
|
|
|
373
463
|
readonly org: string;
|
|
374
464
|
readonly space: string;
|
|
375
465
|
readonly app: string;
|
|
466
|
+
readonly process?: string;
|
|
467
|
+
readonly instance?: number;
|
|
468
|
+
readonly nodePid?: number;
|
|
469
|
+
readonly allowSshEnableRestart?: boolean;
|
|
376
470
|
readonly tunnelReadyTimeoutMs?: number;
|
|
377
471
|
readonly preferredPort?: number;
|
|
378
472
|
readonly verbose?: boolean;
|
|
@@ -384,6 +478,7 @@ interface OpenedTunnel {
|
|
|
384
478
|
readonly handle?: DebuggerHandle;
|
|
385
479
|
dispose(): Promise<void>;
|
|
386
480
|
}
|
|
481
|
+
declare function openOwnedCfTunnel(target: TunnelTarget): Promise<OpenedTunnel>;
|
|
387
482
|
declare function openCfTunnel(target: TunnelTarget): Promise<OpenedTunnel>;
|
|
388
483
|
|
|
389
|
-
export { type BreakpointHandle, type BreakpointLocation, type CallFrameInfo, type CaptureSnapshotOptions, type CapturedExpression, CfInspectorError, type CfInspectorErrorCode, type DebuggerState, type EvaluateOnFrameOptions, type ExceptionSnapshot, type FrameSnapshot, type InspectorConnectOptions, type InspectorSession, type InspectorTarget, type InspectorWorkerTarget, type LogpointConditionOptions, type LogpointEvent, type LogpointStopReason, type LogpointStreamOptions, type LogpointStreamResult, type OpenedTunnel, type PauseEvent, type PauseOnExceptionsState, type RemoteRootSetting, type ResolvedLocation, type ScopeInfo, type ScopeSnapshot, type ScriptInfo, type SetBreakpointInput, type SnapshotCaptureResult, type SnapshotResult, type TunnelTarget, type VariableSnapshot, type WaitForPauseOptions, type WalkStackOptions, type WatchEvent, buildBreakpointUrlRegex, buildHitCountedCondition, buildLogpointCondition, captureException, captureSnapshot, connectInspector, discoverInspectorTargets, evaluateGlobal, evaluateOnFrame, fetchInspectorVersion, getProperties, listScripts, openCfTunnel, parseBreakpointSpec, parseRemoteRoot, removeBreakpoint, resume, runSetupEvals, setBreakpoint, setPauseOnExceptions, streamLogpoint, validateExpression, waitForPause, walkStack };
|
|
484
|
+
export { type BreakLocation, type BreakpointHandle, type BreakpointLocation, type CallFrameInfo, type CaptureSnapshotOptions, type CapturedExpression, CfInspectorError, type CfInspectorErrorCode, type DebuggerState, type EvaluateOnFrameOptions, type ExactBreakpointHandle, type ExceptionSnapshot, type FrameSnapshot, type GetPossibleBreakpointsOptions, type InspectorConnectOptions, type InspectorSession, type InspectorTarget, type InspectorWorkerTarget, type LogpointConditionOptions, type LogpointEvent, type LogpointStopReason, type LogpointStreamOptions, type LogpointStreamResult, type OpenedTunnel, type PauseEvent, type PauseOnExceptionsState, type RemoteObjectInfo, type RemoteRootSetting, type ResolvedLocation, type ScopeInfo, type ScopeSnapshot, type ScriptInfo, type ScriptLocation, type SetBreakpointAtLocationInput, type SetBreakpointInput, type SnapshotCaptureResult, type SnapshotResult, type StackTraceFrameInfo, type StackTraceIdInfo, type StackTraceInfo, type StepIntoOptions, type TunnelTarget, type VariableSnapshot, type WaitForPauseOptions, type WalkStackOptions, type WatchEvent, buildBreakpointUrlRegex, buildHitCountedCondition, buildLogpointCondition, captureException, captureSnapshot, connectInspector, discoverInspectorTargets, evaluateGlobal, evaluateOnFrame, fetchInspectorVersion, getPossibleBreakpoints, getProperties, getScriptSource, listScripts, openCfTunnel, openOwnedCfTunnel, parseBreakpointSpec, parseRemoteRoot, releaseObject, releaseObjectGroup, removeBreakpoint, resume, runSetupEvals, setBreakpoint, setBreakpointAtLocation, setPauseOnExceptions, stepInto, stepOut, stepOver, streamLogpoint, validateExpression, waitForPause, walkStack };
|