@bbearai/core 0.4.1 → 0.4.3
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/index.d.mts +50 -1
- package/dist/index.d.ts +50 -1
- package/dist/index.js +68 -0
- package/dist/index.mjs +68 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -129,6 +129,8 @@ const context = contextCapture.getEnhancedContext();
|
|
|
129
129
|
| `getAppContext()` | Get current app context (uses config callback or auto-captured) |
|
|
130
130
|
| `getNavigationHistory()` | Get navigation history (config callback > manual > auto-captured) |
|
|
131
131
|
| `trackNavigation(route)` | Manually track a route change |
|
|
132
|
+
| `getIssueCounts()` | Get issue counts by category (open, done, reopened) |
|
|
133
|
+
| `getIssues(category)` | Get enriched issue list with verification proof and original bug context |
|
|
132
134
|
| `uploadScreenshot(file)` | Upload a screenshot |
|
|
133
135
|
|
|
134
136
|
## Types
|
|
@@ -172,6 +174,55 @@ interface TestAssignment {
|
|
|
172
174
|
priority: string;
|
|
173
175
|
};
|
|
174
176
|
}
|
|
177
|
+
|
|
178
|
+
type IssueCategory = 'open' | 'done' | 'reopened';
|
|
179
|
+
|
|
180
|
+
interface IssueCounts {
|
|
181
|
+
open: number;
|
|
182
|
+
done: number;
|
|
183
|
+
reopened: number;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
interface TesterIssue {
|
|
187
|
+
id: string;
|
|
188
|
+
title: string;
|
|
189
|
+
description: string;
|
|
190
|
+
reportType: ReportType;
|
|
191
|
+
severity: Severity | null;
|
|
192
|
+
status: ReportStatus;
|
|
193
|
+
screenshotUrls: string[];
|
|
194
|
+
route?: string;
|
|
195
|
+
reporterName?: string;
|
|
196
|
+
createdAt: string;
|
|
197
|
+
updatedAt: string;
|
|
198
|
+
verifiedByName?: string; // Who retested (done issues)
|
|
199
|
+
verifiedAt?: string; // When verification passed (done issues)
|
|
200
|
+
originalBugId?: string; // Original report ID (reopened issues)
|
|
201
|
+
originalBugTitle?: string; // Original bug title (reopened issues)
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Issue Tracking
|
|
206
|
+
|
|
207
|
+
The SDK provides methods for testers to track their bug lifecycle:
|
|
208
|
+
|
|
209
|
+
```typescript
|
|
210
|
+
// Get counts for issue cards (open, done, reopened)
|
|
211
|
+
const counts = await bugbear.getIssueCounts();
|
|
212
|
+
// { open: 3, done: 12, reopened: 1 }
|
|
213
|
+
|
|
214
|
+
// Get enriched issue list by category
|
|
215
|
+
const openIssues = await bugbear.getIssues('open');
|
|
216
|
+
const doneIssues = await bugbear.getIssues('done');
|
|
217
|
+
const reopenedIssues = await bugbear.getIssues('reopened');
|
|
218
|
+
|
|
219
|
+
// Done issues include verification proof
|
|
220
|
+
doneIssues[0].verifiedByName; // "Jane Doe"
|
|
221
|
+
doneIssues[0].verifiedAt; // "2026-02-05T12:00:00Z"
|
|
222
|
+
|
|
223
|
+
// Reopened issues include original bug context
|
|
224
|
+
reopenedIssues[0].originalBugTitle; // "Login button unresponsive"
|
|
225
|
+
reopenedIssues[0].originalBugId; // "uuid-of-original-report"
|
|
175
226
|
```
|
|
176
227
|
|
|
177
228
|
## For Framework Authors
|
package/dist/index.d.mts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
type ReportType = 'bug' | 'feedback' | 'suggestion' | 'test_pass' | 'test_fail';
|
|
5
5
|
type Severity = 'critical' | 'high' | 'medium' | 'low';
|
|
6
|
+
type BugCategory = 'ui_ux' | 'functional' | 'crash' | 'security' | 'other';
|
|
6
7
|
type ReportStatus = 'new' | 'triaging' | 'confirmed' | 'in_progress' | 'fixed' | 'ready_to_test' | 'verified' | 'resolved' | 'reviewed' | 'closed' | 'wont_fix' | 'duplicate';
|
|
7
8
|
interface AppContext {
|
|
8
9
|
/** Current route/screen path */
|
|
@@ -93,6 +94,8 @@ interface BugBearReport {
|
|
|
93
94
|
title?: string;
|
|
94
95
|
/** Severity (for bugs) */
|
|
95
96
|
severity?: Severity;
|
|
97
|
+
/** Bug category for triage */
|
|
98
|
+
category?: BugCategory;
|
|
96
99
|
/** Which step failed (for test failures) */
|
|
97
100
|
failedAtStep?: string;
|
|
98
101
|
/** Voice audio URL if voice input was used */
|
|
@@ -610,6 +613,37 @@ interface AddFindingOptions {
|
|
|
610
613
|
deviceInfo?: DeviceInfo;
|
|
611
614
|
appContext?: AppContext;
|
|
612
615
|
}
|
|
616
|
+
/** Category for filtering tester issues in the widget */
|
|
617
|
+
type IssueCategory = 'open' | 'done' | 'reopened';
|
|
618
|
+
/** Issue counts for each category (HomeScreen cards) */
|
|
619
|
+
interface IssueCounts {
|
|
620
|
+
open: number;
|
|
621
|
+
done: number;
|
|
622
|
+
reopened: number;
|
|
623
|
+
}
|
|
624
|
+
/** A report as seen by the tester in the widget */
|
|
625
|
+
interface TesterIssue {
|
|
626
|
+
id: string;
|
|
627
|
+
title: string;
|
|
628
|
+
description: string;
|
|
629
|
+
reportType: ReportType;
|
|
630
|
+
severity: Severity | null;
|
|
631
|
+
status: ReportStatus;
|
|
632
|
+
screenshotUrls: string[];
|
|
633
|
+
/** Route where the issue was observed (from app_context) */
|
|
634
|
+
route?: string;
|
|
635
|
+
reporterName?: string;
|
|
636
|
+
createdAt: string;
|
|
637
|
+
updatedAt: string;
|
|
638
|
+
/** Who verified/retested this issue (for done issues) */
|
|
639
|
+
verifiedByName?: string;
|
|
640
|
+
/** When verification passed (for done issues) */
|
|
641
|
+
verifiedAt?: string;
|
|
642
|
+
/** Original bug report ID (for reopened/test_fail issues) */
|
|
643
|
+
originalBugId?: string;
|
|
644
|
+
/** Original bug title (for reopened/test_fail issues) */
|
|
645
|
+
originalBugTitle?: string;
|
|
646
|
+
}
|
|
613
647
|
|
|
614
648
|
/**
|
|
615
649
|
* BugBear Client
|
|
@@ -740,6 +774,21 @@ declare class BugBearClient {
|
|
|
740
774
|
skipped: number;
|
|
741
775
|
total: number;
|
|
742
776
|
} | null>;
|
|
777
|
+
/**
|
|
778
|
+
* Get issue counts for the tester (Open, Done, Reopened)
|
|
779
|
+
* Used by the widget HomeScreen cards
|
|
780
|
+
*/
|
|
781
|
+
getIssueCounts(): Promise<{
|
|
782
|
+
open: number;
|
|
783
|
+
done: number;
|
|
784
|
+
reopened: number;
|
|
785
|
+
}>;
|
|
786
|
+
/**
|
|
787
|
+
* Get issues for the tester by category.
|
|
788
|
+
* Returns enriched data: done issues include verification proof,
|
|
789
|
+
* reopened issues include original bug context.
|
|
790
|
+
*/
|
|
791
|
+
getIssues(category: 'open' | 'done' | 'reopened'): Promise<TesterIssue[]>;
|
|
743
792
|
/**
|
|
744
793
|
* Basic email format validation (defense in depth)
|
|
745
794
|
*/
|
|
@@ -1019,4 +1068,4 @@ declare function captureError(error: Error, errorInfo?: {
|
|
|
1019
1068
|
componentStack?: string;
|
|
1020
1069
|
};
|
|
1021
1070
|
|
|
1022
|
-
export { type AddFindingOptions, type AppContext, BugBearClient, type BugBearConfig, type BugBearReport, type BugBearTheme, type ChecklistItem, type ChecklistResult, type ConsoleLogEntry, type CoverageGap, type CoverageMatrixCell, type CoverageMatrixRow, type DeployChecklist, type DeviceInfo, type EndSessionOptions, type EnhancedBugContext, type FindingSeverity, type FindingType, type HostUserInfo, type MessageSenderType, type NetworkRequest, type PriorityFactors, type ProjectRole, type QAFinding, type QAHealthMetrics, type QAHealthScore, type QASession, type QASessionStatus, type QATrack, type RegressionEvent, type ReportStatus, type ReportType, type RoutePriority, type RouteTestStats, type RubricMode, type RubricResult, type Severity, type SkipReason, type StartSessionOptions, type SubmitFeedbackOptions, type TestAssignment, type TestFeedback, type TestGroup, type TestResult, type TestStep, type TestTemplate, type TesterInfo, type TesterMessage, type TesterProfileUpdate, type TesterThread, type ThreadPriority, type ThreadType, captureError, contextCapture, createBugBear };
|
|
1071
|
+
export { type AddFindingOptions, type AppContext, BugBearClient, type BugBearConfig, type BugBearReport, type BugBearTheme, type BugCategory, type ChecklistItem, type ChecklistResult, type ConsoleLogEntry, type CoverageGap, type CoverageMatrixCell, type CoverageMatrixRow, type DeployChecklist, type DeviceInfo, type EndSessionOptions, type EnhancedBugContext, type FindingSeverity, type FindingType, type HostUserInfo, type IssueCategory, type IssueCounts, type MessageSenderType, type NetworkRequest, type PriorityFactors, type ProjectRole, type QAFinding, type QAHealthMetrics, type QAHealthScore, type QASession, type QASessionStatus, type QATrack, type RegressionEvent, type ReportStatus, type ReportType, type RoutePriority, type RouteTestStats, type RubricMode, type RubricResult, type Severity, type SkipReason, type StartSessionOptions, type SubmitFeedbackOptions, type TestAssignment, type TestFeedback, type TestGroup, type TestResult, type TestStep, type TestTemplate, type TesterInfo, type TesterIssue, type TesterMessage, type TesterProfileUpdate, type TesterThread, type ThreadPriority, type ThreadType, captureError, contextCapture, createBugBear };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
type ReportType = 'bug' | 'feedback' | 'suggestion' | 'test_pass' | 'test_fail';
|
|
5
5
|
type Severity = 'critical' | 'high' | 'medium' | 'low';
|
|
6
|
+
type BugCategory = 'ui_ux' | 'functional' | 'crash' | 'security' | 'other';
|
|
6
7
|
type ReportStatus = 'new' | 'triaging' | 'confirmed' | 'in_progress' | 'fixed' | 'ready_to_test' | 'verified' | 'resolved' | 'reviewed' | 'closed' | 'wont_fix' | 'duplicate';
|
|
7
8
|
interface AppContext {
|
|
8
9
|
/** Current route/screen path */
|
|
@@ -93,6 +94,8 @@ interface BugBearReport {
|
|
|
93
94
|
title?: string;
|
|
94
95
|
/** Severity (for bugs) */
|
|
95
96
|
severity?: Severity;
|
|
97
|
+
/** Bug category for triage */
|
|
98
|
+
category?: BugCategory;
|
|
96
99
|
/** Which step failed (for test failures) */
|
|
97
100
|
failedAtStep?: string;
|
|
98
101
|
/** Voice audio URL if voice input was used */
|
|
@@ -610,6 +613,37 @@ interface AddFindingOptions {
|
|
|
610
613
|
deviceInfo?: DeviceInfo;
|
|
611
614
|
appContext?: AppContext;
|
|
612
615
|
}
|
|
616
|
+
/** Category for filtering tester issues in the widget */
|
|
617
|
+
type IssueCategory = 'open' | 'done' | 'reopened';
|
|
618
|
+
/** Issue counts for each category (HomeScreen cards) */
|
|
619
|
+
interface IssueCounts {
|
|
620
|
+
open: number;
|
|
621
|
+
done: number;
|
|
622
|
+
reopened: number;
|
|
623
|
+
}
|
|
624
|
+
/** A report as seen by the tester in the widget */
|
|
625
|
+
interface TesterIssue {
|
|
626
|
+
id: string;
|
|
627
|
+
title: string;
|
|
628
|
+
description: string;
|
|
629
|
+
reportType: ReportType;
|
|
630
|
+
severity: Severity | null;
|
|
631
|
+
status: ReportStatus;
|
|
632
|
+
screenshotUrls: string[];
|
|
633
|
+
/** Route where the issue was observed (from app_context) */
|
|
634
|
+
route?: string;
|
|
635
|
+
reporterName?: string;
|
|
636
|
+
createdAt: string;
|
|
637
|
+
updatedAt: string;
|
|
638
|
+
/** Who verified/retested this issue (for done issues) */
|
|
639
|
+
verifiedByName?: string;
|
|
640
|
+
/** When verification passed (for done issues) */
|
|
641
|
+
verifiedAt?: string;
|
|
642
|
+
/** Original bug report ID (for reopened/test_fail issues) */
|
|
643
|
+
originalBugId?: string;
|
|
644
|
+
/** Original bug title (for reopened/test_fail issues) */
|
|
645
|
+
originalBugTitle?: string;
|
|
646
|
+
}
|
|
613
647
|
|
|
614
648
|
/**
|
|
615
649
|
* BugBear Client
|
|
@@ -740,6 +774,21 @@ declare class BugBearClient {
|
|
|
740
774
|
skipped: number;
|
|
741
775
|
total: number;
|
|
742
776
|
} | null>;
|
|
777
|
+
/**
|
|
778
|
+
* Get issue counts for the tester (Open, Done, Reopened)
|
|
779
|
+
* Used by the widget HomeScreen cards
|
|
780
|
+
*/
|
|
781
|
+
getIssueCounts(): Promise<{
|
|
782
|
+
open: number;
|
|
783
|
+
done: number;
|
|
784
|
+
reopened: number;
|
|
785
|
+
}>;
|
|
786
|
+
/**
|
|
787
|
+
* Get issues for the tester by category.
|
|
788
|
+
* Returns enriched data: done issues include verification proof,
|
|
789
|
+
* reopened issues include original bug context.
|
|
790
|
+
*/
|
|
791
|
+
getIssues(category: 'open' | 'done' | 'reopened'): Promise<TesterIssue[]>;
|
|
743
792
|
/**
|
|
744
793
|
* Basic email format validation (defense in depth)
|
|
745
794
|
*/
|
|
@@ -1019,4 +1068,4 @@ declare function captureError(error: Error, errorInfo?: {
|
|
|
1019
1068
|
componentStack?: string;
|
|
1020
1069
|
};
|
|
1021
1070
|
|
|
1022
|
-
export { type AddFindingOptions, type AppContext, BugBearClient, type BugBearConfig, type BugBearReport, type BugBearTheme, type ChecklistItem, type ChecklistResult, type ConsoleLogEntry, type CoverageGap, type CoverageMatrixCell, type CoverageMatrixRow, type DeployChecklist, type DeviceInfo, type EndSessionOptions, type EnhancedBugContext, type FindingSeverity, type FindingType, type HostUserInfo, type MessageSenderType, type NetworkRequest, type PriorityFactors, type ProjectRole, type QAFinding, type QAHealthMetrics, type QAHealthScore, type QASession, type QASessionStatus, type QATrack, type RegressionEvent, type ReportStatus, type ReportType, type RoutePriority, type RouteTestStats, type RubricMode, type RubricResult, type Severity, type SkipReason, type StartSessionOptions, type SubmitFeedbackOptions, type TestAssignment, type TestFeedback, type TestGroup, type TestResult, type TestStep, type TestTemplate, type TesterInfo, type TesterMessage, type TesterProfileUpdate, type TesterThread, type ThreadPriority, type ThreadType, captureError, contextCapture, createBugBear };
|
|
1071
|
+
export { type AddFindingOptions, type AppContext, BugBearClient, type BugBearConfig, type BugBearReport, type BugBearTheme, type BugCategory, type ChecklistItem, type ChecklistResult, type ConsoleLogEntry, type CoverageGap, type CoverageMatrixCell, type CoverageMatrixRow, type DeployChecklist, type DeviceInfo, type EndSessionOptions, type EnhancedBugContext, type FindingSeverity, type FindingType, type HostUserInfo, type IssueCategory, type IssueCounts, type MessageSenderType, type NetworkRequest, type PriorityFactors, type ProjectRole, type QAFinding, type QAHealthMetrics, type QAHealthScore, type QASession, type QASessionStatus, type QATrack, type RegressionEvent, type ReportStatus, type ReportType, type RoutePriority, type RouteTestStats, type RubricMode, type RubricResult, type Severity, type SkipReason, type StartSessionOptions, type SubmitFeedbackOptions, type TestAssignment, type TestFeedback, type TestGroup, type TestResult, type TestStep, type TestTemplate, type TesterInfo, type TesterIssue, type TesterMessage, type TesterProfileUpdate, type TesterThread, type ThreadPriority, type ThreadType, captureError, contextCapture, createBugBear };
|
package/dist/index.js
CHANGED
|
@@ -385,6 +385,8 @@ var BugBearClient = class {
|
|
|
385
385
|
title: report.title || this.generateTitle(report),
|
|
386
386
|
description: report.description,
|
|
387
387
|
severity: report.severity,
|
|
388
|
+
category: report.category,
|
|
389
|
+
// Bug category (ui, performance, crash, etc.)
|
|
388
390
|
failed_at_step: report.failedAtStep,
|
|
389
391
|
voice_audio_url: report.voiceAudioUrl,
|
|
390
392
|
voice_transcript: report.voiceTranscript,
|
|
@@ -886,6 +888,72 @@ var BugBearClient = class {
|
|
|
886
888
|
return null;
|
|
887
889
|
}
|
|
888
890
|
}
|
|
891
|
+
/**
|
|
892
|
+
* Get issue counts for the tester (Open, Done, Reopened)
|
|
893
|
+
* Used by the widget HomeScreen cards
|
|
894
|
+
*/
|
|
895
|
+
async getIssueCounts() {
|
|
896
|
+
try {
|
|
897
|
+
const testerInfo = await this.getTesterInfo();
|
|
898
|
+
if (!testerInfo) return { open: 0, done: 0, reopened: 0 };
|
|
899
|
+
const { data, error } = await this.supabase.rpc("get_tester_issue_counts", {
|
|
900
|
+
p_project_id: this.config.projectId,
|
|
901
|
+
p_tester_id: testerInfo.id
|
|
902
|
+
});
|
|
903
|
+
if (error) {
|
|
904
|
+
console.error("BugBear: Failed to fetch issue counts", formatPgError(error));
|
|
905
|
+
return { open: 0, done: 0, reopened: 0 };
|
|
906
|
+
}
|
|
907
|
+
return {
|
|
908
|
+
open: data?.open ?? 0,
|
|
909
|
+
done: data?.done ?? 0,
|
|
910
|
+
reopened: data?.reopened ?? 0
|
|
911
|
+
};
|
|
912
|
+
} catch (err) {
|
|
913
|
+
console.error("BugBear: Error fetching issue counts", err);
|
|
914
|
+
return { open: 0, done: 0, reopened: 0 };
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
/**
|
|
918
|
+
* Get issues for the tester by category.
|
|
919
|
+
* Returns enriched data: done issues include verification proof,
|
|
920
|
+
* reopened issues include original bug context.
|
|
921
|
+
*/
|
|
922
|
+
async getIssues(category) {
|
|
923
|
+
try {
|
|
924
|
+
const testerInfo = await this.getTesterInfo();
|
|
925
|
+
if (!testerInfo) return [];
|
|
926
|
+
const { data, error } = await this.supabase.rpc("get_tester_issues", {
|
|
927
|
+
p_project_id: this.config.projectId,
|
|
928
|
+
p_tester_id: testerInfo.id,
|
|
929
|
+
p_category: category
|
|
930
|
+
});
|
|
931
|
+
if (error) {
|
|
932
|
+
console.error("BugBear: Failed to fetch issues", formatPgError(error));
|
|
933
|
+
return [];
|
|
934
|
+
}
|
|
935
|
+
return (data || []).map((row) => ({
|
|
936
|
+
id: row.id,
|
|
937
|
+
title: row.title || "Untitled",
|
|
938
|
+
description: row.description,
|
|
939
|
+
reportType: row.report_type,
|
|
940
|
+
severity: row.severity || null,
|
|
941
|
+
status: row.status,
|
|
942
|
+
screenshotUrls: row.screenshot_urls || [],
|
|
943
|
+
route: row.app_context?.currentRoute || void 0,
|
|
944
|
+
reporterName: row.reporter_name || void 0,
|
|
945
|
+
createdAt: row.created_at,
|
|
946
|
+
updatedAt: row.updated_at,
|
|
947
|
+
verifiedByName: row.verified_by_name || void 0,
|
|
948
|
+
verifiedAt: row.verified_at || void 0,
|
|
949
|
+
originalBugId: row.original_bug_id || void 0,
|
|
950
|
+
originalBugTitle: row.original_bug_title || void 0
|
|
951
|
+
}));
|
|
952
|
+
} catch (err) {
|
|
953
|
+
console.error("BugBear: Error fetching issues", err);
|
|
954
|
+
return [];
|
|
955
|
+
}
|
|
956
|
+
}
|
|
889
957
|
/**
|
|
890
958
|
* Basic email format validation (defense in depth)
|
|
891
959
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -356,6 +356,8 @@ var BugBearClient = class {
|
|
|
356
356
|
title: report.title || this.generateTitle(report),
|
|
357
357
|
description: report.description,
|
|
358
358
|
severity: report.severity,
|
|
359
|
+
category: report.category,
|
|
360
|
+
// Bug category (ui, performance, crash, etc.)
|
|
359
361
|
failed_at_step: report.failedAtStep,
|
|
360
362
|
voice_audio_url: report.voiceAudioUrl,
|
|
361
363
|
voice_transcript: report.voiceTranscript,
|
|
@@ -857,6 +859,72 @@ var BugBearClient = class {
|
|
|
857
859
|
return null;
|
|
858
860
|
}
|
|
859
861
|
}
|
|
862
|
+
/**
|
|
863
|
+
* Get issue counts for the tester (Open, Done, Reopened)
|
|
864
|
+
* Used by the widget HomeScreen cards
|
|
865
|
+
*/
|
|
866
|
+
async getIssueCounts() {
|
|
867
|
+
try {
|
|
868
|
+
const testerInfo = await this.getTesterInfo();
|
|
869
|
+
if (!testerInfo) return { open: 0, done: 0, reopened: 0 };
|
|
870
|
+
const { data, error } = await this.supabase.rpc("get_tester_issue_counts", {
|
|
871
|
+
p_project_id: this.config.projectId,
|
|
872
|
+
p_tester_id: testerInfo.id
|
|
873
|
+
});
|
|
874
|
+
if (error) {
|
|
875
|
+
console.error("BugBear: Failed to fetch issue counts", formatPgError(error));
|
|
876
|
+
return { open: 0, done: 0, reopened: 0 };
|
|
877
|
+
}
|
|
878
|
+
return {
|
|
879
|
+
open: data?.open ?? 0,
|
|
880
|
+
done: data?.done ?? 0,
|
|
881
|
+
reopened: data?.reopened ?? 0
|
|
882
|
+
};
|
|
883
|
+
} catch (err) {
|
|
884
|
+
console.error("BugBear: Error fetching issue counts", err);
|
|
885
|
+
return { open: 0, done: 0, reopened: 0 };
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
/**
|
|
889
|
+
* Get issues for the tester by category.
|
|
890
|
+
* Returns enriched data: done issues include verification proof,
|
|
891
|
+
* reopened issues include original bug context.
|
|
892
|
+
*/
|
|
893
|
+
async getIssues(category) {
|
|
894
|
+
try {
|
|
895
|
+
const testerInfo = await this.getTesterInfo();
|
|
896
|
+
if (!testerInfo) return [];
|
|
897
|
+
const { data, error } = await this.supabase.rpc("get_tester_issues", {
|
|
898
|
+
p_project_id: this.config.projectId,
|
|
899
|
+
p_tester_id: testerInfo.id,
|
|
900
|
+
p_category: category
|
|
901
|
+
});
|
|
902
|
+
if (error) {
|
|
903
|
+
console.error("BugBear: Failed to fetch issues", formatPgError(error));
|
|
904
|
+
return [];
|
|
905
|
+
}
|
|
906
|
+
return (data || []).map((row) => ({
|
|
907
|
+
id: row.id,
|
|
908
|
+
title: row.title || "Untitled",
|
|
909
|
+
description: row.description,
|
|
910
|
+
reportType: row.report_type,
|
|
911
|
+
severity: row.severity || null,
|
|
912
|
+
status: row.status,
|
|
913
|
+
screenshotUrls: row.screenshot_urls || [],
|
|
914
|
+
route: row.app_context?.currentRoute || void 0,
|
|
915
|
+
reporterName: row.reporter_name || void 0,
|
|
916
|
+
createdAt: row.created_at,
|
|
917
|
+
updatedAt: row.updated_at,
|
|
918
|
+
verifiedByName: row.verified_by_name || void 0,
|
|
919
|
+
verifiedAt: row.verified_at || void 0,
|
|
920
|
+
originalBugId: row.original_bug_id || void 0,
|
|
921
|
+
originalBugTitle: row.original_bug_title || void 0
|
|
922
|
+
}));
|
|
923
|
+
} catch (err) {
|
|
924
|
+
console.error("BugBear: Error fetching issues", err);
|
|
925
|
+
return [];
|
|
926
|
+
}
|
|
927
|
+
}
|
|
860
928
|
/**
|
|
861
929
|
* Basic email format validation (defense in depth)
|
|
862
930
|
*/
|