@bbearai/core 0.3.0 → 0.4.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.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +43 -22
- package/dist/index.mjs +43 -22
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -187,6 +187,15 @@ interface TestGroup {
|
|
|
187
187
|
description?: string;
|
|
188
188
|
sortOrder: number;
|
|
189
189
|
}
|
|
190
|
+
/** Project role — a user role in the app under test (e.g., Owner, Manager) */
|
|
191
|
+
interface ProjectRole {
|
|
192
|
+
id: string;
|
|
193
|
+
name: string;
|
|
194
|
+
slug: string;
|
|
195
|
+
color: string;
|
|
196
|
+
description?: string;
|
|
197
|
+
loginHint?: string;
|
|
198
|
+
}
|
|
190
199
|
interface QATrack {
|
|
191
200
|
id: string;
|
|
192
201
|
name: string;
|
|
@@ -212,6 +221,8 @@ interface TestAssignment {
|
|
|
212
221
|
track?: QATrack;
|
|
213
222
|
/** Test group (folder) this test belongs to */
|
|
214
223
|
group?: TestGroup;
|
|
224
|
+
/** Required app role for testing (e.g., Owner, Manager) */
|
|
225
|
+
role?: ProjectRole;
|
|
215
226
|
};
|
|
216
227
|
status: 'pending' | 'in_progress' | 'passed' | 'failed' | 'blocked' | 'skipped';
|
|
217
228
|
/** Reason for skipping (when status is 'skipped') */
|
|
@@ -1007,4 +1018,4 @@ declare function captureError(error: Error, errorInfo?: {
|
|
|
1007
1018
|
componentStack?: string;
|
|
1008
1019
|
};
|
|
1009
1020
|
|
|
1010
|
-
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 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 };
|
|
1021
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -187,6 +187,15 @@ interface TestGroup {
|
|
|
187
187
|
description?: string;
|
|
188
188
|
sortOrder: number;
|
|
189
189
|
}
|
|
190
|
+
/** Project role — a user role in the app under test (e.g., Owner, Manager) */
|
|
191
|
+
interface ProjectRole {
|
|
192
|
+
id: string;
|
|
193
|
+
name: string;
|
|
194
|
+
slug: string;
|
|
195
|
+
color: string;
|
|
196
|
+
description?: string;
|
|
197
|
+
loginHint?: string;
|
|
198
|
+
}
|
|
190
199
|
interface QATrack {
|
|
191
200
|
id: string;
|
|
192
201
|
name: string;
|
|
@@ -212,6 +221,8 @@ interface TestAssignment {
|
|
|
212
221
|
track?: QATrack;
|
|
213
222
|
/** Test group (folder) this test belongs to */
|
|
214
223
|
group?: TestGroup;
|
|
224
|
+
/** Required app role for testing (e.g., Owner, Manager) */
|
|
225
|
+
role?: ProjectRole;
|
|
215
226
|
};
|
|
216
227
|
status: 'pending' | 'in_progress' | 'passed' | 'failed' | 'blocked' | 'skipped';
|
|
217
228
|
/** Reason for skipping (when status is 'skipped') */
|
|
@@ -1007,4 +1018,4 @@ declare function captureError(error: Error, errorInfo?: {
|
|
|
1007
1018
|
componentStack?: string;
|
|
1008
1019
|
};
|
|
1009
1020
|
|
|
1010
|
-
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 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 };
|
|
1021
|
+
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 };
|
package/dist/index.js
CHANGED
|
@@ -273,6 +273,11 @@ function captureError(error, errorInfo) {
|
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
// src/client.ts
|
|
276
|
+
var formatPgError = (e) => {
|
|
277
|
+
if (!e || typeof e !== "object") return { raw: e };
|
|
278
|
+
const { message, code, details, hint } = e;
|
|
279
|
+
return { message, code, details, hint };
|
|
280
|
+
};
|
|
276
281
|
var DEFAULT_SUPABASE_URL = "https://kyxgzjnqgvapvlnvqawz.supabase.co";
|
|
277
282
|
var getEnvVar = (key) => {
|
|
278
283
|
try {
|
|
@@ -438,11 +443,19 @@ var BugBearClient = class {
|
|
|
438
443
|
name,
|
|
439
444
|
description,
|
|
440
445
|
sort_order
|
|
446
|
+
),
|
|
447
|
+
role:project_roles(
|
|
448
|
+
id,
|
|
449
|
+
name,
|
|
450
|
+
slug,
|
|
451
|
+
color,
|
|
452
|
+
description,
|
|
453
|
+
login_hint
|
|
441
454
|
)
|
|
442
455
|
)
|
|
443
456
|
`).eq("project_id", this.config.projectId).eq("tester_id", testerInfo.id).in("status", ["pending", "in_progress"]).order("created_at", { ascending: true }).limit(100);
|
|
444
457
|
if (error) {
|
|
445
|
-
console.error("BugBear: Failed to fetch assignments", error);
|
|
458
|
+
console.error("BugBear: Failed to fetch assignments", formatPgError(error));
|
|
446
459
|
return [];
|
|
447
460
|
}
|
|
448
461
|
const mapped = (data || []).map((item) => ({
|
|
@@ -475,6 +488,14 @@ var BugBearClient = class {
|
|
|
475
488
|
name: item.test_case.group.name,
|
|
476
489
|
description: item.test_case.group.description,
|
|
477
490
|
sortOrder: item.test_case.group.sort_order
|
|
491
|
+
} : void 0,
|
|
492
|
+
role: item.test_case.role ? {
|
|
493
|
+
id: item.test_case.role.id,
|
|
494
|
+
name: item.test_case.role.name,
|
|
495
|
+
slug: item.test_case.role.slug,
|
|
496
|
+
color: item.test_case.role.color,
|
|
497
|
+
description: item.test_case.role.description,
|
|
498
|
+
loginHint: item.test_case.role.login_hint
|
|
478
499
|
} : void 0
|
|
479
500
|
}
|
|
480
501
|
}));
|
|
@@ -670,7 +691,7 @@ var BugBearClient = class {
|
|
|
670
691
|
}
|
|
671
692
|
const { error } = await this.supabase.from("test_assignments").update(updateData).eq("id", assignmentId);
|
|
672
693
|
if (error) {
|
|
673
|
-
console.error("BugBear: Failed to skip assignment", error);
|
|
694
|
+
console.error("BugBear: Failed to skip assignment", formatPgError(error));
|
|
674
695
|
return { success: false, error: error.message };
|
|
675
696
|
}
|
|
676
697
|
return { success: true };
|
|
@@ -849,7 +870,7 @@ var BugBearClient = class {
|
|
|
849
870
|
p_tester_id: testerInfo.id
|
|
850
871
|
});
|
|
851
872
|
if (error) {
|
|
852
|
-
console.error("BugBear: Failed to fetch tester stats", error);
|
|
873
|
+
console.error("BugBear: Failed to fetch tester stats", formatPgError(error));
|
|
853
874
|
return null;
|
|
854
875
|
}
|
|
855
876
|
return data;
|
|
@@ -1000,7 +1021,7 @@ var BugBearClient = class {
|
|
|
1000
1021
|
if (updates.platforms !== void 0) updateData.platforms = updates.platforms;
|
|
1001
1022
|
const { error } = await this.supabase.from("testers").update(updateData).eq("id", testerInfo.id);
|
|
1002
1023
|
if (error) {
|
|
1003
|
-
console.error("BugBear: updateTesterProfile error", error);
|
|
1024
|
+
console.error("BugBear: updateTesterProfile error", formatPgError(error));
|
|
1004
1025
|
return { success: false, error: error.message };
|
|
1005
1026
|
}
|
|
1006
1027
|
return { success: true };
|
|
@@ -1022,14 +1043,14 @@ var BugBearClient = class {
|
|
|
1022
1043
|
*/
|
|
1023
1044
|
async isQAEnabled() {
|
|
1024
1045
|
try {
|
|
1025
|
-
const { data, error } = await this.supabase.
|
|
1046
|
+
const { data, error } = await this.supabase.rpc("check_qa_enabled", {
|
|
1047
|
+
p_project_id: this.config.projectId
|
|
1048
|
+
});
|
|
1026
1049
|
if (error) {
|
|
1027
|
-
|
|
1028
|
-
console.warn("BugBear: Could not check QA status", error.message || error.code || "Unknown error");
|
|
1029
|
-
}
|
|
1050
|
+
console.warn("BugBear: Could not check QA status", error.message || error.code || "Unknown error");
|
|
1030
1051
|
return true;
|
|
1031
1052
|
}
|
|
1032
|
-
return data
|
|
1053
|
+
return data ?? true;
|
|
1033
1054
|
} catch (err) {
|
|
1034
1055
|
return true;
|
|
1035
1056
|
}
|
|
@@ -1059,7 +1080,7 @@ var BugBearClient = class {
|
|
|
1059
1080
|
upsert: false
|
|
1060
1081
|
});
|
|
1061
1082
|
if (error) {
|
|
1062
|
-
console.error("BugBear: Failed to upload screenshot", error);
|
|
1083
|
+
console.error("BugBear: Failed to upload screenshot", formatPgError(error));
|
|
1063
1084
|
return null;
|
|
1064
1085
|
}
|
|
1065
1086
|
const { data: { publicUrl } } = this.supabase.storage.from(bucket).getPublicUrl(path);
|
|
@@ -1090,7 +1111,7 @@ var BugBearClient = class {
|
|
|
1090
1111
|
upsert: false
|
|
1091
1112
|
});
|
|
1092
1113
|
if (error) {
|
|
1093
|
-
console.error("BugBear: Failed to upload image from URI", error);
|
|
1114
|
+
console.error("BugBear: Failed to upload image from URI", formatPgError(error));
|
|
1094
1115
|
return null;
|
|
1095
1116
|
}
|
|
1096
1117
|
const { data: { publicUrl } } = this.supabase.storage.from(bucket).getPublicUrl(path);
|
|
@@ -1165,7 +1186,7 @@ var BugBearClient = class {
|
|
|
1165
1186
|
}
|
|
1166
1187
|
const { data, error } = await query;
|
|
1167
1188
|
if (error) {
|
|
1168
|
-
console.error("BugBear: Failed to fetch fix requests", error);
|
|
1189
|
+
console.error("BugBear: Failed to fetch fix requests", formatPgError(error));
|
|
1169
1190
|
return [];
|
|
1170
1191
|
}
|
|
1171
1192
|
return (data || []).map((fr) => ({
|
|
@@ -1196,7 +1217,7 @@ var BugBearClient = class {
|
|
|
1196
1217
|
p_tester_id: testerInfo.id
|
|
1197
1218
|
});
|
|
1198
1219
|
if (error) {
|
|
1199
|
-
console.error("BugBear: Failed to fetch threads via RPC", error);
|
|
1220
|
+
console.error("BugBear: Failed to fetch threads via RPC", formatPgError(error));
|
|
1200
1221
|
return [];
|
|
1201
1222
|
}
|
|
1202
1223
|
if (!data || data.length === 0) return [];
|
|
@@ -1240,7 +1261,7 @@ var BugBearClient = class {
|
|
|
1240
1261
|
attachments
|
|
1241
1262
|
`).eq("thread_id", threadId).order("created_at", { ascending: true }).limit(200);
|
|
1242
1263
|
if (error) {
|
|
1243
|
-
console.error("BugBear: Failed to fetch messages", error);
|
|
1264
|
+
console.error("BugBear: Failed to fetch messages", formatPgError(error));
|
|
1244
1265
|
return [];
|
|
1245
1266
|
}
|
|
1246
1267
|
return (data || []).map((msg) => ({
|
|
@@ -1284,7 +1305,7 @@ var BugBearClient = class {
|
|
|
1284
1305
|
}
|
|
1285
1306
|
const { error } = await this.supabase.from("discussion_messages").insert(insertData);
|
|
1286
1307
|
if (error) {
|
|
1287
|
-
console.error("BugBear: Failed to send message", error);
|
|
1308
|
+
console.error("BugBear: Failed to send message", formatPgError(error));
|
|
1288
1309
|
return false;
|
|
1289
1310
|
}
|
|
1290
1311
|
await this.markThreadAsRead(threadId);
|
|
@@ -1400,7 +1421,7 @@ var BugBearClient = class {
|
|
|
1400
1421
|
p_platform: options.platform || null
|
|
1401
1422
|
});
|
|
1402
1423
|
if (error) {
|
|
1403
|
-
console.error("BugBear: Failed to start session", error);
|
|
1424
|
+
console.error("BugBear: Failed to start session", formatPgError(error));
|
|
1404
1425
|
return { success: false, error: error.message };
|
|
1405
1426
|
}
|
|
1406
1427
|
const session = await this.getSession(data);
|
|
@@ -1425,7 +1446,7 @@ var BugBearClient = class {
|
|
|
1425
1446
|
p_routes_covered: options.routesCovered || null
|
|
1426
1447
|
});
|
|
1427
1448
|
if (error) {
|
|
1428
|
-
console.error("BugBear: Failed to end session", error);
|
|
1449
|
+
console.error("BugBear: Failed to end session", formatPgError(error));
|
|
1429
1450
|
return { success: false, error: error.message };
|
|
1430
1451
|
}
|
|
1431
1452
|
const session = this.transformSession(data);
|
|
@@ -1473,7 +1494,7 @@ var BugBearClient = class {
|
|
|
1473
1494
|
if (!testerInfo) return [];
|
|
1474
1495
|
const { data, error } = await this.supabase.from("qa_sessions").select("*").eq("project_id", this.config.projectId).eq("tester_id", testerInfo.id).order("started_at", { ascending: false }).limit(limit);
|
|
1475
1496
|
if (error) {
|
|
1476
|
-
console.error("BugBear: Failed to fetch session history", error);
|
|
1497
|
+
console.error("BugBear: Failed to fetch session history", formatPgError(error));
|
|
1477
1498
|
return [];
|
|
1478
1499
|
}
|
|
1479
1500
|
return (data || []).map((s) => this.transformSession(s));
|
|
@@ -1501,7 +1522,7 @@ var BugBearClient = class {
|
|
|
1501
1522
|
p_app_context: options.appContext || null
|
|
1502
1523
|
});
|
|
1503
1524
|
if (error) {
|
|
1504
|
-
console.error("BugBear: Failed to add finding", error);
|
|
1525
|
+
console.error("BugBear: Failed to add finding", formatPgError(error));
|
|
1505
1526
|
return { success: false, error: error.message };
|
|
1506
1527
|
}
|
|
1507
1528
|
const finding = this.transformFinding(data);
|
|
@@ -1519,7 +1540,7 @@ var BugBearClient = class {
|
|
|
1519
1540
|
try {
|
|
1520
1541
|
const { data, error } = await this.supabase.from("qa_findings").select("*").eq("session_id", sessionId).order("created_at", { ascending: true }).limit(100);
|
|
1521
1542
|
if (error) {
|
|
1522
|
-
console.error("BugBear: Failed to fetch findings", error);
|
|
1543
|
+
console.error("BugBear: Failed to fetch findings", formatPgError(error));
|
|
1523
1544
|
return [];
|
|
1524
1545
|
}
|
|
1525
1546
|
return (data || []).map((f) => this.transformFinding(f));
|
|
@@ -1537,7 +1558,7 @@ var BugBearClient = class {
|
|
|
1537
1558
|
p_finding_id: findingId
|
|
1538
1559
|
});
|
|
1539
1560
|
if (error) {
|
|
1540
|
-
console.error("BugBear: Failed to convert finding", error);
|
|
1561
|
+
console.error("BugBear: Failed to convert finding", formatPgError(error));
|
|
1541
1562
|
return { success: false, error: error.message };
|
|
1542
1563
|
}
|
|
1543
1564
|
return { success: true, bugId: data };
|
|
@@ -1558,7 +1579,7 @@ var BugBearClient = class {
|
|
|
1558
1579
|
dismissed_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1559
1580
|
}).eq("id", findingId);
|
|
1560
1581
|
if (error) {
|
|
1561
|
-
console.error("BugBear: Failed to dismiss finding", error);
|
|
1582
|
+
console.error("BugBear: Failed to dismiss finding", formatPgError(error));
|
|
1562
1583
|
return { success: false, error: error.message };
|
|
1563
1584
|
}
|
|
1564
1585
|
return { success: true };
|
package/dist/index.mjs
CHANGED
|
@@ -244,6 +244,11 @@ function captureError(error, errorInfo) {
|
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
// src/client.ts
|
|
247
|
+
var formatPgError = (e) => {
|
|
248
|
+
if (!e || typeof e !== "object") return { raw: e };
|
|
249
|
+
const { message, code, details, hint } = e;
|
|
250
|
+
return { message, code, details, hint };
|
|
251
|
+
};
|
|
247
252
|
var DEFAULT_SUPABASE_URL = "https://kyxgzjnqgvapvlnvqawz.supabase.co";
|
|
248
253
|
var getEnvVar = (key) => {
|
|
249
254
|
try {
|
|
@@ -409,11 +414,19 @@ var BugBearClient = class {
|
|
|
409
414
|
name,
|
|
410
415
|
description,
|
|
411
416
|
sort_order
|
|
417
|
+
),
|
|
418
|
+
role:project_roles(
|
|
419
|
+
id,
|
|
420
|
+
name,
|
|
421
|
+
slug,
|
|
422
|
+
color,
|
|
423
|
+
description,
|
|
424
|
+
login_hint
|
|
412
425
|
)
|
|
413
426
|
)
|
|
414
427
|
`).eq("project_id", this.config.projectId).eq("tester_id", testerInfo.id).in("status", ["pending", "in_progress"]).order("created_at", { ascending: true }).limit(100);
|
|
415
428
|
if (error) {
|
|
416
|
-
console.error("BugBear: Failed to fetch assignments", error);
|
|
429
|
+
console.error("BugBear: Failed to fetch assignments", formatPgError(error));
|
|
417
430
|
return [];
|
|
418
431
|
}
|
|
419
432
|
const mapped = (data || []).map((item) => ({
|
|
@@ -446,6 +459,14 @@ var BugBearClient = class {
|
|
|
446
459
|
name: item.test_case.group.name,
|
|
447
460
|
description: item.test_case.group.description,
|
|
448
461
|
sortOrder: item.test_case.group.sort_order
|
|
462
|
+
} : void 0,
|
|
463
|
+
role: item.test_case.role ? {
|
|
464
|
+
id: item.test_case.role.id,
|
|
465
|
+
name: item.test_case.role.name,
|
|
466
|
+
slug: item.test_case.role.slug,
|
|
467
|
+
color: item.test_case.role.color,
|
|
468
|
+
description: item.test_case.role.description,
|
|
469
|
+
loginHint: item.test_case.role.login_hint
|
|
449
470
|
} : void 0
|
|
450
471
|
}
|
|
451
472
|
}));
|
|
@@ -641,7 +662,7 @@ var BugBearClient = class {
|
|
|
641
662
|
}
|
|
642
663
|
const { error } = await this.supabase.from("test_assignments").update(updateData).eq("id", assignmentId);
|
|
643
664
|
if (error) {
|
|
644
|
-
console.error("BugBear: Failed to skip assignment", error);
|
|
665
|
+
console.error("BugBear: Failed to skip assignment", formatPgError(error));
|
|
645
666
|
return { success: false, error: error.message };
|
|
646
667
|
}
|
|
647
668
|
return { success: true };
|
|
@@ -820,7 +841,7 @@ var BugBearClient = class {
|
|
|
820
841
|
p_tester_id: testerInfo.id
|
|
821
842
|
});
|
|
822
843
|
if (error) {
|
|
823
|
-
console.error("BugBear: Failed to fetch tester stats", error);
|
|
844
|
+
console.error("BugBear: Failed to fetch tester stats", formatPgError(error));
|
|
824
845
|
return null;
|
|
825
846
|
}
|
|
826
847
|
return data;
|
|
@@ -971,7 +992,7 @@ var BugBearClient = class {
|
|
|
971
992
|
if (updates.platforms !== void 0) updateData.platforms = updates.platforms;
|
|
972
993
|
const { error } = await this.supabase.from("testers").update(updateData).eq("id", testerInfo.id);
|
|
973
994
|
if (error) {
|
|
974
|
-
console.error("BugBear: updateTesterProfile error", error);
|
|
995
|
+
console.error("BugBear: updateTesterProfile error", formatPgError(error));
|
|
975
996
|
return { success: false, error: error.message };
|
|
976
997
|
}
|
|
977
998
|
return { success: true };
|
|
@@ -993,14 +1014,14 @@ var BugBearClient = class {
|
|
|
993
1014
|
*/
|
|
994
1015
|
async isQAEnabled() {
|
|
995
1016
|
try {
|
|
996
|
-
const { data, error } = await this.supabase.
|
|
1017
|
+
const { data, error } = await this.supabase.rpc("check_qa_enabled", {
|
|
1018
|
+
p_project_id: this.config.projectId
|
|
1019
|
+
});
|
|
997
1020
|
if (error) {
|
|
998
|
-
|
|
999
|
-
console.warn("BugBear: Could not check QA status", error.message || error.code || "Unknown error");
|
|
1000
|
-
}
|
|
1021
|
+
console.warn("BugBear: Could not check QA status", error.message || error.code || "Unknown error");
|
|
1001
1022
|
return true;
|
|
1002
1023
|
}
|
|
1003
|
-
return data
|
|
1024
|
+
return data ?? true;
|
|
1004
1025
|
} catch (err) {
|
|
1005
1026
|
return true;
|
|
1006
1027
|
}
|
|
@@ -1030,7 +1051,7 @@ var BugBearClient = class {
|
|
|
1030
1051
|
upsert: false
|
|
1031
1052
|
});
|
|
1032
1053
|
if (error) {
|
|
1033
|
-
console.error("BugBear: Failed to upload screenshot", error);
|
|
1054
|
+
console.error("BugBear: Failed to upload screenshot", formatPgError(error));
|
|
1034
1055
|
return null;
|
|
1035
1056
|
}
|
|
1036
1057
|
const { data: { publicUrl } } = this.supabase.storage.from(bucket).getPublicUrl(path);
|
|
@@ -1061,7 +1082,7 @@ var BugBearClient = class {
|
|
|
1061
1082
|
upsert: false
|
|
1062
1083
|
});
|
|
1063
1084
|
if (error) {
|
|
1064
|
-
console.error("BugBear: Failed to upload image from URI", error);
|
|
1085
|
+
console.error("BugBear: Failed to upload image from URI", formatPgError(error));
|
|
1065
1086
|
return null;
|
|
1066
1087
|
}
|
|
1067
1088
|
const { data: { publicUrl } } = this.supabase.storage.from(bucket).getPublicUrl(path);
|
|
@@ -1136,7 +1157,7 @@ var BugBearClient = class {
|
|
|
1136
1157
|
}
|
|
1137
1158
|
const { data, error } = await query;
|
|
1138
1159
|
if (error) {
|
|
1139
|
-
console.error("BugBear: Failed to fetch fix requests", error);
|
|
1160
|
+
console.error("BugBear: Failed to fetch fix requests", formatPgError(error));
|
|
1140
1161
|
return [];
|
|
1141
1162
|
}
|
|
1142
1163
|
return (data || []).map((fr) => ({
|
|
@@ -1167,7 +1188,7 @@ var BugBearClient = class {
|
|
|
1167
1188
|
p_tester_id: testerInfo.id
|
|
1168
1189
|
});
|
|
1169
1190
|
if (error) {
|
|
1170
|
-
console.error("BugBear: Failed to fetch threads via RPC", error);
|
|
1191
|
+
console.error("BugBear: Failed to fetch threads via RPC", formatPgError(error));
|
|
1171
1192
|
return [];
|
|
1172
1193
|
}
|
|
1173
1194
|
if (!data || data.length === 0) return [];
|
|
@@ -1211,7 +1232,7 @@ var BugBearClient = class {
|
|
|
1211
1232
|
attachments
|
|
1212
1233
|
`).eq("thread_id", threadId).order("created_at", { ascending: true }).limit(200);
|
|
1213
1234
|
if (error) {
|
|
1214
|
-
console.error("BugBear: Failed to fetch messages", error);
|
|
1235
|
+
console.error("BugBear: Failed to fetch messages", formatPgError(error));
|
|
1215
1236
|
return [];
|
|
1216
1237
|
}
|
|
1217
1238
|
return (data || []).map((msg) => ({
|
|
@@ -1255,7 +1276,7 @@ var BugBearClient = class {
|
|
|
1255
1276
|
}
|
|
1256
1277
|
const { error } = await this.supabase.from("discussion_messages").insert(insertData);
|
|
1257
1278
|
if (error) {
|
|
1258
|
-
console.error("BugBear: Failed to send message", error);
|
|
1279
|
+
console.error("BugBear: Failed to send message", formatPgError(error));
|
|
1259
1280
|
return false;
|
|
1260
1281
|
}
|
|
1261
1282
|
await this.markThreadAsRead(threadId);
|
|
@@ -1371,7 +1392,7 @@ var BugBearClient = class {
|
|
|
1371
1392
|
p_platform: options.platform || null
|
|
1372
1393
|
});
|
|
1373
1394
|
if (error) {
|
|
1374
|
-
console.error("BugBear: Failed to start session", error);
|
|
1395
|
+
console.error("BugBear: Failed to start session", formatPgError(error));
|
|
1375
1396
|
return { success: false, error: error.message };
|
|
1376
1397
|
}
|
|
1377
1398
|
const session = await this.getSession(data);
|
|
@@ -1396,7 +1417,7 @@ var BugBearClient = class {
|
|
|
1396
1417
|
p_routes_covered: options.routesCovered || null
|
|
1397
1418
|
});
|
|
1398
1419
|
if (error) {
|
|
1399
|
-
console.error("BugBear: Failed to end session", error);
|
|
1420
|
+
console.error("BugBear: Failed to end session", formatPgError(error));
|
|
1400
1421
|
return { success: false, error: error.message };
|
|
1401
1422
|
}
|
|
1402
1423
|
const session = this.transformSession(data);
|
|
@@ -1444,7 +1465,7 @@ var BugBearClient = class {
|
|
|
1444
1465
|
if (!testerInfo) return [];
|
|
1445
1466
|
const { data, error } = await this.supabase.from("qa_sessions").select("*").eq("project_id", this.config.projectId).eq("tester_id", testerInfo.id).order("started_at", { ascending: false }).limit(limit);
|
|
1446
1467
|
if (error) {
|
|
1447
|
-
console.error("BugBear: Failed to fetch session history", error);
|
|
1468
|
+
console.error("BugBear: Failed to fetch session history", formatPgError(error));
|
|
1448
1469
|
return [];
|
|
1449
1470
|
}
|
|
1450
1471
|
return (data || []).map((s) => this.transformSession(s));
|
|
@@ -1472,7 +1493,7 @@ var BugBearClient = class {
|
|
|
1472
1493
|
p_app_context: options.appContext || null
|
|
1473
1494
|
});
|
|
1474
1495
|
if (error) {
|
|
1475
|
-
console.error("BugBear: Failed to add finding", error);
|
|
1496
|
+
console.error("BugBear: Failed to add finding", formatPgError(error));
|
|
1476
1497
|
return { success: false, error: error.message };
|
|
1477
1498
|
}
|
|
1478
1499
|
const finding = this.transformFinding(data);
|
|
@@ -1490,7 +1511,7 @@ var BugBearClient = class {
|
|
|
1490
1511
|
try {
|
|
1491
1512
|
const { data, error } = await this.supabase.from("qa_findings").select("*").eq("session_id", sessionId).order("created_at", { ascending: true }).limit(100);
|
|
1492
1513
|
if (error) {
|
|
1493
|
-
console.error("BugBear: Failed to fetch findings", error);
|
|
1514
|
+
console.error("BugBear: Failed to fetch findings", formatPgError(error));
|
|
1494
1515
|
return [];
|
|
1495
1516
|
}
|
|
1496
1517
|
return (data || []).map((f) => this.transformFinding(f));
|
|
@@ -1508,7 +1529,7 @@ var BugBearClient = class {
|
|
|
1508
1529
|
p_finding_id: findingId
|
|
1509
1530
|
});
|
|
1510
1531
|
if (error) {
|
|
1511
|
-
console.error("BugBear: Failed to convert finding", error);
|
|
1532
|
+
console.error("BugBear: Failed to convert finding", formatPgError(error));
|
|
1512
1533
|
return { success: false, error: error.message };
|
|
1513
1534
|
}
|
|
1514
1535
|
return { success: true, bugId: data };
|
|
@@ -1529,7 +1550,7 @@ var BugBearClient = class {
|
|
|
1529
1550
|
dismissed_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1530
1551
|
}).eq("id", findingId);
|
|
1531
1552
|
if (error) {
|
|
1532
|
-
console.error("BugBear: Failed to dismiss finding", error);
|
|
1553
|
+
console.error("BugBear: Failed to dismiss finding", formatPgError(error));
|
|
1533
1554
|
return { success: false, error: error.message };
|
|
1534
1555
|
}
|
|
1535
1556
|
return { success: true };
|