@testerpaykit/api-client 1.6.0 → 2.0.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/CHANGELOG.md +41 -0
- package/dist/index.d.mts +218 -13
- package/dist/index.d.ts +218 -13
- package/dist/index.js +95 -13
- package/dist/index.mjs +95 -13
- package/package.json +1 -1
- package/src/TesterPayKitApiClient.ts +175 -23
- package/src/compensation.ts +59 -0
- package/src/index.ts +1 -0
- package/tests/TesterPayKitApiClient.test.ts +83 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@testerpaykit/api-client` are documented here.
|
|
4
|
+
|
|
5
|
+
## 2.0.0 — 2026-11-07
|
|
6
|
+
|
|
7
|
+
Breaking: `submitSessionEndFeedback` removed.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- `onTesterGate` — called on any 403 `phone_required` /
|
|
11
|
+
`approval_required` answer (SDKs hide their tester UI on it). Type
|
|
12
|
+
`TesterGateReason`.
|
|
13
|
+
|
|
14
|
+
### Removed
|
|
15
|
+
- `submitSessionEndFeedback` and `FeedbackResponse`: `/v1/session-feedback`
|
|
16
|
+
never existed on the API. Session feedback goes out as a
|
|
17
|
+
`generalFeedback` bug report.
|
|
18
|
+
|
|
19
|
+
## 1.7.0 — 2026-11-01
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
- `getChecklist(projectId)` — what to test in an app: the project's
|
|
23
|
+
checklist tasks with their steps and the tester's (`mine`) and the AI
|
|
24
|
+
tester's (`ai`) latest pass (`GET /v1/testers/me/checklist`). A 404
|
|
25
|
+
(tester not in the project yet) yields an empty list.
|
|
26
|
+
- `submitChecklistRun({projectId, taskId, stepResults, summary?})` — one
|
|
27
|
+
pass through a task with a verdict per step (`POST
|
|
28
|
+
/v1/testers/me/checklist/<taskId>/runs`), returns `passed`, `failed` or
|
|
29
|
+
`incomplete`.
|
|
30
|
+
- Types `ChecklistTask`, `ChecklistRun`, `ChecklistStepResult`,
|
|
31
|
+
`ChecklistRunInput`.
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
- `claimRemoteAiSession(projectId, appVersion?)` sends the app version, so
|
|
35
|
+
the API can hand AI retests of a fixed bug only to the fixed build.
|
|
36
|
+
|
|
37
|
+
## 1.6.0 — 2026-10-31
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
- `openLiveLink(projectId)` and `sendLiveNote(...)` for the live link to
|
|
41
|
+
Claude Code.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,122 @@
|
|
|
1
1
|
import { TokenManager, IApiClient, LoginRequest, LoginResponse, WeeklySummary, RemoteAiSession, VoiceBugExtractResponse, QuickActionKind } from '@testerpaykit/core';
|
|
2
2
|
|
|
3
|
+
/** `play` = play money in the pilot: real ledger rows, never a payout.
|
|
4
|
+
* Every UI labels such amounts "Spielgeld · Pilot" / "Play money · pilot". */
|
|
5
|
+
type MoneyMode = 'play' | 'test' | 'live';
|
|
6
|
+
type WorkState = 'offered' | 'active' | 'paused' | 'review' | 'disputed' | 'approved' | 'cancelled';
|
|
7
|
+
interface PaidAssignment {
|
|
8
|
+
id: string;
|
|
9
|
+
project_id: string;
|
|
10
|
+
tester_id: string;
|
|
11
|
+
title: string;
|
|
12
|
+
project_name: string;
|
|
13
|
+
mode: MoneyMode;
|
|
14
|
+
terms_version: 1;
|
|
15
|
+
rate_cents: number;
|
|
16
|
+
minimum_cents: number;
|
|
17
|
+
budget_cents: number;
|
|
18
|
+
seconds: number;
|
|
19
|
+
running_since: string | null;
|
|
20
|
+
state: WorkState;
|
|
21
|
+
revision: number;
|
|
22
|
+
amount_cents: number | null;
|
|
23
|
+
review_due: string | null;
|
|
24
|
+
review_note: string | null;
|
|
25
|
+
completion_note: string | null;
|
|
26
|
+
}
|
|
27
|
+
/** time = paid assignment · task = checklist task on its announced time ·
|
|
28
|
+
* bonus = idea bonus · bug_bonus · reproduction · retest (one per round). */
|
|
29
|
+
type MoneyKind = 'time' | 'task' | 'bonus' | 'bug_bonus' | 'reproduction' | 'retest' | 'start_bonus';
|
|
30
|
+
interface MoneyEntry {
|
|
31
|
+
id: string;
|
|
32
|
+
project_id: string;
|
|
33
|
+
project_name: string;
|
|
34
|
+
tester_id: string;
|
|
35
|
+
mode: MoneyMode;
|
|
36
|
+
kind: MoneyKind;
|
|
37
|
+
reason: string;
|
|
38
|
+
amount_cents: number;
|
|
39
|
+
currency: 'eur';
|
|
40
|
+
/** review = waits for the 3-working-day window, then released. */
|
|
41
|
+
status: 'review' | 'approved' | 'processing' | 'transferred' | 'held';
|
|
42
|
+
units: number;
|
|
43
|
+
review_due: string | null;
|
|
44
|
+
review_note: string | null;
|
|
45
|
+
bug_id: string | null;
|
|
46
|
+
task_preset_id: string | null;
|
|
47
|
+
created_at: string;
|
|
48
|
+
transfer_id: string | null;
|
|
49
|
+
}
|
|
50
|
+
/** Sums in the current mode, in cents. Bonuses never count towards the 5 € floor. */
|
|
51
|
+
interface MoneyTotals {
|
|
52
|
+
in_review_cents: number;
|
|
53
|
+
released_cents: number;
|
|
54
|
+
bonus_cents: number;
|
|
55
|
+
held_cents: number;
|
|
56
|
+
total_cents: number;
|
|
57
|
+
}
|
|
58
|
+
interface CompensationRates {
|
|
59
|
+
rate_cents_per_minute: number;
|
|
60
|
+
minimum_cents: number;
|
|
61
|
+
bug_bonus_cents: {
|
|
62
|
+
easy: number;
|
|
63
|
+
medium: number;
|
|
64
|
+
hard: number;
|
|
65
|
+
};
|
|
66
|
+
reproduction_cents: number;
|
|
67
|
+
retest_per_fix_cents: number;
|
|
68
|
+
retest_round_minimum_cents: number;
|
|
69
|
+
idea_bonus_choices_cents: number[];
|
|
70
|
+
review_working_days: number;
|
|
71
|
+
/** Start bonus, booked once per person on the first phone confirmation. */
|
|
72
|
+
start_bonus_cents?: number;
|
|
73
|
+
}
|
|
74
|
+
interface CompensationWallet {
|
|
75
|
+
/** Current mode; `play` = label every amount as play money. */
|
|
76
|
+
mode: MoneyMode;
|
|
77
|
+
currency: 'eur';
|
|
78
|
+
server_time: string;
|
|
79
|
+
rates: CompensationRates;
|
|
80
|
+
/** The person = every app install with the same confirmed phone. */
|
|
81
|
+
person: {
|
|
82
|
+
handle: string | null;
|
|
83
|
+
phone_confirmed: boolean;
|
|
84
|
+
tester_count: number;
|
|
85
|
+
apps: Array<{
|
|
86
|
+
project_id: string;
|
|
87
|
+
project_name: string;
|
|
88
|
+
}>;
|
|
89
|
+
};
|
|
90
|
+
/** Whole person across apps … */
|
|
91
|
+
totals: MoneyTotals;
|
|
92
|
+
/** … and the share of this app install. */
|
|
93
|
+
this_app: MoneyTotals;
|
|
94
|
+
assignments: PaidAssignment[];
|
|
95
|
+
entries: MoneyEntry[];
|
|
96
|
+
balances: Record<MoneyMode, Record<MoneyEntry['status'], number>>;
|
|
97
|
+
legacy: Array<{
|
|
98
|
+
id: string;
|
|
99
|
+
source: string;
|
|
100
|
+
amount_cents: number;
|
|
101
|
+
status: string;
|
|
102
|
+
}>;
|
|
103
|
+
}
|
|
104
|
+
interface WorkCommand {
|
|
105
|
+
assignment_id: string;
|
|
106
|
+
request_id: string;
|
|
107
|
+
revision: number;
|
|
108
|
+
action: 'start' | 'pause' | 'submit' | 'submit_partial' | 'decline';
|
|
109
|
+
accept_terms_version?: 1;
|
|
110
|
+
seconds?: number;
|
|
111
|
+
note?: string;
|
|
112
|
+
}
|
|
113
|
+
interface PushRegistration {
|
|
114
|
+
installation_id: string;
|
|
115
|
+
app_id: string;
|
|
116
|
+
token?: string;
|
|
117
|
+
enabled: boolean;
|
|
118
|
+
}
|
|
119
|
+
|
|
3
120
|
/** Body of a "Send to Claude" note (see `sendLiveNote`). */
|
|
4
121
|
interface LiveNoteInput {
|
|
5
122
|
projectId: string;
|
|
@@ -9,6 +126,38 @@ interface LiveNoteInput {
|
|
|
9
126
|
/** Base64 PNG/JPEG, no data-URI prefix. */
|
|
10
127
|
screenshotBase64?: string | null;
|
|
11
128
|
}
|
|
129
|
+
/** One step verdict of a checklist pass (`step` is 1-based). */
|
|
130
|
+
interface ChecklistStepResult {
|
|
131
|
+
step: number;
|
|
132
|
+
passed: boolean;
|
|
133
|
+
note?: string;
|
|
134
|
+
}
|
|
135
|
+
/** The latest pass through a checklist task (by this tester or the AI). */
|
|
136
|
+
interface ChecklistRun {
|
|
137
|
+
status: 'passed' | 'failed' | 'incomplete' | string;
|
|
138
|
+
steps: ChecklistStepResult[];
|
|
139
|
+
summary?: string;
|
|
140
|
+
at: string;
|
|
141
|
+
tester?: string;
|
|
142
|
+
}
|
|
143
|
+
/** One task of a project's checklist: what should be tested. */
|
|
144
|
+
interface ChecklistTask {
|
|
145
|
+
id: string;
|
|
146
|
+
title: string;
|
|
147
|
+
description?: string;
|
|
148
|
+
steps: string[];
|
|
149
|
+
/** This tester's latest pass. */
|
|
150
|
+
mine?: ChecklistRun;
|
|
151
|
+
/** The AI tester's latest pass. */
|
|
152
|
+
ai?: ChecklistRun;
|
|
153
|
+
}
|
|
154
|
+
/** Body of `submitChecklistRun`. */
|
|
155
|
+
interface ChecklistRunInput {
|
|
156
|
+
projectId: string;
|
|
157
|
+
taskId: string;
|
|
158
|
+
stepResults: ChecklistStepResult[];
|
|
159
|
+
summary?: string;
|
|
160
|
+
}
|
|
12
161
|
interface ApiClientConfig {
|
|
13
162
|
baseURL?: string;
|
|
14
163
|
apiKey: string;
|
|
@@ -22,10 +171,18 @@ interface ApiClientConfig {
|
|
|
22
171
|
* - Request/response interceptors for auth headers
|
|
23
172
|
* - Integration with TokenManager for token lifecycle
|
|
24
173
|
*/
|
|
174
|
+
/** The tester gate's 403 codes (migrations 075 + 077). */
|
|
175
|
+
type TesterGateReason = 'phone_required' | 'approval_required';
|
|
25
176
|
declare class TesterPayKitApiClient implements IApiClient {
|
|
26
177
|
private client;
|
|
27
178
|
private tokenManager;
|
|
28
179
|
private apiKey;
|
|
180
|
+
/**
|
|
181
|
+
* Called on any 403 `phone_required` / `approval_required` answer: the
|
|
182
|
+
* tester is not (or no longer) cleared to report. SDKs hide their
|
|
183
|
+
* tester UI on it. The request still rejects as before.
|
|
184
|
+
*/
|
|
185
|
+
onTesterGate: ((reason: TesterGateReason) => void) | null;
|
|
29
186
|
constructor(config: ApiClientConfig);
|
|
30
187
|
/**
|
|
31
188
|
* Setup request/response interceptors for JWT authentication.
|
|
@@ -152,8 +309,10 @@ declare class TesterPayKitApiClient implements IApiClient {
|
|
|
152
309
|
/**
|
|
153
310
|
* Claim a remote AI-tester run waiting for this project.
|
|
154
311
|
* POST /v1/testers/me/ai-sessions/claim — 204 → null.
|
|
312
|
+
* `appVersion` lets the API hand out AI retests of a fixed bug, which
|
|
313
|
+
* only a build at or above the fixed version may run.
|
|
155
314
|
*/
|
|
156
|
-
claimRemoteAiSession(projectId: string): Promise<RemoteAiSession | null>;
|
|
315
|
+
claimRemoteAiSession(projectId: string, appVersion?: string): Promise<RemoteAiSession | null>;
|
|
157
316
|
/**
|
|
158
317
|
* Open a live link to the developer's Claude Code session: returns a
|
|
159
318
|
* one-time WebSocket URL (valid two minutes). Fetch a fresh one for
|
|
@@ -165,6 +324,18 @@ declare class TesterPayKitApiClient implements IApiClient {
|
|
|
165
324
|
* without an open live link. POST /v1/testers/me/live/notes → note id.
|
|
166
325
|
*/
|
|
167
326
|
sendLiveNote(input: LiveNoteInput): Promise<string>;
|
|
327
|
+
/**
|
|
328
|
+
* What to test in this app: the project's checklist tasks with this
|
|
329
|
+
* tester's (`mine`) and the AI tester's (`ai`) latest pass.
|
|
330
|
+
* GET /v1/testers/me/checklist?project_id=… — a 404 (tester not in the
|
|
331
|
+
* project yet) yields an empty list.
|
|
332
|
+
*/
|
|
333
|
+
getChecklist(projectId: string): Promise<ChecklistTask[]>;
|
|
334
|
+
/**
|
|
335
|
+
* One pass through a checklist task, a verdict per step.
|
|
336
|
+
* POST /v1/testers/me/checklist/{taskId}/runs → the run's status.
|
|
337
|
+
*/
|
|
338
|
+
submitChecklistRun(input: ChecklistRunInput): Promise<string>;
|
|
168
339
|
/**
|
|
169
340
|
* Attach a file (screenshot, log, voice note) to an already-
|
|
170
341
|
* submitted bug report. Hits POST /v1/testers/me/bug-reports/
|
|
@@ -217,6 +388,34 @@ declare class TesterPayKitApiClient implements IApiClient {
|
|
|
217
388
|
* GET /v1/testers/me/profile.
|
|
218
389
|
*/
|
|
219
390
|
getMyProfile(): Promise<TesterProfile>;
|
|
391
|
+
/**
|
|
392
|
+
* POST /v1/testers/me/phone/start — sends a 6-digit SMS code.
|
|
393
|
+
* Throws with status 400 (invalid_phone), 429 (too_many_codes) or
|
|
394
|
+
* 503 (sms_not_configured: the server cannot send SMS yet).
|
|
395
|
+
*/
|
|
396
|
+
startPhoneVerification(phone: string): Promise<PhoneStartResponse>;
|
|
397
|
+
/**
|
|
398
|
+
* POST /v1/testers/me/phone/confirm — confirms the code. Returns the
|
|
399
|
+
* tester's handle; the same number on another install hands it over.
|
|
400
|
+
* `device` binds the number to this physical device (migration 077):
|
|
401
|
+
* a number already confirmed on another device throws 409
|
|
402
|
+
* `device_not_allowed` until an admin allows the new one.
|
|
403
|
+
*/
|
|
404
|
+
confirmPhoneVerification(verificationId: string, code: string, device?: {
|
|
405
|
+
deviceKey: string;
|
|
406
|
+
platform: 'ios' | 'android' | 'web';
|
|
407
|
+
}): Promise<PhoneConfirmResponse>;
|
|
408
|
+
getCompensation(): Promise<CompensationWallet>;
|
|
409
|
+
recordPaidWork(command: WorkCommand): Promise<PaidAssignment>;
|
|
410
|
+
registerCompensationPush(registration: PushRegistration): Promise<void>;
|
|
411
|
+
getPayoutAccount(): Promise<{
|
|
412
|
+
has_account: boolean;
|
|
413
|
+
transfers_active: boolean;
|
|
414
|
+
payments_configured: boolean;
|
|
415
|
+
}>;
|
|
416
|
+
createPayoutAccountLink(): Promise<{
|
|
417
|
+
url: string;
|
|
418
|
+
}>;
|
|
220
419
|
/** GET /v1/testers/me/points — current point balance + breakdown. */
|
|
221
420
|
getMyPoints(): Promise<TesterPoints>;
|
|
222
421
|
/**
|
|
@@ -292,11 +491,6 @@ declare class TesterPayKitApiClient implements IApiClient {
|
|
|
292
491
|
* Server keys on device_token — a second POST with the same token updates the row.
|
|
293
492
|
*/
|
|
294
493
|
registerDevice(input: RegisterDeviceInput): Promise<TesterDeviceResponse>;
|
|
295
|
-
/**
|
|
296
|
-
* POST /v1/session-feedback
|
|
297
|
-
* Submit end-of-session feedback (rating, comments, etc.).
|
|
298
|
-
*/
|
|
299
|
-
submitSessionEndFeedback(payload: Record<string, unknown>): Promise<FeedbackResponse>;
|
|
300
494
|
/**
|
|
301
495
|
* Upload an attachment directly (not tied to a specific bug report).
|
|
302
496
|
* POST /v1/attachments — alternate path from the contract alongside
|
|
@@ -621,13 +815,30 @@ interface EnrollmentResponse {
|
|
|
621
815
|
interface TesterProfile {
|
|
622
816
|
id: string;
|
|
623
817
|
email?: string | null;
|
|
818
|
+
/** System handle, e.g. "sad-banana" (migration 074). */
|
|
624
819
|
handle?: string | null;
|
|
820
|
+
/** True once this install confirmed a phone number. */
|
|
821
|
+
phoneVerified?: boolean;
|
|
822
|
+
/** True once an admin approved the person (migration 077). */
|
|
823
|
+
approved?: boolean;
|
|
625
824
|
fullName?: string | null;
|
|
626
825
|
rating?: number | null;
|
|
627
826
|
pointsTotal?: number | null;
|
|
628
827
|
status?: string;
|
|
629
828
|
createdAt?: string;
|
|
630
829
|
}
|
|
830
|
+
interface PhoneStartResponse {
|
|
831
|
+
verificationId: string;
|
|
832
|
+
expiresInSeconds: number;
|
|
833
|
+
/** Only returned by a development server. */
|
|
834
|
+
devCode?: string;
|
|
835
|
+
}
|
|
836
|
+
interface PhoneConfirmResponse {
|
|
837
|
+
handle: string;
|
|
838
|
+
phoneVerified: boolean;
|
|
839
|
+
/** Tester status after the confirmation (e.g. `active`, `pending`). */
|
|
840
|
+
status?: string | null;
|
|
841
|
+
}
|
|
631
842
|
interface TesterPoints {
|
|
632
843
|
total: number;
|
|
633
844
|
breakdown?: Record<string, number>;
|
|
@@ -684,12 +895,6 @@ interface TesterDeviceResponse {
|
|
|
684
895
|
deviceToken: string;
|
|
685
896
|
deviceType: string;
|
|
686
897
|
}
|
|
687
|
-
/** Response from POST /v1/session-feedback */
|
|
688
|
-
interface FeedbackResponse {
|
|
689
|
-
id: string;
|
|
690
|
-
status: string;
|
|
691
|
-
message?: string;
|
|
692
|
-
}
|
|
693
898
|
/** A single retest item from GET /v1/testers/me/retests */
|
|
694
899
|
interface RetestItem {
|
|
695
900
|
id: string;
|
|
@@ -739,4 +944,4 @@ interface TaskStep {
|
|
|
739
944
|
}
|
|
740
945
|
|
|
741
946
|
export { TesterPayKitApiClient };
|
|
742
|
-
export type { AnonymousLoginResponse, ApiClientConfig, BugCategory, BugReportAttachmentInput, BugReportAttachmentResponse, BugReportPayload, BugReportResponse, BugReportType, BugSeverity, EarningsSummary, EndTesterSessionInput, EnrollmentResponse,
|
|
947
|
+
export type { AnonymousLoginResponse, ApiClientConfig, BugCategory, BugReportAttachmentInput, BugReportAttachmentResponse, BugReportPayload, BugReportResponse, BugReportType, BugSeverity, ChecklistRun, ChecklistRunInput, ChecklistStepResult, ChecklistTask, CompensationRates, CompensationWallet, EarningsSummary, EndTesterSessionInput, EnrollmentResponse, KnowledgeBaseAnswer, KnowledgeBaseCitation, KnowledgeFile, KnowledgeFileSummary, LiveNoteInput, MoneyEntry, MoneyKind, MoneyMode, MoneyTotals, MyBugReportSummary, MyBugReportsResponse, NotificationsResult, PaidAssignment, PayoutRecord, PhoneConfirmResponse, PhoneStartResponse, PushRegistration, RegisterDeviceInput, RetestItem, RetestStepVerdicts, SdkUpdateInfo, SessionBreadcrumbInput, SessionBreadcrumbsResponse, SessionEventInput, SessionEventsResponse, StartTesterSessionInput, SubmissionResponse, TaskListFilter, TaskListResponse, TaskPreset, TaskStep, TesterDeviceResponse, TesterGateReason, TesterPoints, TesterProfile, TesterSessionEndReason, TesterSessionResponse, TesterTask, TpkNotification, WorkCommand, WorkState };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,122 @@
|
|
|
1
1
|
import { TokenManager, IApiClient, LoginRequest, LoginResponse, WeeklySummary, RemoteAiSession, VoiceBugExtractResponse, QuickActionKind } from '@testerpaykit/core';
|
|
2
2
|
|
|
3
|
+
/** `play` = play money in the pilot: real ledger rows, never a payout.
|
|
4
|
+
* Every UI labels such amounts "Spielgeld · Pilot" / "Play money · pilot". */
|
|
5
|
+
type MoneyMode = 'play' | 'test' | 'live';
|
|
6
|
+
type WorkState = 'offered' | 'active' | 'paused' | 'review' | 'disputed' | 'approved' | 'cancelled';
|
|
7
|
+
interface PaidAssignment {
|
|
8
|
+
id: string;
|
|
9
|
+
project_id: string;
|
|
10
|
+
tester_id: string;
|
|
11
|
+
title: string;
|
|
12
|
+
project_name: string;
|
|
13
|
+
mode: MoneyMode;
|
|
14
|
+
terms_version: 1;
|
|
15
|
+
rate_cents: number;
|
|
16
|
+
minimum_cents: number;
|
|
17
|
+
budget_cents: number;
|
|
18
|
+
seconds: number;
|
|
19
|
+
running_since: string | null;
|
|
20
|
+
state: WorkState;
|
|
21
|
+
revision: number;
|
|
22
|
+
amount_cents: number | null;
|
|
23
|
+
review_due: string | null;
|
|
24
|
+
review_note: string | null;
|
|
25
|
+
completion_note: string | null;
|
|
26
|
+
}
|
|
27
|
+
/** time = paid assignment · task = checklist task on its announced time ·
|
|
28
|
+
* bonus = idea bonus · bug_bonus · reproduction · retest (one per round). */
|
|
29
|
+
type MoneyKind = 'time' | 'task' | 'bonus' | 'bug_bonus' | 'reproduction' | 'retest' | 'start_bonus';
|
|
30
|
+
interface MoneyEntry {
|
|
31
|
+
id: string;
|
|
32
|
+
project_id: string;
|
|
33
|
+
project_name: string;
|
|
34
|
+
tester_id: string;
|
|
35
|
+
mode: MoneyMode;
|
|
36
|
+
kind: MoneyKind;
|
|
37
|
+
reason: string;
|
|
38
|
+
amount_cents: number;
|
|
39
|
+
currency: 'eur';
|
|
40
|
+
/** review = waits for the 3-working-day window, then released. */
|
|
41
|
+
status: 'review' | 'approved' | 'processing' | 'transferred' | 'held';
|
|
42
|
+
units: number;
|
|
43
|
+
review_due: string | null;
|
|
44
|
+
review_note: string | null;
|
|
45
|
+
bug_id: string | null;
|
|
46
|
+
task_preset_id: string | null;
|
|
47
|
+
created_at: string;
|
|
48
|
+
transfer_id: string | null;
|
|
49
|
+
}
|
|
50
|
+
/** Sums in the current mode, in cents. Bonuses never count towards the 5 € floor. */
|
|
51
|
+
interface MoneyTotals {
|
|
52
|
+
in_review_cents: number;
|
|
53
|
+
released_cents: number;
|
|
54
|
+
bonus_cents: number;
|
|
55
|
+
held_cents: number;
|
|
56
|
+
total_cents: number;
|
|
57
|
+
}
|
|
58
|
+
interface CompensationRates {
|
|
59
|
+
rate_cents_per_minute: number;
|
|
60
|
+
minimum_cents: number;
|
|
61
|
+
bug_bonus_cents: {
|
|
62
|
+
easy: number;
|
|
63
|
+
medium: number;
|
|
64
|
+
hard: number;
|
|
65
|
+
};
|
|
66
|
+
reproduction_cents: number;
|
|
67
|
+
retest_per_fix_cents: number;
|
|
68
|
+
retest_round_minimum_cents: number;
|
|
69
|
+
idea_bonus_choices_cents: number[];
|
|
70
|
+
review_working_days: number;
|
|
71
|
+
/** Start bonus, booked once per person on the first phone confirmation. */
|
|
72
|
+
start_bonus_cents?: number;
|
|
73
|
+
}
|
|
74
|
+
interface CompensationWallet {
|
|
75
|
+
/** Current mode; `play` = label every amount as play money. */
|
|
76
|
+
mode: MoneyMode;
|
|
77
|
+
currency: 'eur';
|
|
78
|
+
server_time: string;
|
|
79
|
+
rates: CompensationRates;
|
|
80
|
+
/** The person = every app install with the same confirmed phone. */
|
|
81
|
+
person: {
|
|
82
|
+
handle: string | null;
|
|
83
|
+
phone_confirmed: boolean;
|
|
84
|
+
tester_count: number;
|
|
85
|
+
apps: Array<{
|
|
86
|
+
project_id: string;
|
|
87
|
+
project_name: string;
|
|
88
|
+
}>;
|
|
89
|
+
};
|
|
90
|
+
/** Whole person across apps … */
|
|
91
|
+
totals: MoneyTotals;
|
|
92
|
+
/** … and the share of this app install. */
|
|
93
|
+
this_app: MoneyTotals;
|
|
94
|
+
assignments: PaidAssignment[];
|
|
95
|
+
entries: MoneyEntry[];
|
|
96
|
+
balances: Record<MoneyMode, Record<MoneyEntry['status'], number>>;
|
|
97
|
+
legacy: Array<{
|
|
98
|
+
id: string;
|
|
99
|
+
source: string;
|
|
100
|
+
amount_cents: number;
|
|
101
|
+
status: string;
|
|
102
|
+
}>;
|
|
103
|
+
}
|
|
104
|
+
interface WorkCommand {
|
|
105
|
+
assignment_id: string;
|
|
106
|
+
request_id: string;
|
|
107
|
+
revision: number;
|
|
108
|
+
action: 'start' | 'pause' | 'submit' | 'submit_partial' | 'decline';
|
|
109
|
+
accept_terms_version?: 1;
|
|
110
|
+
seconds?: number;
|
|
111
|
+
note?: string;
|
|
112
|
+
}
|
|
113
|
+
interface PushRegistration {
|
|
114
|
+
installation_id: string;
|
|
115
|
+
app_id: string;
|
|
116
|
+
token?: string;
|
|
117
|
+
enabled: boolean;
|
|
118
|
+
}
|
|
119
|
+
|
|
3
120
|
/** Body of a "Send to Claude" note (see `sendLiveNote`). */
|
|
4
121
|
interface LiveNoteInput {
|
|
5
122
|
projectId: string;
|
|
@@ -9,6 +126,38 @@ interface LiveNoteInput {
|
|
|
9
126
|
/** Base64 PNG/JPEG, no data-URI prefix. */
|
|
10
127
|
screenshotBase64?: string | null;
|
|
11
128
|
}
|
|
129
|
+
/** One step verdict of a checklist pass (`step` is 1-based). */
|
|
130
|
+
interface ChecklistStepResult {
|
|
131
|
+
step: number;
|
|
132
|
+
passed: boolean;
|
|
133
|
+
note?: string;
|
|
134
|
+
}
|
|
135
|
+
/** The latest pass through a checklist task (by this tester or the AI). */
|
|
136
|
+
interface ChecklistRun {
|
|
137
|
+
status: 'passed' | 'failed' | 'incomplete' | string;
|
|
138
|
+
steps: ChecklistStepResult[];
|
|
139
|
+
summary?: string;
|
|
140
|
+
at: string;
|
|
141
|
+
tester?: string;
|
|
142
|
+
}
|
|
143
|
+
/** One task of a project's checklist: what should be tested. */
|
|
144
|
+
interface ChecklistTask {
|
|
145
|
+
id: string;
|
|
146
|
+
title: string;
|
|
147
|
+
description?: string;
|
|
148
|
+
steps: string[];
|
|
149
|
+
/** This tester's latest pass. */
|
|
150
|
+
mine?: ChecklistRun;
|
|
151
|
+
/** The AI tester's latest pass. */
|
|
152
|
+
ai?: ChecklistRun;
|
|
153
|
+
}
|
|
154
|
+
/** Body of `submitChecklistRun`. */
|
|
155
|
+
interface ChecklistRunInput {
|
|
156
|
+
projectId: string;
|
|
157
|
+
taskId: string;
|
|
158
|
+
stepResults: ChecklistStepResult[];
|
|
159
|
+
summary?: string;
|
|
160
|
+
}
|
|
12
161
|
interface ApiClientConfig {
|
|
13
162
|
baseURL?: string;
|
|
14
163
|
apiKey: string;
|
|
@@ -22,10 +171,18 @@ interface ApiClientConfig {
|
|
|
22
171
|
* - Request/response interceptors for auth headers
|
|
23
172
|
* - Integration with TokenManager for token lifecycle
|
|
24
173
|
*/
|
|
174
|
+
/** The tester gate's 403 codes (migrations 075 + 077). */
|
|
175
|
+
type TesterGateReason = 'phone_required' | 'approval_required';
|
|
25
176
|
declare class TesterPayKitApiClient implements IApiClient {
|
|
26
177
|
private client;
|
|
27
178
|
private tokenManager;
|
|
28
179
|
private apiKey;
|
|
180
|
+
/**
|
|
181
|
+
* Called on any 403 `phone_required` / `approval_required` answer: the
|
|
182
|
+
* tester is not (or no longer) cleared to report. SDKs hide their
|
|
183
|
+
* tester UI on it. The request still rejects as before.
|
|
184
|
+
*/
|
|
185
|
+
onTesterGate: ((reason: TesterGateReason) => void) | null;
|
|
29
186
|
constructor(config: ApiClientConfig);
|
|
30
187
|
/**
|
|
31
188
|
* Setup request/response interceptors for JWT authentication.
|
|
@@ -152,8 +309,10 @@ declare class TesterPayKitApiClient implements IApiClient {
|
|
|
152
309
|
/**
|
|
153
310
|
* Claim a remote AI-tester run waiting for this project.
|
|
154
311
|
* POST /v1/testers/me/ai-sessions/claim — 204 → null.
|
|
312
|
+
* `appVersion` lets the API hand out AI retests of a fixed bug, which
|
|
313
|
+
* only a build at or above the fixed version may run.
|
|
155
314
|
*/
|
|
156
|
-
claimRemoteAiSession(projectId: string): Promise<RemoteAiSession | null>;
|
|
315
|
+
claimRemoteAiSession(projectId: string, appVersion?: string): Promise<RemoteAiSession | null>;
|
|
157
316
|
/**
|
|
158
317
|
* Open a live link to the developer's Claude Code session: returns a
|
|
159
318
|
* one-time WebSocket URL (valid two minutes). Fetch a fresh one for
|
|
@@ -165,6 +324,18 @@ declare class TesterPayKitApiClient implements IApiClient {
|
|
|
165
324
|
* without an open live link. POST /v1/testers/me/live/notes → note id.
|
|
166
325
|
*/
|
|
167
326
|
sendLiveNote(input: LiveNoteInput): Promise<string>;
|
|
327
|
+
/**
|
|
328
|
+
* What to test in this app: the project's checklist tasks with this
|
|
329
|
+
* tester's (`mine`) and the AI tester's (`ai`) latest pass.
|
|
330
|
+
* GET /v1/testers/me/checklist?project_id=… — a 404 (tester not in the
|
|
331
|
+
* project yet) yields an empty list.
|
|
332
|
+
*/
|
|
333
|
+
getChecklist(projectId: string): Promise<ChecklistTask[]>;
|
|
334
|
+
/**
|
|
335
|
+
* One pass through a checklist task, a verdict per step.
|
|
336
|
+
* POST /v1/testers/me/checklist/{taskId}/runs → the run's status.
|
|
337
|
+
*/
|
|
338
|
+
submitChecklistRun(input: ChecklistRunInput): Promise<string>;
|
|
168
339
|
/**
|
|
169
340
|
* Attach a file (screenshot, log, voice note) to an already-
|
|
170
341
|
* submitted bug report. Hits POST /v1/testers/me/bug-reports/
|
|
@@ -217,6 +388,34 @@ declare class TesterPayKitApiClient implements IApiClient {
|
|
|
217
388
|
* GET /v1/testers/me/profile.
|
|
218
389
|
*/
|
|
219
390
|
getMyProfile(): Promise<TesterProfile>;
|
|
391
|
+
/**
|
|
392
|
+
* POST /v1/testers/me/phone/start — sends a 6-digit SMS code.
|
|
393
|
+
* Throws with status 400 (invalid_phone), 429 (too_many_codes) or
|
|
394
|
+
* 503 (sms_not_configured: the server cannot send SMS yet).
|
|
395
|
+
*/
|
|
396
|
+
startPhoneVerification(phone: string): Promise<PhoneStartResponse>;
|
|
397
|
+
/**
|
|
398
|
+
* POST /v1/testers/me/phone/confirm — confirms the code. Returns the
|
|
399
|
+
* tester's handle; the same number on another install hands it over.
|
|
400
|
+
* `device` binds the number to this physical device (migration 077):
|
|
401
|
+
* a number already confirmed on another device throws 409
|
|
402
|
+
* `device_not_allowed` until an admin allows the new one.
|
|
403
|
+
*/
|
|
404
|
+
confirmPhoneVerification(verificationId: string, code: string, device?: {
|
|
405
|
+
deviceKey: string;
|
|
406
|
+
platform: 'ios' | 'android' | 'web';
|
|
407
|
+
}): Promise<PhoneConfirmResponse>;
|
|
408
|
+
getCompensation(): Promise<CompensationWallet>;
|
|
409
|
+
recordPaidWork(command: WorkCommand): Promise<PaidAssignment>;
|
|
410
|
+
registerCompensationPush(registration: PushRegistration): Promise<void>;
|
|
411
|
+
getPayoutAccount(): Promise<{
|
|
412
|
+
has_account: boolean;
|
|
413
|
+
transfers_active: boolean;
|
|
414
|
+
payments_configured: boolean;
|
|
415
|
+
}>;
|
|
416
|
+
createPayoutAccountLink(): Promise<{
|
|
417
|
+
url: string;
|
|
418
|
+
}>;
|
|
220
419
|
/** GET /v1/testers/me/points — current point balance + breakdown. */
|
|
221
420
|
getMyPoints(): Promise<TesterPoints>;
|
|
222
421
|
/**
|
|
@@ -292,11 +491,6 @@ declare class TesterPayKitApiClient implements IApiClient {
|
|
|
292
491
|
* Server keys on device_token — a second POST with the same token updates the row.
|
|
293
492
|
*/
|
|
294
493
|
registerDevice(input: RegisterDeviceInput): Promise<TesterDeviceResponse>;
|
|
295
|
-
/**
|
|
296
|
-
* POST /v1/session-feedback
|
|
297
|
-
* Submit end-of-session feedback (rating, comments, etc.).
|
|
298
|
-
*/
|
|
299
|
-
submitSessionEndFeedback(payload: Record<string, unknown>): Promise<FeedbackResponse>;
|
|
300
494
|
/**
|
|
301
495
|
* Upload an attachment directly (not tied to a specific bug report).
|
|
302
496
|
* POST /v1/attachments — alternate path from the contract alongside
|
|
@@ -621,13 +815,30 @@ interface EnrollmentResponse {
|
|
|
621
815
|
interface TesterProfile {
|
|
622
816
|
id: string;
|
|
623
817
|
email?: string | null;
|
|
818
|
+
/** System handle, e.g. "sad-banana" (migration 074). */
|
|
624
819
|
handle?: string | null;
|
|
820
|
+
/** True once this install confirmed a phone number. */
|
|
821
|
+
phoneVerified?: boolean;
|
|
822
|
+
/** True once an admin approved the person (migration 077). */
|
|
823
|
+
approved?: boolean;
|
|
625
824
|
fullName?: string | null;
|
|
626
825
|
rating?: number | null;
|
|
627
826
|
pointsTotal?: number | null;
|
|
628
827
|
status?: string;
|
|
629
828
|
createdAt?: string;
|
|
630
829
|
}
|
|
830
|
+
interface PhoneStartResponse {
|
|
831
|
+
verificationId: string;
|
|
832
|
+
expiresInSeconds: number;
|
|
833
|
+
/** Only returned by a development server. */
|
|
834
|
+
devCode?: string;
|
|
835
|
+
}
|
|
836
|
+
interface PhoneConfirmResponse {
|
|
837
|
+
handle: string;
|
|
838
|
+
phoneVerified: boolean;
|
|
839
|
+
/** Tester status after the confirmation (e.g. `active`, `pending`). */
|
|
840
|
+
status?: string | null;
|
|
841
|
+
}
|
|
631
842
|
interface TesterPoints {
|
|
632
843
|
total: number;
|
|
633
844
|
breakdown?: Record<string, number>;
|
|
@@ -684,12 +895,6 @@ interface TesterDeviceResponse {
|
|
|
684
895
|
deviceToken: string;
|
|
685
896
|
deviceType: string;
|
|
686
897
|
}
|
|
687
|
-
/** Response from POST /v1/session-feedback */
|
|
688
|
-
interface FeedbackResponse {
|
|
689
|
-
id: string;
|
|
690
|
-
status: string;
|
|
691
|
-
message?: string;
|
|
692
|
-
}
|
|
693
898
|
/** A single retest item from GET /v1/testers/me/retests */
|
|
694
899
|
interface RetestItem {
|
|
695
900
|
id: string;
|
|
@@ -739,4 +944,4 @@ interface TaskStep {
|
|
|
739
944
|
}
|
|
740
945
|
|
|
741
946
|
export { TesterPayKitApiClient };
|
|
742
|
-
export type { AnonymousLoginResponse, ApiClientConfig, BugCategory, BugReportAttachmentInput, BugReportAttachmentResponse, BugReportPayload, BugReportResponse, BugReportType, BugSeverity, EarningsSummary, EndTesterSessionInput, EnrollmentResponse,
|
|
947
|
+
export type { AnonymousLoginResponse, ApiClientConfig, BugCategory, BugReportAttachmentInput, BugReportAttachmentResponse, BugReportPayload, BugReportResponse, BugReportType, BugSeverity, ChecklistRun, ChecklistRunInput, ChecklistStepResult, ChecklistTask, CompensationRates, CompensationWallet, EarningsSummary, EndTesterSessionInput, EnrollmentResponse, KnowledgeBaseAnswer, KnowledgeBaseCitation, KnowledgeFile, KnowledgeFileSummary, LiveNoteInput, MoneyEntry, MoneyKind, MoneyMode, MoneyTotals, MyBugReportSummary, MyBugReportsResponse, NotificationsResult, PaidAssignment, PayoutRecord, PhoneConfirmResponse, PhoneStartResponse, PushRegistration, RegisterDeviceInput, RetestItem, RetestStepVerdicts, SdkUpdateInfo, SessionBreadcrumbInput, SessionBreadcrumbsResponse, SessionEventInput, SessionEventsResponse, StartTesterSessionInput, SubmissionResponse, TaskListFilter, TaskListResponse, TaskPreset, TaskStep, TesterDeviceResponse, TesterGateReason, TesterPoints, TesterProfile, TesterSessionEndReason, TesterSessionResponse, TesterTask, TpkNotification, WorkCommand, WorkState };
|