@bbearai/core 0.1.4 → 0.1.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.d.mts +24 -1
- package/dist/index.d.ts +24 -1
- package/dist/index.js +36 -7
- package/dist/index.mjs +36 -7
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -217,9 +217,24 @@ interface TesterInfo {
|
|
|
217
217
|
id: string;
|
|
218
218
|
name: string;
|
|
219
219
|
email: string;
|
|
220
|
+
/** Additional email addresses for testing on different accounts */
|
|
221
|
+
additionalEmails: string[];
|
|
222
|
+
/** URL to profile photo/avatar */
|
|
223
|
+
avatarUrl?: string;
|
|
224
|
+
/** Testing platforms (ios, android, web) */
|
|
225
|
+
platforms: string[];
|
|
220
226
|
assignedTests: number;
|
|
221
227
|
completedTests: number;
|
|
222
228
|
}
|
|
229
|
+
interface TesterProfileUpdate {
|
|
230
|
+
name?: string;
|
|
231
|
+
/** Additional email addresses for testing */
|
|
232
|
+
additionalEmails?: string[];
|
|
233
|
+
/** URL to profile photo/avatar */
|
|
234
|
+
avatarUrl?: string;
|
|
235
|
+
/** Testing platforms */
|
|
236
|
+
platforms?: string[];
|
|
237
|
+
}
|
|
223
238
|
type ThreadType = 'announcement' | 'direct' | 'report' | 'general_note';
|
|
224
239
|
type ThreadPriority = 'low' | 'normal' | 'high' | 'urgent';
|
|
225
240
|
type MessageSenderType = 'admin' | 'tester';
|
|
@@ -291,6 +306,14 @@ declare class BugBearClient {
|
|
|
291
306
|
* Looks up tester by email from the host app's authenticated user
|
|
292
307
|
*/
|
|
293
308
|
getTesterInfo(): Promise<TesterInfo | null>;
|
|
309
|
+
/**
|
|
310
|
+
* Update tester profile
|
|
311
|
+
* Allows testers to update their name, additional emails, avatar, and platforms
|
|
312
|
+
*/
|
|
313
|
+
updateTesterProfile(updates: TesterProfileUpdate): Promise<{
|
|
314
|
+
success: boolean;
|
|
315
|
+
error?: string;
|
|
316
|
+
}>;
|
|
294
317
|
/**
|
|
295
318
|
* Check if current user is a tester for this project
|
|
296
319
|
*/
|
|
@@ -444,4 +467,4 @@ declare function captureError(error: Error, errorInfo?: {
|
|
|
444
467
|
componentStack?: string;
|
|
445
468
|
};
|
|
446
469
|
|
|
447
|
-
export { type AppContext, BugBearClient, type BugBearConfig, type BugBearReport, type BugBearTheme, type ChecklistResult, type ConsoleLogEntry, type DeviceInfo, type EnhancedBugContext, type HostUserInfo, type MessageSenderType, type NetworkRequest, type QATrack, type ReportStatus, type ReportType, type RubricMode, type RubricResult, type Severity, type TestAssignment, type TestResult, type TestStep, type TestTemplate, type TesterInfo, type TesterMessage, type TesterThread, type ThreadPriority, type ThreadType, captureError, contextCapture, createBugBear };
|
|
470
|
+
export { type AppContext, BugBearClient, type BugBearConfig, type BugBearReport, type BugBearTheme, type ChecklistResult, type ConsoleLogEntry, type DeviceInfo, type EnhancedBugContext, type HostUserInfo, type MessageSenderType, type NetworkRequest, type QATrack, type ReportStatus, type ReportType, type RubricMode, type RubricResult, type Severity, type TestAssignment, 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
|
@@ -217,9 +217,24 @@ interface TesterInfo {
|
|
|
217
217
|
id: string;
|
|
218
218
|
name: string;
|
|
219
219
|
email: string;
|
|
220
|
+
/** Additional email addresses for testing on different accounts */
|
|
221
|
+
additionalEmails: string[];
|
|
222
|
+
/** URL to profile photo/avatar */
|
|
223
|
+
avatarUrl?: string;
|
|
224
|
+
/** Testing platforms (ios, android, web) */
|
|
225
|
+
platforms: string[];
|
|
220
226
|
assignedTests: number;
|
|
221
227
|
completedTests: number;
|
|
222
228
|
}
|
|
229
|
+
interface TesterProfileUpdate {
|
|
230
|
+
name?: string;
|
|
231
|
+
/** Additional email addresses for testing */
|
|
232
|
+
additionalEmails?: string[];
|
|
233
|
+
/** URL to profile photo/avatar */
|
|
234
|
+
avatarUrl?: string;
|
|
235
|
+
/** Testing platforms */
|
|
236
|
+
platforms?: string[];
|
|
237
|
+
}
|
|
223
238
|
type ThreadType = 'announcement' | 'direct' | 'report' | 'general_note';
|
|
224
239
|
type ThreadPriority = 'low' | 'normal' | 'high' | 'urgent';
|
|
225
240
|
type MessageSenderType = 'admin' | 'tester';
|
|
@@ -291,6 +306,14 @@ declare class BugBearClient {
|
|
|
291
306
|
* Looks up tester by email from the host app's authenticated user
|
|
292
307
|
*/
|
|
293
308
|
getTesterInfo(): Promise<TesterInfo | null>;
|
|
309
|
+
/**
|
|
310
|
+
* Update tester profile
|
|
311
|
+
* Allows testers to update their name, additional emails, avatar, and platforms
|
|
312
|
+
*/
|
|
313
|
+
updateTesterProfile(updates: TesterProfileUpdate): Promise<{
|
|
314
|
+
success: boolean;
|
|
315
|
+
error?: string;
|
|
316
|
+
}>;
|
|
294
317
|
/**
|
|
295
318
|
* Check if current user is a tester for this project
|
|
296
319
|
*/
|
|
@@ -444,4 +467,4 @@ declare function captureError(error: Error, errorInfo?: {
|
|
|
444
467
|
componentStack?: string;
|
|
445
468
|
};
|
|
446
469
|
|
|
447
|
-
export { type AppContext, BugBearClient, type BugBearConfig, type BugBearReport, type BugBearTheme, type ChecklistResult, type ConsoleLogEntry, type DeviceInfo, type EnhancedBugContext, type HostUserInfo, type MessageSenderType, type NetworkRequest, type QATrack, type ReportStatus, type ReportType, type RubricMode, type RubricResult, type Severity, type TestAssignment, type TestResult, type TestStep, type TestTemplate, type TesterInfo, type TesterMessage, type TesterThread, type ThreadPriority, type ThreadType, captureError, contextCapture, createBugBear };
|
|
470
|
+
export { type AppContext, BugBearClient, type BugBearConfig, type BugBearReport, type BugBearTheme, type ChecklistResult, type ConsoleLogEntry, type DeviceInfo, type EnhancedBugContext, type HostUserInfo, type MessageSenderType, type NetworkRequest, type QATrack, type ReportStatus, type ReportType, type RubricMode, type RubricResult, type Severity, type TestAssignment, 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
|
@@ -203,6 +203,9 @@ var BugBearClient = class {
|
|
|
203
203
|
id: data.id,
|
|
204
204
|
name: data.name,
|
|
205
205
|
email: data.email,
|
|
206
|
+
additionalEmails: data.additional_emails || [],
|
|
207
|
+
avatarUrl: data.avatar_url || void 0,
|
|
208
|
+
platforms: data.platforms || [],
|
|
206
209
|
assignedTests: data.assigned_count || 0,
|
|
207
210
|
completedTests: data.completed_count || 0
|
|
208
211
|
};
|
|
@@ -211,6 +214,32 @@ var BugBearClient = class {
|
|
|
211
214
|
return null;
|
|
212
215
|
}
|
|
213
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* Update tester profile
|
|
219
|
+
* Allows testers to update their name, additional emails, avatar, and platforms
|
|
220
|
+
*/
|
|
221
|
+
async updateTesterProfile(updates) {
|
|
222
|
+
try {
|
|
223
|
+
const userInfo = await this.getCurrentUserInfo();
|
|
224
|
+
if (!userInfo) {
|
|
225
|
+
return { success: false, error: "Not authenticated" };
|
|
226
|
+
}
|
|
227
|
+
const updateData = {};
|
|
228
|
+
if (updates.name !== void 0) updateData.name = updates.name;
|
|
229
|
+
if (updates.additionalEmails !== void 0) updateData.additional_emails = updates.additionalEmails;
|
|
230
|
+
if (updates.avatarUrl !== void 0) updateData.avatar_url = updates.avatarUrl;
|
|
231
|
+
if (updates.platforms !== void 0) updateData.platforms = updates.platforms;
|
|
232
|
+
const { error } = await this.supabase.from("testers").update(updateData).eq("project_id", this.config.projectId).eq("email", userInfo.email);
|
|
233
|
+
if (error) {
|
|
234
|
+
console.error("BugBear: updateTesterProfile error", error);
|
|
235
|
+
return { success: false, error: error.message };
|
|
236
|
+
}
|
|
237
|
+
return { success: true };
|
|
238
|
+
} catch (err) {
|
|
239
|
+
console.error("BugBear: updateTesterProfile error", err);
|
|
240
|
+
return { success: false, error: "Failed to update profile" };
|
|
241
|
+
}
|
|
242
|
+
}
|
|
214
243
|
/**
|
|
215
244
|
* Check if current user is a tester for this project
|
|
216
245
|
*/
|
|
@@ -479,8 +508,7 @@ var BugBearClient = class {
|
|
|
479
508
|
const { error } = await this.supabase.from("discussion_messages").insert({
|
|
480
509
|
thread_id: threadId,
|
|
481
510
|
sender_type: "tester",
|
|
482
|
-
|
|
483
|
-
sender_name: testerInfo.name,
|
|
511
|
+
sender_tester_id: testerInfo.id,
|
|
484
512
|
content
|
|
485
513
|
});
|
|
486
514
|
if (error) {
|
|
@@ -541,11 +569,13 @@ var BugBearClient = class {
|
|
|
541
569
|
subject: options.subject,
|
|
542
570
|
thread_type: options.threadType || "direct",
|
|
543
571
|
priority: "normal",
|
|
544
|
-
audience: "
|
|
545
|
-
// Tester-initiated
|
|
572
|
+
audience: "individual",
|
|
573
|
+
// Tester-initiated thread visible to this tester
|
|
546
574
|
audience_tester_ids: [testerInfo.id],
|
|
547
575
|
// Include the tester so they can see it
|
|
548
|
-
|
|
576
|
+
created_by_admin: false,
|
|
577
|
+
// Created by tester, not admin
|
|
578
|
+
created_by_id: testerInfo.id,
|
|
549
579
|
last_message_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
550
580
|
}).select("id").single();
|
|
551
581
|
if (threadError) {
|
|
@@ -555,8 +585,7 @@ var BugBearClient = class {
|
|
|
555
585
|
const { error: messageError } = await this.supabase.from("discussion_messages").insert({
|
|
556
586
|
thread_id: thread.id,
|
|
557
587
|
sender_type: "tester",
|
|
558
|
-
|
|
559
|
-
sender_name: testerInfo.name,
|
|
588
|
+
sender_tester_id: testerInfo.id,
|
|
560
589
|
content: options.message
|
|
561
590
|
});
|
|
562
591
|
if (messageError) {
|
package/dist/index.mjs
CHANGED
|
@@ -174,6 +174,9 @@ var BugBearClient = class {
|
|
|
174
174
|
id: data.id,
|
|
175
175
|
name: data.name,
|
|
176
176
|
email: data.email,
|
|
177
|
+
additionalEmails: data.additional_emails || [],
|
|
178
|
+
avatarUrl: data.avatar_url || void 0,
|
|
179
|
+
platforms: data.platforms || [],
|
|
177
180
|
assignedTests: data.assigned_count || 0,
|
|
178
181
|
completedTests: data.completed_count || 0
|
|
179
182
|
};
|
|
@@ -182,6 +185,32 @@ var BugBearClient = class {
|
|
|
182
185
|
return null;
|
|
183
186
|
}
|
|
184
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* Update tester profile
|
|
190
|
+
* Allows testers to update their name, additional emails, avatar, and platforms
|
|
191
|
+
*/
|
|
192
|
+
async updateTesterProfile(updates) {
|
|
193
|
+
try {
|
|
194
|
+
const userInfo = await this.getCurrentUserInfo();
|
|
195
|
+
if (!userInfo) {
|
|
196
|
+
return { success: false, error: "Not authenticated" };
|
|
197
|
+
}
|
|
198
|
+
const updateData = {};
|
|
199
|
+
if (updates.name !== void 0) updateData.name = updates.name;
|
|
200
|
+
if (updates.additionalEmails !== void 0) updateData.additional_emails = updates.additionalEmails;
|
|
201
|
+
if (updates.avatarUrl !== void 0) updateData.avatar_url = updates.avatarUrl;
|
|
202
|
+
if (updates.platforms !== void 0) updateData.platforms = updates.platforms;
|
|
203
|
+
const { error } = await this.supabase.from("testers").update(updateData).eq("project_id", this.config.projectId).eq("email", userInfo.email);
|
|
204
|
+
if (error) {
|
|
205
|
+
console.error("BugBear: updateTesterProfile error", error);
|
|
206
|
+
return { success: false, error: error.message };
|
|
207
|
+
}
|
|
208
|
+
return { success: true };
|
|
209
|
+
} catch (err) {
|
|
210
|
+
console.error("BugBear: updateTesterProfile error", err);
|
|
211
|
+
return { success: false, error: "Failed to update profile" };
|
|
212
|
+
}
|
|
213
|
+
}
|
|
185
214
|
/**
|
|
186
215
|
* Check if current user is a tester for this project
|
|
187
216
|
*/
|
|
@@ -450,8 +479,7 @@ var BugBearClient = class {
|
|
|
450
479
|
const { error } = await this.supabase.from("discussion_messages").insert({
|
|
451
480
|
thread_id: threadId,
|
|
452
481
|
sender_type: "tester",
|
|
453
|
-
|
|
454
|
-
sender_name: testerInfo.name,
|
|
482
|
+
sender_tester_id: testerInfo.id,
|
|
455
483
|
content
|
|
456
484
|
});
|
|
457
485
|
if (error) {
|
|
@@ -512,11 +540,13 @@ var BugBearClient = class {
|
|
|
512
540
|
subject: options.subject,
|
|
513
541
|
thread_type: options.threadType || "direct",
|
|
514
542
|
priority: "normal",
|
|
515
|
-
audience: "
|
|
516
|
-
// Tester-initiated
|
|
543
|
+
audience: "individual",
|
|
544
|
+
// Tester-initiated thread visible to this tester
|
|
517
545
|
audience_tester_ids: [testerInfo.id],
|
|
518
546
|
// Include the tester so they can see it
|
|
519
|
-
|
|
547
|
+
created_by_admin: false,
|
|
548
|
+
// Created by tester, not admin
|
|
549
|
+
created_by_id: testerInfo.id,
|
|
520
550
|
last_message_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
521
551
|
}).select("id").single();
|
|
522
552
|
if (threadError) {
|
|
@@ -526,8 +556,7 @@ var BugBearClient = class {
|
|
|
526
556
|
const { error: messageError } = await this.supabase.from("discussion_messages").insert({
|
|
527
557
|
thread_id: thread.id,
|
|
528
558
|
sender_type: "tester",
|
|
529
|
-
|
|
530
|
-
sender_name: testerInfo.name,
|
|
559
|
+
sender_tester_id: testerInfo.id,
|
|
531
560
|
content: options.message
|
|
532
561
|
});
|
|
533
562
|
if (messageError) {
|