@bugdump/sdk 0.0.1 → 0.0.4
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 +165 -17
- package/dist/index.cjs +264 -135
- package/dist/index.d.cts +19 -4
- package/dist/index.d.ts +19 -4
- package/dist/index.global.js +325 -184
- package/dist/index.js +264 -135
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -3,6 +3,8 @@ import { eventWithTime } from '@rrweb/types';
|
|
|
3
3
|
interface BugdumpConfig {
|
|
4
4
|
projectKey: string;
|
|
5
5
|
endpoint?: string;
|
|
6
|
+
captureNetworkBodies?: boolean;
|
|
7
|
+
hideButton?: boolean;
|
|
6
8
|
}
|
|
7
9
|
interface BugdumpUserContext {
|
|
8
10
|
id?: string;
|
|
@@ -27,7 +29,11 @@ interface ReportPayload {
|
|
|
27
29
|
networkRequests?: Record<string, unknown>[];
|
|
28
30
|
performance?: Record<string, unknown>;
|
|
29
31
|
customContext?: Record<string, unknown>;
|
|
30
|
-
|
|
32
|
+
textAnnotations?: Array<{
|
|
33
|
+
text: string;
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
}>;
|
|
31
37
|
attachments?: Array<{
|
|
32
38
|
fileId: string;
|
|
33
39
|
type: 'screenshot' | 'recording' | 'voice_note' | 'session_replay';
|
|
@@ -55,7 +61,7 @@ declare class HttpClient {
|
|
|
55
61
|
constructor(endpoint: string, apiKey: string);
|
|
56
62
|
submitReport(payload: ReportPayload): Promise<ReportResponse>;
|
|
57
63
|
requestUpload(request: UploadRequest): Promise<UploadResponse>;
|
|
58
|
-
uploadFileToS3(presignedUrl: string, fields: Record<string, string>, file: Blob): Promise<void>;
|
|
64
|
+
uploadFileToS3(presignedUrl: string, fields: Record<string, string>, file: Blob, onProgress?: (percent: number) => void): Promise<void>;
|
|
59
65
|
private post;
|
|
60
66
|
}
|
|
61
67
|
declare class BugdumpApiError extends Error {
|
|
@@ -78,6 +84,8 @@ interface NetworkRequestEntry {
|
|
|
78
84
|
statusText: string | null;
|
|
79
85
|
requestHeaders: Record<string, string>;
|
|
80
86
|
responseHeaders: Record<string, string>;
|
|
87
|
+
requestBody: string | null;
|
|
88
|
+
responseBody: string | null;
|
|
81
89
|
duration: number | null;
|
|
82
90
|
startedAt: number;
|
|
83
91
|
error: string | null;
|
|
@@ -239,6 +247,8 @@ declare class AnnotationOverlay {
|
|
|
239
247
|
setFontSize(fontSize: number): void;
|
|
240
248
|
setBlurRadius(radius: number): void;
|
|
241
249
|
getOperations(): DrawOperation[];
|
|
250
|
+
getCanvasWidth(): number;
|
|
251
|
+
getCanvasHeight(): number;
|
|
242
252
|
undo(): void;
|
|
243
253
|
clear(): void;
|
|
244
254
|
addTextAtPosition(position: Point, text: string): void;
|
|
@@ -252,13 +262,18 @@ declare class AnnotationOverlay {
|
|
|
252
262
|
private redraw;
|
|
253
263
|
}
|
|
254
264
|
|
|
265
|
+
interface TextAnnotationMeta {
|
|
266
|
+
text: string;
|
|
267
|
+
x: number;
|
|
268
|
+
y: number;
|
|
269
|
+
}
|
|
255
270
|
interface Attachment {
|
|
256
271
|
id: string;
|
|
257
272
|
type: 'screenshot' | 'recording' | 'voice_note' | 'file';
|
|
258
273
|
blob: Blob;
|
|
259
274
|
name: string;
|
|
260
275
|
thumbnailUrl?: string;
|
|
261
|
-
|
|
276
|
+
textAnnotations?: TextAnnotationMeta[];
|
|
262
277
|
}
|
|
263
278
|
interface PanelSubmitData {
|
|
264
279
|
description: string;
|
|
@@ -267,4 +282,4 @@ interface PanelSubmitData {
|
|
|
267
282
|
attachments: Attachment[];
|
|
268
283
|
}
|
|
269
284
|
|
|
270
|
-
export { AnnotationOverlay, type AnnotationTool, type ArrowOperation, type Attachment, type BlurOperation, type BoxOperation, Bugdump, BugdumpApiError, type BugdumpConfig, type BugdumpUserContext, type ConsoleLogEntry, type DrawOperation, type FreehandOperation, HttpClient, type MetadataSnapshot, type NetworkRequestEntry, type PanelSubmitData, type PerformanceSnapshot, type Point, type ReportPayload, type ReportResponse, type ScreenshotOptions, type ScreenshotResult, type TelemetrySnapshot, type TextOperation, type UploadRequest, type UploadResponse, captureScreenshot, renderOperationsToCanvas };
|
|
285
|
+
export { AnnotationOverlay, type AnnotationTool, type ArrowOperation, type Attachment, type BlurOperation, type BoxOperation, Bugdump, BugdumpApiError, type BugdumpConfig, type BugdumpUserContext, type ConsoleLogEntry, type DrawOperation, type FreehandOperation, HttpClient, type MetadataSnapshot, type NetworkRequestEntry, type PanelSubmitData, type PerformanceSnapshot, type Point, type ReportPayload, type ReportResponse, type ScreenshotOptions, type ScreenshotResult, type TelemetrySnapshot, type TextAnnotationMeta, type TextOperation, type UploadRequest, type UploadResponse, captureScreenshot, renderOperationsToCanvas };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { eventWithTime } from '@rrweb/types';
|
|
|
3
3
|
interface BugdumpConfig {
|
|
4
4
|
projectKey: string;
|
|
5
5
|
endpoint?: string;
|
|
6
|
+
captureNetworkBodies?: boolean;
|
|
7
|
+
hideButton?: boolean;
|
|
6
8
|
}
|
|
7
9
|
interface BugdumpUserContext {
|
|
8
10
|
id?: string;
|
|
@@ -27,7 +29,11 @@ interface ReportPayload {
|
|
|
27
29
|
networkRequests?: Record<string, unknown>[];
|
|
28
30
|
performance?: Record<string, unknown>;
|
|
29
31
|
customContext?: Record<string, unknown>;
|
|
30
|
-
|
|
32
|
+
textAnnotations?: Array<{
|
|
33
|
+
text: string;
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
}>;
|
|
31
37
|
attachments?: Array<{
|
|
32
38
|
fileId: string;
|
|
33
39
|
type: 'screenshot' | 'recording' | 'voice_note' | 'session_replay';
|
|
@@ -55,7 +61,7 @@ declare class HttpClient {
|
|
|
55
61
|
constructor(endpoint: string, apiKey: string);
|
|
56
62
|
submitReport(payload: ReportPayload): Promise<ReportResponse>;
|
|
57
63
|
requestUpload(request: UploadRequest): Promise<UploadResponse>;
|
|
58
|
-
uploadFileToS3(presignedUrl: string, fields: Record<string, string>, file: Blob): Promise<void>;
|
|
64
|
+
uploadFileToS3(presignedUrl: string, fields: Record<string, string>, file: Blob, onProgress?: (percent: number) => void): Promise<void>;
|
|
59
65
|
private post;
|
|
60
66
|
}
|
|
61
67
|
declare class BugdumpApiError extends Error {
|
|
@@ -78,6 +84,8 @@ interface NetworkRequestEntry {
|
|
|
78
84
|
statusText: string | null;
|
|
79
85
|
requestHeaders: Record<string, string>;
|
|
80
86
|
responseHeaders: Record<string, string>;
|
|
87
|
+
requestBody: string | null;
|
|
88
|
+
responseBody: string | null;
|
|
81
89
|
duration: number | null;
|
|
82
90
|
startedAt: number;
|
|
83
91
|
error: string | null;
|
|
@@ -239,6 +247,8 @@ declare class AnnotationOverlay {
|
|
|
239
247
|
setFontSize(fontSize: number): void;
|
|
240
248
|
setBlurRadius(radius: number): void;
|
|
241
249
|
getOperations(): DrawOperation[];
|
|
250
|
+
getCanvasWidth(): number;
|
|
251
|
+
getCanvasHeight(): number;
|
|
242
252
|
undo(): void;
|
|
243
253
|
clear(): void;
|
|
244
254
|
addTextAtPosition(position: Point, text: string): void;
|
|
@@ -252,13 +262,18 @@ declare class AnnotationOverlay {
|
|
|
252
262
|
private redraw;
|
|
253
263
|
}
|
|
254
264
|
|
|
265
|
+
interface TextAnnotationMeta {
|
|
266
|
+
text: string;
|
|
267
|
+
x: number;
|
|
268
|
+
y: number;
|
|
269
|
+
}
|
|
255
270
|
interface Attachment {
|
|
256
271
|
id: string;
|
|
257
272
|
type: 'screenshot' | 'recording' | 'voice_note' | 'file';
|
|
258
273
|
blob: Blob;
|
|
259
274
|
name: string;
|
|
260
275
|
thumbnailUrl?: string;
|
|
261
|
-
|
|
276
|
+
textAnnotations?: TextAnnotationMeta[];
|
|
262
277
|
}
|
|
263
278
|
interface PanelSubmitData {
|
|
264
279
|
description: string;
|
|
@@ -267,4 +282,4 @@ interface PanelSubmitData {
|
|
|
267
282
|
attachments: Attachment[];
|
|
268
283
|
}
|
|
269
284
|
|
|
270
|
-
export { AnnotationOverlay, type AnnotationTool, type ArrowOperation, type Attachment, type BlurOperation, type BoxOperation, Bugdump, BugdumpApiError, type BugdumpConfig, type BugdumpUserContext, type ConsoleLogEntry, type DrawOperation, type FreehandOperation, HttpClient, type MetadataSnapshot, type NetworkRequestEntry, type PanelSubmitData, type PerformanceSnapshot, type Point, type ReportPayload, type ReportResponse, type ScreenshotOptions, type ScreenshotResult, type TelemetrySnapshot, type TextOperation, type UploadRequest, type UploadResponse, captureScreenshot, renderOperationsToCanvas };
|
|
285
|
+
export { AnnotationOverlay, type AnnotationTool, type ArrowOperation, type Attachment, type BlurOperation, type BoxOperation, Bugdump, BugdumpApiError, type BugdumpConfig, type BugdumpUserContext, type ConsoleLogEntry, type DrawOperation, type FreehandOperation, HttpClient, type MetadataSnapshot, type NetworkRequestEntry, type PanelSubmitData, type PerformanceSnapshot, type Point, type ReportPayload, type ReportResponse, type ScreenshotOptions, type ScreenshotResult, type TelemetrySnapshot, type TextAnnotationMeta, type TextOperation, type UploadRequest, type UploadResponse, captureScreenshot, renderOperationsToCanvas };
|