@bbearai/react-native 0.5.1 → 0.5.2
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 +66 -0
- package/dist/index.mjs +66 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12247,6 +12247,72 @@ var BugBearClient = class {
|
|
|
12247
12247
|
return null;
|
|
12248
12248
|
}
|
|
12249
12249
|
}
|
|
12250
|
+
/**
|
|
12251
|
+
* Get issue counts for the tester (Open, Done, Reopened)
|
|
12252
|
+
* Used by the widget HomeScreen cards
|
|
12253
|
+
*/
|
|
12254
|
+
async getIssueCounts() {
|
|
12255
|
+
try {
|
|
12256
|
+
const testerInfo = await this.getTesterInfo();
|
|
12257
|
+
if (!testerInfo) return { open: 0, done: 0, reopened: 0 };
|
|
12258
|
+
const { data, error } = await this.supabase.rpc("get_tester_issue_counts", {
|
|
12259
|
+
p_project_id: this.config.projectId,
|
|
12260
|
+
p_tester_id: testerInfo.id
|
|
12261
|
+
});
|
|
12262
|
+
if (error) {
|
|
12263
|
+
console.error("BugBear: Failed to fetch issue counts", formatPgError(error));
|
|
12264
|
+
return { open: 0, done: 0, reopened: 0 };
|
|
12265
|
+
}
|
|
12266
|
+
return {
|
|
12267
|
+
open: data?.open ?? 0,
|
|
12268
|
+
done: data?.done ?? 0,
|
|
12269
|
+
reopened: data?.reopened ?? 0
|
|
12270
|
+
};
|
|
12271
|
+
} catch (err) {
|
|
12272
|
+
console.error("BugBear: Error fetching issue counts", err);
|
|
12273
|
+
return { open: 0, done: 0, reopened: 0 };
|
|
12274
|
+
}
|
|
12275
|
+
}
|
|
12276
|
+
/**
|
|
12277
|
+
* Get issues for the tester by category.
|
|
12278
|
+
* Returns enriched data: done issues include verification proof,
|
|
12279
|
+
* reopened issues include original bug context.
|
|
12280
|
+
*/
|
|
12281
|
+
async getIssues(category) {
|
|
12282
|
+
try {
|
|
12283
|
+
const testerInfo = await this.getTesterInfo();
|
|
12284
|
+
if (!testerInfo) return [];
|
|
12285
|
+
const { data, error } = await this.supabase.rpc("get_tester_issues", {
|
|
12286
|
+
p_project_id: this.config.projectId,
|
|
12287
|
+
p_tester_id: testerInfo.id,
|
|
12288
|
+
p_category: category
|
|
12289
|
+
});
|
|
12290
|
+
if (error) {
|
|
12291
|
+
console.error("BugBear: Failed to fetch issues", formatPgError(error));
|
|
12292
|
+
return [];
|
|
12293
|
+
}
|
|
12294
|
+
return (data || []).map((row) => ({
|
|
12295
|
+
id: row.id,
|
|
12296
|
+
title: row.title || "Untitled",
|
|
12297
|
+
description: row.description,
|
|
12298
|
+
reportType: row.report_type,
|
|
12299
|
+
severity: row.severity || null,
|
|
12300
|
+
status: row.status,
|
|
12301
|
+
screenshotUrls: row.screenshot_urls || [],
|
|
12302
|
+
route: row.app_context?.currentRoute || void 0,
|
|
12303
|
+
reporterName: row.reporter_name || void 0,
|
|
12304
|
+
createdAt: row.created_at,
|
|
12305
|
+
updatedAt: row.updated_at,
|
|
12306
|
+
verifiedByName: row.verified_by_name || void 0,
|
|
12307
|
+
verifiedAt: row.verified_at || void 0,
|
|
12308
|
+
originalBugId: row.original_bug_id || void 0,
|
|
12309
|
+
originalBugTitle: row.original_bug_title || void 0
|
|
12310
|
+
}));
|
|
12311
|
+
} catch (err) {
|
|
12312
|
+
console.error("BugBear: Error fetching issues", err);
|
|
12313
|
+
return [];
|
|
12314
|
+
}
|
|
12315
|
+
}
|
|
12250
12316
|
/**
|
|
12251
12317
|
* Basic email format validation (defense in depth)
|
|
12252
12318
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -12214,6 +12214,72 @@ var BugBearClient = class {
|
|
|
12214
12214
|
return null;
|
|
12215
12215
|
}
|
|
12216
12216
|
}
|
|
12217
|
+
/**
|
|
12218
|
+
* Get issue counts for the tester (Open, Done, Reopened)
|
|
12219
|
+
* Used by the widget HomeScreen cards
|
|
12220
|
+
*/
|
|
12221
|
+
async getIssueCounts() {
|
|
12222
|
+
try {
|
|
12223
|
+
const testerInfo = await this.getTesterInfo();
|
|
12224
|
+
if (!testerInfo) return { open: 0, done: 0, reopened: 0 };
|
|
12225
|
+
const { data, error } = await this.supabase.rpc("get_tester_issue_counts", {
|
|
12226
|
+
p_project_id: this.config.projectId,
|
|
12227
|
+
p_tester_id: testerInfo.id
|
|
12228
|
+
});
|
|
12229
|
+
if (error) {
|
|
12230
|
+
console.error("BugBear: Failed to fetch issue counts", formatPgError(error));
|
|
12231
|
+
return { open: 0, done: 0, reopened: 0 };
|
|
12232
|
+
}
|
|
12233
|
+
return {
|
|
12234
|
+
open: data?.open ?? 0,
|
|
12235
|
+
done: data?.done ?? 0,
|
|
12236
|
+
reopened: data?.reopened ?? 0
|
|
12237
|
+
};
|
|
12238
|
+
} catch (err) {
|
|
12239
|
+
console.error("BugBear: Error fetching issue counts", err);
|
|
12240
|
+
return { open: 0, done: 0, reopened: 0 };
|
|
12241
|
+
}
|
|
12242
|
+
}
|
|
12243
|
+
/**
|
|
12244
|
+
* Get issues for the tester by category.
|
|
12245
|
+
* Returns enriched data: done issues include verification proof,
|
|
12246
|
+
* reopened issues include original bug context.
|
|
12247
|
+
*/
|
|
12248
|
+
async getIssues(category) {
|
|
12249
|
+
try {
|
|
12250
|
+
const testerInfo = await this.getTesterInfo();
|
|
12251
|
+
if (!testerInfo) return [];
|
|
12252
|
+
const { data, error } = await this.supabase.rpc("get_tester_issues", {
|
|
12253
|
+
p_project_id: this.config.projectId,
|
|
12254
|
+
p_tester_id: testerInfo.id,
|
|
12255
|
+
p_category: category
|
|
12256
|
+
});
|
|
12257
|
+
if (error) {
|
|
12258
|
+
console.error("BugBear: Failed to fetch issues", formatPgError(error));
|
|
12259
|
+
return [];
|
|
12260
|
+
}
|
|
12261
|
+
return (data || []).map((row) => ({
|
|
12262
|
+
id: row.id,
|
|
12263
|
+
title: row.title || "Untitled",
|
|
12264
|
+
description: row.description,
|
|
12265
|
+
reportType: row.report_type,
|
|
12266
|
+
severity: row.severity || null,
|
|
12267
|
+
status: row.status,
|
|
12268
|
+
screenshotUrls: row.screenshot_urls || [],
|
|
12269
|
+
route: row.app_context?.currentRoute || void 0,
|
|
12270
|
+
reporterName: row.reporter_name || void 0,
|
|
12271
|
+
createdAt: row.created_at,
|
|
12272
|
+
updatedAt: row.updated_at,
|
|
12273
|
+
verifiedByName: row.verified_by_name || void 0,
|
|
12274
|
+
verifiedAt: row.verified_at || void 0,
|
|
12275
|
+
originalBugId: row.original_bug_id || void 0,
|
|
12276
|
+
originalBugTitle: row.original_bug_title || void 0
|
|
12277
|
+
}));
|
|
12278
|
+
} catch (err) {
|
|
12279
|
+
console.error("BugBear: Error fetching issues", err);
|
|
12280
|
+
return [];
|
|
12281
|
+
}
|
|
12282
|
+
}
|
|
12217
12283
|
/**
|
|
12218
12284
|
* Basic email format validation (defense in depth)
|
|
12219
12285
|
*/
|