@testerpaykit/api-client 1.2.0 → 1.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 CHANGED
@@ -1,4 +1,4 @@
1
- import { TokenManager, IApiClient, LoginRequest, LoginResponse, WeeklySummary, VoiceBugExtractResponse } from '@testerpaykit/core';
1
+ import { TokenManager, IApiClient, LoginRequest, LoginResponse, WeeklySummary, RemoteAiSession, VoiceBugExtractResponse } from '@testerpaykit/core';
2
2
 
3
3
  interface ApiClientConfig {
4
4
  baseURL?: string;
@@ -140,6 +140,11 @@ declare class TesterPayKitApiClient implements IApiClient {
140
140
  markNotificationsRead(params?: {
141
141
  id?: string;
142
142
  }): Promise<number>;
143
+ /**
144
+ * Claim a remote AI-tester run waiting for this project.
145
+ * POST /v1/testers/me/ai-sessions/claim — 204 → null.
146
+ */
147
+ claimRemoteAiSession(projectId: string): Promise<RemoteAiSession | null>;
143
148
  /**
144
149
  * Attach a file (screenshot, log, voice note) to an already-
145
150
  * submitted bug report. Hits POST /v1/testers/me/bug-reports/
@@ -287,14 +292,15 @@ declare class TesterPayKitApiClient implements IApiClient {
287
292
  }): Promise<RetestItem[]>;
288
293
  /**
289
294
  * POST /v1/testers/me/retests/{bugId}/verify
290
- * Mark a retest as verified (bug is fixed).
295
+ * Mark a retest as verified (bug is fixed). With stepVerdicts the API
296
+ * only verifies when every acceptance step passed.
291
297
  */
292
- verifyRetest(bugId: string): Promise<void>;
298
+ verifyRetest(bugId: string, stepVerdicts?: RetestStepVerdicts): Promise<void>;
293
299
  /**
294
300
  * POST /v1/testers/me/retests/{bugId}/reopen
295
301
  * Reopen a retest (bug is still present), optionally with a reason.
296
302
  */
297
- reopenRetest(bugId: string, reason?: string): Promise<void>;
303
+ reopenRetest(bugId: string, reason?: string, stepVerdicts?: RetestStepVerdicts): Promise<void>;
298
304
  /**
299
305
  * POST /v1/testers/me/bug-reports/voice-extract
300
306
  * Contract: wire.bug_reports.voiceExtractBugFields
@@ -476,6 +482,16 @@ interface TesterSessionResponse {
476
482
  tester_id?: string;
477
483
  started_at?: string;
478
484
  ended_at?: string | null;
485
+ /** Set when the API knows a newer SDK release than the one reported. */
486
+ sdkUpdate?: SdkUpdateInfo;
487
+ }
488
+ /** A newer TesterPayKit SDK is out (from the session-start response). */
489
+ interface SdkUpdateInfo {
490
+ package: string;
491
+ current: string;
492
+ latest: string;
493
+ /** Command to run in the app's folder. */
494
+ command: string;
479
495
  }
480
496
  type TesterSessionEndReason = 'completed' | 'lifecycle_flush' | 'timeout' | 'abandoned';
481
497
  interface EndTesterSessionInput {
@@ -656,7 +672,14 @@ interface RetestItem {
656
672
  createdAt: string;
657
673
  projectId: string;
658
674
  screenshotPath?: string | null;
675
+ /**
676
+ * Steps that prove the fix; the last one states the expected behaviour.
677
+ * Judge each and pass the verdicts to verifyRetest / reopenRetest.
678
+ */
679
+ acceptanceSteps?: string[];
659
680
  }
681
+ /** Verdict per acceptance step (1-based step number → passed). */
682
+ type RetestStepVerdicts = Record<number, boolean>;
660
683
  /** A task preset from GET /v1/tasks */
661
684
  interface TaskPreset {
662
685
  id: string;
@@ -681,4 +704,5 @@ interface TaskStep {
681
704
  estimatedMinutes?: number | null;
682
705
  }
683
706
 
684
- export { type AnonymousLoginResponse, type ApiClientConfig, type BugCategory, type BugReportAttachmentInput, type BugReportAttachmentResponse, type BugReportPayload, type BugReportResponse, type BugReportType, type BugSeverity, type EarningsSummary, type EndTesterSessionInput, type EnrollmentResponse, type FeedbackResponse, type KnowledgeBaseAnswer, type KnowledgeBaseCitation, type KnowledgeFile, type KnowledgeFileSummary, type MyBugReportSummary, type MyBugReportsResponse, type NotificationsResult, type PayoutRecord, type RegisterDeviceInput, type RetestItem, type SessionBreadcrumbInput, type SessionBreadcrumbsResponse, type SessionEventInput, type SessionEventsResponse, type StartTesterSessionInput, type SubmissionResponse, type TaskListFilter, type TaskListResponse, type TaskPreset, type TaskStep, type TesterDeviceResponse, TesterPayKitApiClient, type TesterPoints, type TesterProfile, type TesterSessionEndReason, type TesterSessionResponse, type TesterTask, type TpkNotification };
707
+ export { TesterPayKitApiClient };
708
+ export type { AnonymousLoginResponse, ApiClientConfig, BugCategory, BugReportAttachmentInput, BugReportAttachmentResponse, BugReportPayload, BugReportResponse, BugReportType, BugSeverity, EarningsSummary, EndTesterSessionInput, EnrollmentResponse, FeedbackResponse, KnowledgeBaseAnswer, KnowledgeBaseCitation, KnowledgeFile, KnowledgeFileSummary, MyBugReportSummary, MyBugReportsResponse, NotificationsResult, PayoutRecord, RegisterDeviceInput, RetestItem, RetestStepVerdicts, SdkUpdateInfo, SessionBreadcrumbInput, SessionBreadcrumbsResponse, SessionEventInput, SessionEventsResponse, StartTesterSessionInput, SubmissionResponse, TaskListFilter, TaskListResponse, TaskPreset, TaskStep, TesterDeviceResponse, TesterPoints, TesterProfile, TesterSessionEndReason, TesterSessionResponse, TesterTask, TpkNotification };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { TokenManager, IApiClient, LoginRequest, LoginResponse, WeeklySummary, VoiceBugExtractResponse } from '@testerpaykit/core';
1
+ import { TokenManager, IApiClient, LoginRequest, LoginResponse, WeeklySummary, RemoteAiSession, VoiceBugExtractResponse } from '@testerpaykit/core';
2
2
 
3
3
  interface ApiClientConfig {
4
4
  baseURL?: string;
@@ -140,6 +140,11 @@ declare class TesterPayKitApiClient implements IApiClient {
140
140
  markNotificationsRead(params?: {
141
141
  id?: string;
142
142
  }): Promise<number>;
143
+ /**
144
+ * Claim a remote AI-tester run waiting for this project.
145
+ * POST /v1/testers/me/ai-sessions/claim — 204 → null.
146
+ */
147
+ claimRemoteAiSession(projectId: string): Promise<RemoteAiSession | null>;
143
148
  /**
144
149
  * Attach a file (screenshot, log, voice note) to an already-
145
150
  * submitted bug report. Hits POST /v1/testers/me/bug-reports/
@@ -287,14 +292,15 @@ declare class TesterPayKitApiClient implements IApiClient {
287
292
  }): Promise<RetestItem[]>;
288
293
  /**
289
294
  * POST /v1/testers/me/retests/{bugId}/verify
290
- * Mark a retest as verified (bug is fixed).
295
+ * Mark a retest as verified (bug is fixed). With stepVerdicts the API
296
+ * only verifies when every acceptance step passed.
291
297
  */
292
- verifyRetest(bugId: string): Promise<void>;
298
+ verifyRetest(bugId: string, stepVerdicts?: RetestStepVerdicts): Promise<void>;
293
299
  /**
294
300
  * POST /v1/testers/me/retests/{bugId}/reopen
295
301
  * Reopen a retest (bug is still present), optionally with a reason.
296
302
  */
297
- reopenRetest(bugId: string, reason?: string): Promise<void>;
303
+ reopenRetest(bugId: string, reason?: string, stepVerdicts?: RetestStepVerdicts): Promise<void>;
298
304
  /**
299
305
  * POST /v1/testers/me/bug-reports/voice-extract
300
306
  * Contract: wire.bug_reports.voiceExtractBugFields
@@ -476,6 +482,16 @@ interface TesterSessionResponse {
476
482
  tester_id?: string;
477
483
  started_at?: string;
478
484
  ended_at?: string | null;
485
+ /** Set when the API knows a newer SDK release than the one reported. */
486
+ sdkUpdate?: SdkUpdateInfo;
487
+ }
488
+ /** A newer TesterPayKit SDK is out (from the session-start response). */
489
+ interface SdkUpdateInfo {
490
+ package: string;
491
+ current: string;
492
+ latest: string;
493
+ /** Command to run in the app's folder. */
494
+ command: string;
479
495
  }
480
496
  type TesterSessionEndReason = 'completed' | 'lifecycle_flush' | 'timeout' | 'abandoned';
481
497
  interface EndTesterSessionInput {
@@ -656,7 +672,14 @@ interface RetestItem {
656
672
  createdAt: string;
657
673
  projectId: string;
658
674
  screenshotPath?: string | null;
675
+ /**
676
+ * Steps that prove the fix; the last one states the expected behaviour.
677
+ * Judge each and pass the verdicts to verifyRetest / reopenRetest.
678
+ */
679
+ acceptanceSteps?: string[];
659
680
  }
681
+ /** Verdict per acceptance step (1-based step number → passed). */
682
+ type RetestStepVerdicts = Record<number, boolean>;
660
683
  /** A task preset from GET /v1/tasks */
661
684
  interface TaskPreset {
662
685
  id: string;
@@ -681,4 +704,5 @@ interface TaskStep {
681
704
  estimatedMinutes?: number | null;
682
705
  }
683
706
 
684
- export { type AnonymousLoginResponse, type ApiClientConfig, type BugCategory, type BugReportAttachmentInput, type BugReportAttachmentResponse, type BugReportPayload, type BugReportResponse, type BugReportType, type BugSeverity, type EarningsSummary, type EndTesterSessionInput, type EnrollmentResponse, type FeedbackResponse, type KnowledgeBaseAnswer, type KnowledgeBaseCitation, type KnowledgeFile, type KnowledgeFileSummary, type MyBugReportSummary, type MyBugReportsResponse, type NotificationsResult, type PayoutRecord, type RegisterDeviceInput, type RetestItem, type SessionBreadcrumbInput, type SessionBreadcrumbsResponse, type SessionEventInput, type SessionEventsResponse, type StartTesterSessionInput, type SubmissionResponse, type TaskListFilter, type TaskListResponse, type TaskPreset, type TaskStep, type TesterDeviceResponse, TesterPayKitApiClient, type TesterPoints, type TesterProfile, type TesterSessionEndReason, type TesterSessionResponse, type TesterTask, type TpkNotification };
707
+ export { TesterPayKitApiClient };
708
+ export type { AnonymousLoginResponse, ApiClientConfig, BugCategory, BugReportAttachmentInput, BugReportAttachmentResponse, BugReportPayload, BugReportResponse, BugReportType, BugSeverity, EarningsSummary, EndTesterSessionInput, EnrollmentResponse, FeedbackResponse, KnowledgeBaseAnswer, KnowledgeBaseCitation, KnowledgeFile, KnowledgeFileSummary, MyBugReportSummary, MyBugReportsResponse, NotificationsResult, PayoutRecord, RegisterDeviceInput, RetestItem, RetestStepVerdicts, SdkUpdateInfo, SessionBreadcrumbInput, SessionBreadcrumbsResponse, SessionEventInput, SessionEventsResponse, StartTesterSessionInput, SubmissionResponse, TaskListFilter, TaskListResponse, TaskPreset, TaskStep, TesterDeviceResponse, TesterPoints, TesterProfile, TesterSessionEndReason, TesterSessionResponse, TesterTask, TpkNotification };
package/dist/index.js CHANGED
@@ -246,6 +246,18 @@ var TesterPayKitApiClient = class {
246
246
  );
247
247
  return response.data.unreadCount;
248
248
  }
249
+ /**
250
+ * Claim a remote AI-tester run waiting for this project.
251
+ * POST /v1/testers/me/ai-sessions/claim — 204 → null.
252
+ */
253
+ async claimRemoteAiSession(projectId) {
254
+ const response = await this.client.post(
255
+ "/v1/testers/me/ai-sessions/claim",
256
+ { project_id: projectId }
257
+ );
258
+ if (response.status === 204 || !response.data?.sessionId) return null;
259
+ return response.data;
260
+ }
249
261
  /**
250
262
  * Attach a file (screenshot, log, voice note) to an already-
251
263
  * submitted bug report. Hits POST /v1/testers/me/bug-reports/
@@ -273,7 +285,10 @@ var TesterPayKitApiClient = class {
273
285
  ...input.deviceId && { device_id: input.deviceId }
274
286
  };
275
287
  const response = await this.client.post("/v1/testers/sessions", body);
276
- return response.data.session;
288
+ return {
289
+ ...response.data.session,
290
+ ...response.data.sdk_update && { sdkUpdate: response.data.sdk_update }
291
+ };
277
292
  }
278
293
  /** End a server-side tester session with optional counters. */
279
294
  async endTesterSession(input) {
@@ -528,22 +543,26 @@ var TesterPayKitApiClient = class {
528
543
  "/v1/testers/me/retests",
529
544
  { params }
530
545
  );
531
- return response.data;
546
+ return response.data.retests;
532
547
  }
533
548
  /**
534
549
  * POST /v1/testers/me/retests/{bugId}/verify
535
- * Mark a retest as verified (bug is fixed).
550
+ * Mark a retest as verified (bug is fixed). With stepVerdicts the API
551
+ * only verifies when every acceptance step passed.
536
552
  */
537
- async verifyRetest(bugId) {
538
- await this.client.post(`/v1/testers/me/retests/${bugId}/verify`);
553
+ async verifyRetest(bugId, stepVerdicts) {
554
+ await this.client.post(`/v1/testers/me/retests/${bugId}/verify`, {
555
+ ...stepVerdicts ? { step_results: stepResults(stepVerdicts) } : {}
556
+ });
539
557
  }
540
558
  /**
541
559
  * POST /v1/testers/me/retests/{bugId}/reopen
542
560
  * Reopen a retest (bug is still present), optionally with a reason.
543
561
  */
544
- async reopenRetest(bugId, reason) {
562
+ async reopenRetest(bugId, reason, stepVerdicts) {
545
563
  await this.client.post(`/v1/testers/me/retests/${bugId}/reopen`, {
546
- ...reason ? { reason } : {}
564
+ ...reason ? { reason } : {},
565
+ ...stepVerdicts ? { step_results: stepResults(stepVerdicts) } : {}
547
566
  });
548
567
  }
549
568
  /**
@@ -573,6 +592,9 @@ var TesterPayKitApiClient = class {
573
592
  return response.data;
574
593
  }
575
594
  };
595
+ function stepResults(verdicts) {
596
+ return Object.entries(verdicts).map(([step, passed]) => ({ step: Number(step), passed }));
597
+ }
576
598
  function formatTimestamp(timestamp) {
577
599
  return timestamp instanceof Date ? timestamp.toISOString() : timestamp;
578
600
  }
package/dist/index.mjs CHANGED
@@ -212,6 +212,18 @@ var TesterPayKitApiClient = class {
212
212
  );
213
213
  return response.data.unreadCount;
214
214
  }
215
+ /**
216
+ * Claim a remote AI-tester run waiting for this project.
217
+ * POST /v1/testers/me/ai-sessions/claim — 204 → null.
218
+ */
219
+ async claimRemoteAiSession(projectId) {
220
+ const response = await this.client.post(
221
+ "/v1/testers/me/ai-sessions/claim",
222
+ { project_id: projectId }
223
+ );
224
+ if (response.status === 204 || !response.data?.sessionId) return null;
225
+ return response.data;
226
+ }
215
227
  /**
216
228
  * Attach a file (screenshot, log, voice note) to an already-
217
229
  * submitted bug report. Hits POST /v1/testers/me/bug-reports/
@@ -239,7 +251,10 @@ var TesterPayKitApiClient = class {
239
251
  ...input.deviceId && { device_id: input.deviceId }
240
252
  };
241
253
  const response = await this.client.post("/v1/testers/sessions", body);
242
- return response.data.session;
254
+ return {
255
+ ...response.data.session,
256
+ ...response.data.sdk_update && { sdkUpdate: response.data.sdk_update }
257
+ };
243
258
  }
244
259
  /** End a server-side tester session with optional counters. */
245
260
  async endTesterSession(input) {
@@ -494,22 +509,26 @@ var TesterPayKitApiClient = class {
494
509
  "/v1/testers/me/retests",
495
510
  { params }
496
511
  );
497
- return response.data;
512
+ return response.data.retests;
498
513
  }
499
514
  /**
500
515
  * POST /v1/testers/me/retests/{bugId}/verify
501
- * Mark a retest as verified (bug is fixed).
516
+ * Mark a retest as verified (bug is fixed). With stepVerdicts the API
517
+ * only verifies when every acceptance step passed.
502
518
  */
503
- async verifyRetest(bugId) {
504
- await this.client.post(`/v1/testers/me/retests/${bugId}/verify`);
519
+ async verifyRetest(bugId, stepVerdicts) {
520
+ await this.client.post(`/v1/testers/me/retests/${bugId}/verify`, {
521
+ ...stepVerdicts ? { step_results: stepResults(stepVerdicts) } : {}
522
+ });
505
523
  }
506
524
  /**
507
525
  * POST /v1/testers/me/retests/{bugId}/reopen
508
526
  * Reopen a retest (bug is still present), optionally with a reason.
509
527
  */
510
- async reopenRetest(bugId, reason) {
528
+ async reopenRetest(bugId, reason, stepVerdicts) {
511
529
  await this.client.post(`/v1/testers/me/retests/${bugId}/reopen`, {
512
- ...reason ? { reason } : {}
530
+ ...reason ? { reason } : {},
531
+ ...stepVerdicts ? { step_results: stepResults(stepVerdicts) } : {}
513
532
  });
514
533
  }
515
534
  /**
@@ -539,6 +558,9 @@ var TesterPayKitApiClient = class {
539
558
  return response.data;
540
559
  }
541
560
  };
561
+ function stepResults(verdicts) {
562
+ return Object.entries(verdicts).map(([step, passed]) => ({ step: Number(step), passed }));
563
+ }
542
564
  function formatTimestamp(timestamp) {
543
565
  return timestamp instanceof Date ? timestamp.toISOString() : timestamp;
544
566
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testerpaykit/api-client",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "description": "API client for TesterPayKit backend",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -13,14 +13,14 @@
13
13
  }
14
14
  },
15
15
  "dependencies": {
16
- "axios": "^1.6.2",
17
- "@testerpaykit/core": "1.0.1"
16
+ "axios": "^1.20.0",
17
+ "@testerpaykit/core": "1.2.0"
18
18
  },
19
19
  "devDependencies": {
20
- "@types/node": "^20.10.0",
21
- "tsup": "^8.0.1",
22
- "typescript": "^5.3.3",
23
- "vitest": "^1.0.4"
20
+ "@types/node": "^26.6.5",
21
+ "tsup": "^9.0.0",
22
+ "typescript": "^6.0.3",
23
+ "vitest": "^5.0.5"
24
24
  },
25
25
  "keywords": [
26
26
  "testerpaykit",
@@ -6,6 +6,7 @@ import {
6
6
  WeeklySummary,
7
7
  TokenManager,
8
8
  VoiceBugExtractResponse,
9
+ RemoteAiSession,
9
10
  } from '@testerpaykit/core';
10
11
 
11
12
  export interface ApiClientConfig {
@@ -305,6 +306,19 @@ export class TesterPayKitApiClient implements IApiClient {
305
306
  return response.data.unreadCount;
306
307
  }
307
308
 
309
+ /**
310
+ * Claim a remote AI-tester run waiting for this project.
311
+ * POST /v1/testers/me/ai-sessions/claim — 204 → null.
312
+ */
313
+ async claimRemoteAiSession(projectId: string): Promise<RemoteAiSession | null> {
314
+ const response = await this.client.post<RemoteAiSession>(
315
+ '/v1/testers/me/ai-sessions/claim',
316
+ { project_id: projectId },
317
+ );
318
+ if (response.status === 204 || !response.data?.sessionId) return null;
319
+ return response.data;
320
+ }
321
+
308
322
  /**
309
323
  * Attach a file (screenshot, log, voice note) to an already-
310
324
  * submitted bug report. Hits POST /v1/testers/me/bug-reports/
@@ -339,8 +353,12 @@ export class TesterPayKitApiClient implements IApiClient {
339
353
  };
340
354
  const response = await this.client.post<{
341
355
  session: TesterSessionResponse;
356
+ sdk_update?: SdkUpdateInfo;
342
357
  }>('/v1/testers/sessions', body);
343
- return response.data.session;
358
+ return {
359
+ ...response.data.session,
360
+ ...(response.data.sdk_update && { sdkUpdate: response.data.sdk_update }),
361
+ };
344
362
  }
345
363
 
346
364
  /** End a server-side tester session with optional counters. */
@@ -647,28 +665,36 @@ export class TesterPayKitApiClient implements IApiClient {
647
665
  * List bug reports assigned to this tester for re-verification.
648
666
  */
649
667
  async getMyRetests(params?: { status?: string }): Promise<RetestItem[]> {
650
- const response = await this.client.get<RetestItem[]>(
668
+ const response = await this.client.get<{ retests: RetestItem[] }>(
651
669
  '/v1/testers/me/retests',
652
670
  { params },
653
671
  );
654
- return response.data;
672
+ return response.data.retests;
655
673
  }
656
674
 
657
675
  /**
658
676
  * POST /v1/testers/me/retests/{bugId}/verify
659
- * Mark a retest as verified (bug is fixed).
677
+ * Mark a retest as verified (bug is fixed). With stepVerdicts the API
678
+ * only verifies when every acceptance step passed.
660
679
  */
661
- async verifyRetest(bugId: string): Promise<void> {
662
- await this.client.post(`/v1/testers/me/retests/${bugId}/verify`);
680
+ async verifyRetest(bugId: string, stepVerdicts?: RetestStepVerdicts): Promise<void> {
681
+ await this.client.post(`/v1/testers/me/retests/${bugId}/verify`, {
682
+ ...(stepVerdicts ? { step_results: stepResults(stepVerdicts) } : {}),
683
+ });
663
684
  }
664
685
 
665
686
  /**
666
687
  * POST /v1/testers/me/retests/{bugId}/reopen
667
688
  * Reopen a retest (bug is still present), optionally with a reason.
668
689
  */
669
- async reopenRetest(bugId: string, reason?: string): Promise<void> {
690
+ async reopenRetest(
691
+ bugId: string,
692
+ reason?: string,
693
+ stepVerdicts?: RetestStepVerdicts,
694
+ ): Promise<void> {
670
695
  await this.client.post(`/v1/testers/me/retests/${bugId}/reopen`, {
671
696
  ...(reason ? { reason } : {}),
697
+ ...(stepVerdicts ? { step_results: stepResults(stepVerdicts) } : {}),
672
698
  });
673
699
  }
674
700
 
@@ -907,6 +933,17 @@ export interface TesterSessionResponse {
907
933
  tester_id?: string;
908
934
  started_at?: string;
909
935
  ended_at?: string | null;
936
+ /** Set when the API knows a newer SDK release than the one reported. */
937
+ sdkUpdate?: SdkUpdateInfo;
938
+ }
939
+
940
+ /** A newer TesterPayKit SDK is out (from the session-start response). */
941
+ export interface SdkUpdateInfo {
942
+ package: string;
943
+ current: string;
944
+ latest: string;
945
+ /** Command to run in the app's folder. */
946
+ command: string;
910
947
  }
911
948
 
912
949
  export type TesterSessionEndReason =
@@ -1095,6 +1132,10 @@ export interface FeedbackResponse {
1095
1132
  message?: string;
1096
1133
  }
1097
1134
 
1135
+ function stepResults(verdicts: RetestStepVerdicts): { step: number; passed: boolean }[] {
1136
+ return Object.entries(verdicts).map(([step, passed]) => ({ step: Number(step), passed }));
1137
+ }
1138
+
1098
1139
  /** A single retest item from GET /v1/testers/me/retests */
1099
1140
  export interface RetestItem {
1100
1141
  id: string;
@@ -1111,8 +1152,16 @@ export interface RetestItem {
1111
1152
  createdAt: string;
1112
1153
  projectId: string;
1113
1154
  screenshotPath?: string | null;
1155
+ /**
1156
+ * Steps that prove the fix; the last one states the expected behaviour.
1157
+ * Judge each and pass the verdicts to verifyRetest / reopenRetest.
1158
+ */
1159
+ acceptanceSteps?: string[];
1114
1160
  }
1115
1161
 
1162
+ /** Verdict per acceptance step (1-based step number → passed). */
1163
+ export type RetestStepVerdicts = Record<number, boolean>;
1164
+
1116
1165
  /** A task preset from GET /v1/tasks */
1117
1166
  export interface TaskPreset {
1118
1167
  id: string;
@@ -372,6 +372,39 @@ describe('TesterPayKitApiClient', () => {
372
372
  });
373
373
  });
374
374
 
375
+ describe('retests', () => {
376
+ it('unwraps the retest list from the response envelope', async () => {
377
+ const retests = [{ id: 'b1', title: 'Crash', status: 'fixed', createdAt: 'x', projectId: 'p' }];
378
+ mockAxiosInstance.get.mockResolvedValue({ data: { retests, total: 1 } });
379
+
380
+ const result = await client.getMyRetests();
381
+
382
+ expect(mockAxiosInstance.get).toHaveBeenCalledWith('/v1/testers/me/retests', { params: undefined });
383
+ expect(result).toEqual(retests);
384
+ });
385
+
386
+ it('sends acceptance step verdicts as step_results', async () => {
387
+ mockAxiosInstance.post.mockResolvedValue({ data: {} });
388
+
389
+ await client.verifyRetest('b1', { 1: true, 2: true });
390
+ await client.reopenRetest('b1', 'still broken', { 1: true, 2: false });
391
+
392
+ expect(mockAxiosInstance.post).toHaveBeenCalledWith('/v1/testers/me/retests/b1/verify', {
393
+ step_results: [
394
+ { step: 1, passed: true },
395
+ { step: 2, passed: true },
396
+ ],
397
+ });
398
+ expect(mockAxiosInstance.post).toHaveBeenCalledWith('/v1/testers/me/retests/b1/reopen', {
399
+ reason: 'still broken',
400
+ step_results: [
401
+ { step: 1, passed: true },
402
+ { step: 2, passed: false },
403
+ ],
404
+ });
405
+ });
406
+ });
407
+
375
408
  describe('setAccessToken', () => {
376
409
  it('should set access token', () => {
377
410
  client.setAccessToken('manual-token');
@@ -1,15 +0,0 @@
1
- $ tsup src/index.ts --format cjs,esm --dts
2
- CLI Building entry: src/index.ts
3
- CLI Using tsconfig: tsconfig.json
4
- CLI tsup v8.5.1
5
- CLI Target: es2020
6
- CJS Build start
7
- ESM Build start
8
- ESM dist/index.mjs 18.53 KB
9
- ESM ⚡️ Build success in 15ms
10
- CJS dist/index.js 20.18 KB
11
- CJS ⚡️ Build success in 15ms
12
- DTS Build start
13
- DTS ⚡️ Build success in 444ms
14
- DTS dist/index.d.ts 23.08 KB
15
- DTS dist/index.d.mts 23.08 KB
@@ -1,12 +0,0 @@
1
- $ vitest --run
2
- The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
3
-
4
- RUN v1.6.1 /Users/udi/work/moinsen/ideas/moinsen-infrastructure/TesterPayKit/sdks/typescript/packages/api-client
5
-
6
- ✓ tests/TesterPayKitApiClient.test.ts (14 tests) 6ms
7
-
8
- Test Files 1 passed (1)
9
- Tests 14 passed (14)
10
- Start at 16:58:26
11
- Duration 473ms (transform 72ms, setup 0ms, collect 157ms, tests 6ms, environment 0ms, prepare 114ms)
12
-