@saptools/cf-inspector 0.3.15 → 0.3.17
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/cli.d.ts +1 -2
- package/dist/cli.js +1351 -1228
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +27 -43
- package/dist/index.js +786 -735
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -147,6 +147,10 @@ declare class CdpClient {
|
|
|
147
147
|
onClose(listener: (err: Error) => void): () => void;
|
|
148
148
|
dispose(): void;
|
|
149
149
|
get isClosed(): boolean;
|
|
150
|
+
private handleResponse;
|
|
151
|
+
private createRequestTimer;
|
|
152
|
+
private createWaitTimeoutError;
|
|
153
|
+
private sendPayload;
|
|
150
154
|
private markClosed;
|
|
151
155
|
}
|
|
152
156
|
|
|
@@ -164,11 +168,14 @@ interface InspectorVersion {
|
|
|
164
168
|
readonly browser: string;
|
|
165
169
|
readonly protocolVersion: string;
|
|
166
170
|
}
|
|
171
|
+
declare function discoverInspectorTargets(host: string, port: number, timeoutMs: number): Promise<readonly InspectorTarget[]>;
|
|
172
|
+
declare function fetchInspectorVersion(host: string, port: number, timeoutMs: number): Promise<InspectorVersion>;
|
|
173
|
+
|
|
167
174
|
/**
|
|
168
175
|
* Internal coordination flag between the always-on `Debugger.paused` buffer in
|
|
169
176
|
* `connectInspector` and an active `waitForPause`. When `active` is true, the
|
|
170
177
|
* buffer listener skips pushing the live event so it cannot be replayed by a
|
|
171
|
-
* subsequent `waitForPause` call.
|
|
178
|
+
* subsequent `waitForPause` call.
|
|
172
179
|
*/
|
|
173
180
|
interface PauseWaitGate {
|
|
174
181
|
active: boolean;
|
|
@@ -199,49 +206,40 @@ interface CdpEvalResult {
|
|
|
199
206
|
};
|
|
200
207
|
};
|
|
201
208
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
209
|
+
interface CdpProperty {
|
|
210
|
+
name?: unknown;
|
|
211
|
+
value?: {
|
|
212
|
+
type?: unknown;
|
|
213
|
+
value?: unknown;
|
|
214
|
+
description?: unknown;
|
|
215
|
+
objectId?: unknown;
|
|
216
|
+
};
|
|
217
|
+
}
|
|
205
218
|
interface SetBreakpointInput extends BreakpointLocation {
|
|
206
219
|
readonly remoteRoot?: RemoteRootSetting;
|
|
207
220
|
readonly condition?: string;
|
|
208
221
|
}
|
|
209
|
-
declare function setBreakpoint(session: InspectorSession, input: SetBreakpointInput): Promise<BreakpointHandle>;
|
|
210
|
-
declare function removeBreakpoint(session: InspectorSession, breakpointId: string): Promise<void>;
|
|
211
222
|
interface WaitForPauseOptions {
|
|
212
223
|
readonly timeoutMs: number;
|
|
213
224
|
readonly breakpointIds?: readonly string[];
|
|
214
225
|
readonly unmatchedPausePolicy?: "wait-for-resume" | "fail";
|
|
215
226
|
readonly onUnmatchedPause?: (pause: PauseEvent) => void;
|
|
216
227
|
}
|
|
228
|
+
|
|
229
|
+
declare function setBreakpoint(session: InspectorSession, input: SetBreakpointInput): Promise<BreakpointHandle>;
|
|
230
|
+
declare function removeBreakpoint(session: InspectorSession, breakpointId: string): Promise<void>;
|
|
231
|
+
|
|
217
232
|
declare function waitForPause(session: InspectorSession, options: WaitForPauseOptions): Promise<PauseEvent>;
|
|
233
|
+
|
|
218
234
|
declare function resume(session: InspectorSession): Promise<void>;
|
|
219
235
|
declare function evaluateOnFrame(session: InspectorSession, callFrameId: string, expression: string): Promise<CdpEvalResult>;
|
|
220
236
|
declare function evaluateGlobal(session: InspectorSession, expression: string): Promise<CdpEvalResult>;
|
|
221
237
|
declare function listScripts(session: InspectorSession): readonly ScriptInfo[];
|
|
222
|
-
/**
|
|
223
|
-
* Pre-compile a JS expression on the inspectee using Runtime.compileScript so
|
|
224
|
-
* syntax errors surface as a CfInspectorError("INVALID_EXPRESSION") instead of
|
|
225
|
-
* being silently swallowed by V8 when wired into a breakpoint condition or a
|
|
226
|
-
* logpoint. Without this guard, a typo in --condition or --expr causes the
|
|
227
|
-
* breakpoint to silently never fire — the user would see BREAKPOINT_NOT_HIT
|
|
228
|
-
* after the timeout and have no idea why.
|
|
229
|
-
*
|
|
230
|
-
* persistScript: false — we don't actually want the compiled script around;
|
|
231
|
-
* we just want V8 to parse it and report any SyntaxError.
|
|
232
|
-
*/
|
|
233
238
|
declare function validateExpression(session: InspectorSession, expression: string): Promise<void>;
|
|
234
|
-
interface CdpProperty {
|
|
235
|
-
name?: unknown;
|
|
236
|
-
value?: {
|
|
237
|
-
type?: unknown;
|
|
238
|
-
value?: unknown;
|
|
239
|
-
description?: unknown;
|
|
240
|
-
objectId?: unknown;
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
239
|
declare function getProperties(session: InspectorSession, objectId: string): Promise<readonly CdpProperty[]>;
|
|
244
240
|
|
|
241
|
+
declare function connectInspector(options: InspectorConnectOptions): Promise<InspectorSession>;
|
|
242
|
+
|
|
245
243
|
interface CaptureSnapshotOptions {
|
|
246
244
|
readonly captures?: readonly string[];
|
|
247
245
|
readonly includeScopes?: boolean;
|
|
@@ -249,6 +247,8 @@ interface CaptureSnapshotOptions {
|
|
|
249
247
|
}
|
|
250
248
|
declare function captureSnapshot(session: InspectorSession, pause: PauseEvent, options?: CaptureSnapshotOptions): Promise<SnapshotCaptureResult>;
|
|
251
249
|
|
|
250
|
+
declare function buildLogpointCondition(sentinel: string, expression: string): string;
|
|
251
|
+
|
|
252
252
|
interface LogpointEvent {
|
|
253
253
|
readonly ts: string;
|
|
254
254
|
readonly at: string;
|
|
@@ -256,6 +256,7 @@ interface LogpointEvent {
|
|
|
256
256
|
readonly error?: string;
|
|
257
257
|
readonly raw?: string;
|
|
258
258
|
}
|
|
259
|
+
|
|
259
260
|
interface LogpointStreamOptions {
|
|
260
261
|
readonly location: BreakpointLocation;
|
|
261
262
|
readonly expression: string;
|
|
@@ -263,31 +264,14 @@ interface LogpointStreamOptions {
|
|
|
263
264
|
readonly durationMs?: number;
|
|
264
265
|
readonly signal?: AbortSignal;
|
|
265
266
|
readonly onEvent: (event: LogpointEvent) => void;
|
|
266
|
-
/**
|
|
267
|
-
* Fires once, immediately after `Debugger.setBreakpointByUrl` returns, with
|
|
268
|
-
* the resolved breakpoint handle. Useful for surfacing warnings such as a BP
|
|
269
|
-
* that did not bind to any script — the caller can warn the user before
|
|
270
|
-
* the stream window elapses.
|
|
271
|
-
*/
|
|
272
267
|
readonly onBreakpointSet?: (handle: BreakpointHandle) => void;
|
|
273
268
|
}
|
|
274
269
|
interface LogpointStreamResult {
|
|
275
270
|
readonly handle: BreakpointHandle;
|
|
276
271
|
readonly sentinel: string;
|
|
277
|
-
/** Emitted log count, including parse errors that kept the sentinel. */
|
|
278
272
|
readonly emitted: number;
|
|
279
273
|
readonly stoppedReason: "duration" | "signal" | "transport-closed";
|
|
280
274
|
}
|
|
281
|
-
/**
|
|
282
|
-
* Serialize a CDP-side IIFE that runs the user's expression as a "logpoint":
|
|
283
|
-
* never pauses (always returns false), tags each emitted log with a unique
|
|
284
|
-
* sentinel so we can distinguish our logs from app traffic, and wraps both the
|
|
285
|
-
* user expression and JSON.stringify in try/catch so a thrown expression still
|
|
286
|
-
* surfaces an error event instead of silently breaking the breakpoint.
|
|
287
|
-
*
|
|
288
|
-
* Exported for unit testing — the wire format is part of the contract.
|
|
289
|
-
*/
|
|
290
|
-
declare function buildLogpointCondition(sentinel: string, expression: string): string;
|
|
291
275
|
declare function streamLogpoint(session: InspectorSession, options: LogpointStreamOptions): Promise<LogpointStreamResult>;
|
|
292
276
|
|
|
293
277
|
interface TunnelTarget {
|