@bbearai/core 0.4.5 → 0.4.6
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.js +17 -1
- package/dist/index.mjs +17 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -475,7 +475,13 @@ var BugBearClient = class {
|
|
|
475
475
|
console.error("BugBear: Failed to fetch assignments", formatPgError(error));
|
|
476
476
|
return [];
|
|
477
477
|
}
|
|
478
|
-
const mapped = (data || []).
|
|
478
|
+
const mapped = (data || []).filter((item) => {
|
|
479
|
+
if (!item.test_case) {
|
|
480
|
+
console.warn("BugBear: Assignment returned without test_case", { id: item.id });
|
|
481
|
+
return false;
|
|
482
|
+
}
|
|
483
|
+
return true;
|
|
484
|
+
}).map((item) => ({
|
|
479
485
|
id: item.id,
|
|
480
486
|
status: item.status,
|
|
481
487
|
startedAt: item.started_at,
|
|
@@ -732,6 +738,16 @@ var BugBearClient = class {
|
|
|
732
738
|
if (feedback.rating < 1 || feedback.rating > 5) {
|
|
733
739
|
return { success: false, error: "Rating must be between 1 and 5" };
|
|
734
740
|
}
|
|
741
|
+
const optionalRatings = [
|
|
742
|
+
{ name: "clarityRating", value: feedback.clarityRating },
|
|
743
|
+
{ name: "stepsRating", value: feedback.stepsRating },
|
|
744
|
+
{ name: "relevanceRating", value: feedback.relevanceRating }
|
|
745
|
+
];
|
|
746
|
+
for (const { name, value } of optionalRatings) {
|
|
747
|
+
if (value !== void 0 && value !== null && (value < 1 || value > 5)) {
|
|
748
|
+
return { success: false, error: `${name} must be between 1 and 5` };
|
|
749
|
+
}
|
|
750
|
+
}
|
|
735
751
|
const { error: feedbackError } = await this.supabase.from("test_feedback").insert({
|
|
736
752
|
project_id: this.config.projectId,
|
|
737
753
|
test_case_id: testCaseId,
|
package/dist/index.mjs
CHANGED
|
@@ -444,7 +444,13 @@ var BugBearClient = class {
|
|
|
444
444
|
console.error("BugBear: Failed to fetch assignments", formatPgError(error));
|
|
445
445
|
return [];
|
|
446
446
|
}
|
|
447
|
-
const mapped = (data || []).
|
|
447
|
+
const mapped = (data || []).filter((item) => {
|
|
448
|
+
if (!item.test_case) {
|
|
449
|
+
console.warn("BugBear: Assignment returned without test_case", { id: item.id });
|
|
450
|
+
return false;
|
|
451
|
+
}
|
|
452
|
+
return true;
|
|
453
|
+
}).map((item) => ({
|
|
448
454
|
id: item.id,
|
|
449
455
|
status: item.status,
|
|
450
456
|
startedAt: item.started_at,
|
|
@@ -701,6 +707,16 @@ var BugBearClient = class {
|
|
|
701
707
|
if (feedback.rating < 1 || feedback.rating > 5) {
|
|
702
708
|
return { success: false, error: "Rating must be between 1 and 5" };
|
|
703
709
|
}
|
|
710
|
+
const optionalRatings = [
|
|
711
|
+
{ name: "clarityRating", value: feedback.clarityRating },
|
|
712
|
+
{ name: "stepsRating", value: feedback.stepsRating },
|
|
713
|
+
{ name: "relevanceRating", value: feedback.relevanceRating }
|
|
714
|
+
];
|
|
715
|
+
for (const { name, value } of optionalRatings) {
|
|
716
|
+
if (value !== void 0 && value !== null && (value < 1 || value > 5)) {
|
|
717
|
+
return { success: false, error: `${name} must be between 1 and 5` };
|
|
718
|
+
}
|
|
719
|
+
}
|
|
704
720
|
const { error: feedbackError } = await this.supabase.from("test_feedback").insert({
|
|
705
721
|
project_id: this.config.projectId,
|
|
706
722
|
test_case_id: testCaseId,
|