@saptools/cf-inspector 0.4.12 → 0.5.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/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DebuggerHandle, SessionStatus } from '@saptools/cf-debugger';
2
2
 
3
- type CfInspectorErrorCode = "INVALID_ARGUMENT" | "INVALID_BREAKPOINT" | "INVALID_REMOTE_ROOT" | "INVALID_EXPRESSION" | "SETUP_EVAL_FAILED" | "INVALID_HIT_COUNT" | "INVALID_PAUSE_TYPE" | "BREAKPOINT_DID_NOT_BIND" | "INSPECTOR_DISCOVERY_FAILED" | "INSPECTOR_CONNECTION_FAILED" | "CDP_REQUEST_FAILED" | "BREAKPOINT_NOT_HIT" | "UNRELATED_PAUSE" | "UNRELATED_PAUSE_TIMEOUT" | "EVALUATION_FAILED" | "MISSING_TARGET" | "ABORTED";
3
+ type CfInspectorErrorCode = "INVALID_ARGUMENT" | "INVALID_BREAKPOINT" | "INVALID_REMOTE_ROOT" | "INVALID_EXPRESSION" | "MUTATION_NOT_ALLOWED" | "SETUP_EVAL_FAILED" | "INVALID_HIT_COUNT" | "INVALID_PAUSE_TYPE" | "BREAKPOINT_DID_NOT_BIND" | "INSPECTOR_DISCOVERY_FAILED" | "INSPECTOR_CONNECTION_FAILED" | "CDP_REQUEST_FAILED" | "BREAKPOINT_NOT_HIT" | "UNRELATED_PAUSE" | "UNRELATED_PAUSE_TIMEOUT" | "EVALUATION_FAILED" | "MISSING_TARGET" | "ABORTED";
4
4
  declare class CfInspectorError extends Error {
5
5
  readonly code: CfInspectorErrorCode;
6
6
  readonly detail?: string;
@@ -61,10 +61,15 @@ interface VariableSnapshot {
61
61
  readonly value: string;
62
62
  readonly type?: string;
63
63
  readonly children?: readonly VariableSnapshot[];
64
+ readonly truncated?: true;
65
+ readonly originalLength?: number;
66
+ readonly omittedCount?: number;
64
67
  }
65
68
  interface ScopeSnapshot {
66
69
  readonly type: string;
67
70
  readonly variables: readonly VariableSnapshot[];
71
+ readonly truncated?: true;
72
+ readonly omittedCount?: number;
68
73
  }
69
74
  interface FrameSnapshot {
70
75
  readonly functionName: string;
@@ -73,18 +78,30 @@ interface FrameSnapshot {
73
78
  readonly column: number;
74
79
  readonly scopes?: readonly ScopeSnapshot[];
75
80
  readonly captures?: readonly CapturedExpression[];
81
+ readonly truncated?: true;
82
+ readonly omittedCount?: number;
76
83
  }
77
84
  interface CapturedExpression {
78
85
  readonly expression: string;
79
86
  readonly value?: string;
80
87
  readonly type?: string;
81
88
  readonly error?: string;
89
+ readonly mutationRisk?: boolean;
90
+ readonly blocked?: true;
91
+ readonly truncated?: true;
92
+ readonly originalLength?: number;
93
+ readonly omittedCount?: number;
82
94
  }
83
95
  interface ExceptionSnapshot {
84
96
  readonly value?: string;
85
97
  readonly type?: string;
86
98
  readonly description?: string;
87
99
  readonly error?: string;
100
+ readonly truncated?: true;
101
+ readonly originalLength?: number;
102
+ readonly valueOriginalLength?: number;
103
+ readonly descriptionOriginalLength?: number;
104
+ readonly omittedCount?: number;
88
105
  }
89
106
  interface SnapshotCaptureResult {
90
107
  readonly reason: string;
@@ -118,6 +135,7 @@ interface InspectorConnectOptions {
118
135
  readonly host?: string;
119
136
  readonly connectTimeoutMs?: number;
120
137
  readonly targetIndex?: number;
138
+ readonly workerIndex?: number;
121
139
  }
122
140
 
123
141
  declare function parseBreakpointSpec(input: string): BreakpointLocation;
@@ -216,11 +234,25 @@ interface InspectorSession {
216
234
  readonly pauseBuffer: PauseEvent[];
217
235
  readonly pauseWaitGate: PauseWaitGate;
218
236
  readonly debuggerState: DebuggerState;
237
+ readonly targetIndex?: number;
238
+ readonly targetCount?: number;
239
+ readonly workerIndex?: number;
240
+ readonly workerTargets?: readonly InspectorWorkerTarget[];
241
+ readonly workerDiscoverySupported?: boolean;
219
242
  dispose(): Promise<void>;
220
243
  }
244
+ interface InspectorWorkerTarget {
245
+ readonly sessionId: string;
246
+ readonly workerId: string;
247
+ readonly type: string;
248
+ readonly title: string;
249
+ readonly url: string;
250
+ }
221
251
  interface CdpEvalResult {
222
252
  result?: {
223
253
  type?: unknown;
254
+ subtype?: unknown;
255
+ className?: unknown;
224
256
  value?: unknown;
225
257
  description?: unknown;
226
258
  objectId?: unknown;
@@ -228,6 +260,7 @@ interface CdpEvalResult {
228
260
  exceptionDetails?: {
229
261
  text?: unknown;
230
262
  exception?: {
263
+ className?: unknown;
231
264
  description?: unknown;
232
265
  };
233
266
  };
@@ -261,9 +294,12 @@ declare function removeBreakpoint(session: InspectorSession, breakpointId: strin
261
294
  declare function waitForPause(session: InspectorSession, options: WaitForPauseOptions): Promise<PauseEvent>;
262
295
 
263
296
  type PauseOnExceptionsState = "none" | "uncaught" | "caught" | "all";
297
+ interface EvaluateOnFrameOptions {
298
+ readonly throwOnSideEffect?: boolean;
299
+ }
264
300
  declare function resume(session: InspectorSession): Promise<void>;
265
301
  declare function setPauseOnExceptions(session: InspectorSession, state: PauseOnExceptionsState): Promise<void>;
266
- declare function evaluateOnFrame(session: InspectorSession, callFrameId: string, expression: string): Promise<CdpEvalResult>;
302
+ declare function evaluateOnFrame(session: InspectorSession, callFrameId: string, expression: string, options?: EvaluateOnFrameOptions): Promise<CdpEvalResult>;
267
303
  declare function evaluateGlobal(session: InspectorSession, expression: string): Promise<CdpEvalResult>;
268
304
  declare function runSetupEvals(session: InspectorSession, expressions: readonly string[]): Promise<void>;
269
305
  declare function listScripts(session: InspectorSession): readonly ScriptInfo[];
@@ -278,6 +314,7 @@ interface CaptureSnapshotOptions {
278
314
  readonly maxValueLength?: number;
279
315
  readonly stackDepth?: number;
280
316
  readonly stackCaptures?: readonly string[];
317
+ readonly throwOnSideEffect?: boolean;
281
318
  }
282
319
  declare function captureSnapshot(session: InspectorSession, pause: PauseEvent, options?: CaptureSnapshotOptions): Promise<SnapshotCaptureResult>;
283
320
 
@@ -287,6 +324,7 @@ interface WalkStackOptions {
287
324
  readonly stackDepth: number;
288
325
  readonly stackCaptures: readonly string[];
289
326
  readonly maxValueLength: number;
327
+ readonly throwOnSideEffect?: boolean;
290
328
  }
291
329
  declare function walkStack(session: InspectorSession, callFrames: readonly CallFrameInfo[], options: WalkStackOptions): Promise<readonly FrameSnapshot[]>;
292
330
 
@@ -303,6 +341,8 @@ interface LogpointEvent {
303
341
  readonly value?: string;
304
342
  readonly error?: string;
305
343
  readonly raw?: string;
344
+ readonly truncated?: true;
345
+ readonly originalLength?: number;
306
346
  }
307
347
 
308
348
  type LogpointStopReason = "duration" | "signal" | "transport-closed" | "max-events";
@@ -314,6 +354,7 @@ interface LogpointStreamOptions {
314
354
  readonly maxEvents?: number;
315
355
  readonly hitCount?: number;
316
356
  readonly condition?: string;
357
+ readonly maxValueLength?: number;
317
358
  readonly signal?: AbortSignal;
318
359
  readonly onEvent: (event: LogpointEvent) => void;
319
360
  readonly onBreakpointSet?: (handle: BreakpointHandle) => void;
@@ -345,4 +386,4 @@ interface OpenedTunnel {
345
386
  }
346
387
  declare function openCfTunnel(target: TunnelTarget): Promise<OpenedTunnel>;
347
388
 
348
- export { type BreakpointHandle, type BreakpointLocation, type CallFrameInfo, type CaptureSnapshotOptions, type CapturedExpression, CfInspectorError, type CfInspectorErrorCode, type DebuggerState, type ExceptionSnapshot, type FrameSnapshot, type InspectorConnectOptions, type InspectorSession, type InspectorTarget, 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 };
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 };