@argos-ci/api-client 0.22.0 → 0.23.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
@@ -15,6 +15,10 @@ interface paths {
15
15
  };
16
16
  get?: never;
17
17
  put?: never;
18
+ /**
19
+ * Create a build
20
+ * @description Create a build and receive signed upload targets for its screenshots and Playwright traces. The response lists, for every file Argos doesn't already have, a secure `postUrl` with `fields` (or a legacy `putUrl`) to upload it to. Supports single and parallel builds.
21
+ */
18
22
  post: operations["createBuild"];
19
23
  delete?: never;
20
24
  options?: never;
@@ -31,6 +35,10 @@ interface paths {
31
35
  };
32
36
  get?: never;
33
37
  put?: never;
38
+ /**
39
+ * Create a deployment
40
+ * @description Create a deployment and receive signed upload URLs for the files Argos doesn't already store. Files already present (matched by content hash) are reused and omitted from `uploadFiles`. The environment is inferred from the branch when omitted.
41
+ */
34
42
  post: operations["createDeployment"];
35
43
  delete?: never;
36
44
  options?: never;
@@ -45,6 +53,10 @@ interface paths {
45
53
  path?: never;
46
54
  cookie?: never;
47
55
  };
56
+ /**
57
+ * Get a deployment
58
+ * @description Retrieve a single deployment by its ID.
59
+ */
48
60
  get: operations["getDeployment"];
49
61
  put?: never;
50
62
  post?: never;
@@ -63,6 +75,10 @@ interface paths {
63
75
  };
64
76
  get?: never;
65
77
  put?: never;
78
+ /**
79
+ * Finalize a deployment
80
+ * @description Mark a deployment as ready once all of its files have been uploaded. Argos assigns the deployment's aliases and starts serving it.
81
+ */
66
82
  post: operations["finalizeDeployment"];
67
83
  delete?: never;
68
84
  options?: never;
@@ -77,6 +93,10 @@ interface paths {
77
93
  path?: never;
78
94
  cookie?: never;
79
95
  };
96
+ /**
97
+ * Resolve a deployment domain
98
+ * @description Resolve a deployment domain or URL to the deployment it currently serves. This endpoint is public and does not require authentication.
99
+ */
80
100
  get: operations["resolveDeploymentDomain"];
81
101
  put?: never;
82
102
  post?: never;
@@ -95,6 +115,10 @@ interface paths {
95
115
  };
96
116
  get?: never;
97
117
  put?: never;
118
+ /**
119
+ * Finalize parallel builds
120
+ * @description Mark every parallel shard sharing the given `parallelNonce` as complete. Once finalized, Argos compares the aggregated screenshots and starts processing the build.
121
+ */
98
122
  post: operations["finalizeBuilds"];
99
123
  delete?: never;
100
124
  options?: never;
@@ -112,7 +136,7 @@ interface paths {
112
136
  get?: never;
113
137
  put?: never;
114
138
  /**
115
- * Exchange CLI authorization code for a token
139
+ * Exchange a CLI authorization code for a token
116
140
  * @description Called by the CLI to exchange a PKCE authorization code for an API token.
117
141
  */
118
142
  post: operations["exchangeCliToken"];
@@ -169,6 +193,10 @@ interface paths {
169
193
  path?: never;
170
194
  cookie?: never;
171
195
  };
196
+ /**
197
+ * Get the current project
198
+ * @description Retrieve the project associated with the project token used to authenticate the request.
199
+ */
172
200
  get: operations["getAuthProject"];
173
201
  put?: never;
174
202
  post?: never;
@@ -186,6 +214,10 @@ interface paths {
186
214
  cookie?: never;
187
215
  };
188
216
  get?: never;
217
+ /**
218
+ * Update a build
219
+ * @description Add screenshots to an existing build and update its metadata. Used to push the screenshots of a parallel shard, identified by `parallelIndex` and `parallelTotal`.
220
+ */
189
221
  put: operations["updateBuild"];
190
222
  post?: never;
191
223
  delete?: never;
@@ -201,6 +233,10 @@ interface paths {
201
233
  path?: never;
202
234
  cookie?: never;
203
235
  };
236
+ /**
237
+ * Get a project
238
+ * @description Retrieve a project by its owner (account slug) and project name.
239
+ */
204
240
  get: operations["getProject"];
205
241
  put?: never;
206
242
  post?: never;
@@ -217,6 +253,10 @@ interface paths {
217
253
  path?: never;
218
254
  cookie?: never;
219
255
  };
256
+ /**
257
+ * List a project's builds
258
+ * @description List the builds of a project, most recent first. Results are paginated. Use `distinctName` to return only the latest build per name and commit.
259
+ */
220
260
  get: operations["getProjectBuilds"];
221
261
  put?: never;
222
262
  post?: never;
@@ -233,6 +273,10 @@ interface paths {
233
273
  path?: never;
234
274
  cookie?: never;
235
275
  };
276
+ /**
277
+ * Get a build
278
+ * @description Retrieve a single build by its number within a project, including its status and metadata.
279
+ */
236
280
  get: operations["getBuild"];
237
281
  put?: never;
238
282
  post?: never;
@@ -249,6 +293,10 @@ interface paths {
249
293
  path?: never;
250
294
  cookie?: never;
251
295
  };
296
+ /**
297
+ * List a build's screenshot diffs
298
+ * @description List the screenshot diffs of a build, with pagination. Each diff compares a baseline screenshot to the one captured by the build. Use `onlyChanged` to return only the diffs that require review.
299
+ */
252
300
  get: operations["getBuildDiffs"];
253
301
  put?: never;
254
302
  post?: never;
@@ -265,8 +313,16 @@ interface paths {
265
313
  path?: never;
266
314
  cookie?: never;
267
315
  };
268
- get?: never;
269
- put?: never; /** Create a review on a specified build */
316
+ /**
317
+ * List the reviews submitted on a build
318
+ * @description List the reviews submitted on a build, with pagination.
319
+ */
320
+ get: operations["listReviews"];
321
+ put?: never;
322
+ /**
323
+ * Create a review on a build
324
+ * @description Submit a review on a build to approve or reject the changes it captured.
325
+ */
270
326
  post: operations["createReview"];
271
327
  delete?: never;
272
328
  options?: never;
@@ -274,6 +330,166 @@ interface paths {
274
330
  patch?: never;
275
331
  trace?: never;
276
332
  };
333
+ "/projects/{owner}/{project}/builds/{buildNumber}/reviews/{reviewId}/dismiss": {
334
+ parameters: {
335
+ query?: never;
336
+ header?: never;
337
+ path?: never;
338
+ cookie?: never;
339
+ };
340
+ get?: never;
341
+ put?: never;
342
+ /**
343
+ * Dismiss a submitted review on a build
344
+ * @description Dismiss a previously submitted review on a build, clearing its effect on the build's review status.
345
+ */
346
+ post: operations["dismissReview"];
347
+ delete?: never;
348
+ options?: never;
349
+ head?: never;
350
+ patch?: never;
351
+ trace?: never;
352
+ };
353
+ "/projects/{owner}/{project}/builds/{buildNumber}/comments": {
354
+ parameters: {
355
+ query?: never;
356
+ header?: never;
357
+ path?: never;
358
+ cookie?: never;
359
+ };
360
+ /**
361
+ * List the comments on a build
362
+ * @description List the comments on a build, with pagination.
363
+ */
364
+ get: operations["listComments"];
365
+ put?: never;
366
+ /**
367
+ * Post a comment (or reply) on a build
368
+ * @description Post a comment on a build. Start a new thread, reply to an existing one with `threadId`, optionally anchor the comment to a screenshot diff, or attach it to your pending review with `addToReview`.
369
+ */
370
+ post: operations["createComment"];
371
+ delete?: never;
372
+ options?: never;
373
+ head?: never;
374
+ patch?: never;
375
+ trace?: never;
376
+ };
377
+ "/projects/{owner}/{project}/builds/{buildNumber}/comments/{commentId}": {
378
+ parameters: {
379
+ query?: never;
380
+ header?: never;
381
+ path?: never;
382
+ cookie?: never;
383
+ };
384
+ /**
385
+ * Get a single comment on a build
386
+ * @description Retrieve a single comment on a build by its ID.
387
+ */
388
+ get: operations["getComment"];
389
+ put?: never;
390
+ post?: never;
391
+ /**
392
+ * Delete a comment on a build
393
+ * @description Delete a comment on a build. Only the comment's author can delete it.
394
+ */
395
+ delete: operations["deleteComment"];
396
+ options?: never;
397
+ head?: never;
398
+ /**
399
+ * Update a comment on a build
400
+ * @description Update the body of a comment on a build. Only the comment's author can edit it.
401
+ */
402
+ patch: operations["updateComment"];
403
+ trace?: never;
404
+ };
405
+ "/projects/{owner}/{project}/builds/{buildNumber}/comments/{commentId}/reactions": {
406
+ parameters: {
407
+ query?: never;
408
+ header?: never;
409
+ path?: never;
410
+ cookie?: never;
411
+ };
412
+ get?: never;
413
+ put?: never;
414
+ /**
415
+ * Add an emoji reaction to a comment
416
+ * @description Add an emoji reaction to a comment on behalf of the authenticated user.
417
+ */
418
+ post: operations["addCommentReaction"];
419
+ /**
420
+ * Remove an emoji reaction from a comment
421
+ * @description Remove an emoji reaction previously added by the authenticated user from a comment.
422
+ */
423
+ delete: operations["removeCommentReaction"];
424
+ options?: never;
425
+ head?: never;
426
+ patch?: never;
427
+ trace?: never;
428
+ };
429
+ "/projects/{owner}/{project}/builds/{buildNumber}/comments/{commentId}/resolve": {
430
+ parameters: {
431
+ query?: never;
432
+ header?: never;
433
+ path?: never;
434
+ cookie?: never;
435
+ };
436
+ get?: never;
437
+ put?: never;
438
+ /**
439
+ * Mark a comment thread as resolved
440
+ * @description Mark a comment thread as resolved.
441
+ */
442
+ post: operations["resolveCommentThread"];
443
+ delete?: never;
444
+ options?: never;
445
+ head?: never;
446
+ patch?: never;
447
+ trace?: never;
448
+ };
449
+ "/projects/{owner}/{project}/builds/{buildNumber}/comments/{commentId}/unresolve": {
450
+ parameters: {
451
+ query?: never;
452
+ header?: never;
453
+ path?: never;
454
+ cookie?: never;
455
+ };
456
+ get?: never;
457
+ put?: never;
458
+ /**
459
+ * Reopen a resolved comment thread
460
+ * @description Reopen a previously resolved comment thread.
461
+ */
462
+ post: operations["unresolveCommentThread"];
463
+ delete?: never;
464
+ options?: never;
465
+ head?: never;
466
+ patch?: never;
467
+ trace?: never;
468
+ };
469
+ "/projects/{owner}/{project}/builds/{buildNumber}/comments/{commentId}/subscription": {
470
+ parameters: {
471
+ query?: never;
472
+ header?: never;
473
+ path?: never;
474
+ cookie?: never;
475
+ };
476
+ get?: never;
477
+ put?: never;
478
+ /**
479
+ * Subscribe to a comment thread's notifications
480
+ * @description Subscribe the authenticated user to a comment thread to receive notifications about new replies.
481
+ */
482
+ post: operations["subscribeCommentThread"];
483
+ /**
484
+ * Unsubscribe from a comment thread's notifications
485
+ * @description Unsubscribe the authenticated user from a comment thread's notifications.
486
+ */
487
+ delete: operations["unsubscribeCommentThread"];
488
+ options?: never;
489
+ head?: never;
490
+ patch?: never;
491
+ trace?: never;
492
+ };
277
493
  }
278
494
  type webhooks = Record<string, never>;
279
495
  interface components {
@@ -597,6 +813,51 @@ interface components {
597
813
  url: string; /** @description Content type of the snapshot file */
598
814
  contentType: string;
599
815
  } | null;
816
+ }; /** @description Build review */
817
+ BuildReview: {
818
+ id: string;
819
+ buildId: string;
820
+ /**
821
+ * @description State of a build review: approved, rejected, commented (neutral) or pending (an unsubmitted draft).
822
+ * @enum {string}
823
+ */
824
+ state: "approved" | "rejected" | "commented" | "pending"; /** @description The user who submitted the review. */
825
+ user: components["schemas"]["User"] | null; /** @description Date the review was dismissed, null if not dismissed. */
826
+ dismissedAt: string | null; /** @description The user who dismissed the review, if any. */
827
+ dismissedBy: components["schemas"]["User"] | null; /** @description Date the review was created. */
828
+ date: string;
829
+ }; /** @description A user. */
830
+ User: {
831
+ id: string;
832
+ slug: string;
833
+ name: string | null;
834
+ }; /** @description A comment posted on a build. */
835
+ Comment: {
836
+ id: string;
837
+ buildId: string; /** @description Root comment ID when this comment is a reply. */
838
+ threadId: string | null; /** @description Rich-text JSON content of the comment. */
839
+ body: unknown; /** @description Plain-text rendering of the comment content. */
840
+ text: string;
841
+ author: components["schemas"]["User"] | null; /** @description Screenshot diff this comment is anchored to, if any. */
842
+ screenshotDiffId: string | null; /** @description Where the comment points on its screenshot diff. Null means the whole diff. */
843
+ anchor: ({
844
+ /** @constant */type: "point";
845
+ x: number;
846
+ y: number;
847
+ } | {
848
+ /** @constant */type: "lines";
849
+ from: number;
850
+ to: number;
851
+ }) | null; /** @description Whether the comment belongs to a pending (unsubmitted) review and is only visible to its author. */
852
+ pending: boolean; /** @description Date the thread was resolved, null if not resolved. Only set on a root comment. */
853
+ resolvedAt: string | null; /** @description Date the comment was last edited, null if never edited. */
854
+ editedAt: string | null; /** @description Date the comment was posted. */
855
+ createdAt: string;
856
+ reactions: {
857
+ /** @description The emoji used for the reaction. */emoji: string; /** @description Number of users who reacted with this emoji. */
858
+ count: number; /** @description The users who reacted with this emoji. */
859
+ users: components["schemas"]["User"][];
860
+ }[];
600
861
  };
601
862
  /**
602
863
  * @description The build number
@@ -1114,9 +1375,7 @@ interface operations {
1114
1375
  "application/json": {
1115
1376
  /** @description GitHub Actions OIDC token */oidcToken: string; /** @description GitHub repository in owner/name format */
1116
1377
  repository?: string; /** @description Expected commit SHA */
1117
- commit?: components["schemas"]["Sha1Hash"]; /** @description Expected branch name */
1118
- branch?: string; /** @description Expected pull request number */
1119
- pullRequestNumber?: number;
1378
+ commit?: components["schemas"]["Sha1Hash"];
1120
1379
  };
1121
1380
  };
1122
1381
  };
@@ -1294,7 +1553,8 @@ interface operations {
1294
1553
  screenshots: components["schemas"]["ScreenshotInput"][];
1295
1554
  parallel?: boolean | null;
1296
1555
  parallelTotal?: number | null;
1297
- parallelIndex?: number | null;
1556
+ parallelIndex?: number | null; /** @description Only used for non-parallel builds. Indicates that this is the last request of the build, so Argos can finalize it. A build whose screenshots are too large to fit in a single request can split them across several sequential requests, leaving `final` falsy on every request but the last. Defaults to `true`. */
1557
+ final?: boolean | null;
1298
1558
  metadata?: components["schemas"]["BuildMetadata"];
1299
1559
  };
1300
1560
  };
@@ -1610,6 +1870,69 @@ interface operations {
1610
1870
  };
1611
1871
  };
1612
1872
  };
1873
+ listReviews: {
1874
+ parameters: {
1875
+ query?: never;
1876
+ header?: never;
1877
+ path: {
1878
+ owner: string;
1879
+ project: string; /** @description The build number */
1880
+ buildNumber: components["schemas"]["BuildNumber"];
1881
+ };
1882
+ cookie?: never;
1883
+ };
1884
+ requestBody?: never;
1885
+ responses: {
1886
+ /** @description Build reviews */200: {
1887
+ headers: {
1888
+ [name: string]: unknown;
1889
+ };
1890
+ content: {
1891
+ "application/json": components["schemas"]["BuildReview"][];
1892
+ };
1893
+ }; /** @description Invalid parameters */
1894
+ 400: {
1895
+ headers: {
1896
+ [name: string]: unknown;
1897
+ };
1898
+ content: {
1899
+ "application/json": components["schemas"]["Error"];
1900
+ };
1901
+ }; /** @description Unauthorized */
1902
+ 401: {
1903
+ headers: {
1904
+ [name: string]: unknown;
1905
+ };
1906
+ content: {
1907
+ "application/json": components["schemas"]["Error"];
1908
+ };
1909
+ }; /** @description Forbidden */
1910
+ 403: {
1911
+ headers: {
1912
+ [name: string]: unknown;
1913
+ };
1914
+ content: {
1915
+ "application/json": components["schemas"]["Error"];
1916
+ };
1917
+ }; /** @description Not found */
1918
+ 404: {
1919
+ headers: {
1920
+ [name: string]: unknown;
1921
+ };
1922
+ content: {
1923
+ "application/json": components["schemas"]["Error"];
1924
+ };
1925
+ }; /** @description Server error */
1926
+ 500: {
1927
+ headers: {
1928
+ [name: string]: unknown;
1929
+ };
1930
+ content: {
1931
+ "application/json": components["schemas"]["Error"];
1932
+ };
1933
+ };
1934
+ };
1935
+ };
1613
1936
  createReview: {
1614
1937
  parameters: {
1615
1938
  query?: never;
@@ -1634,7 +1957,7 @@ interface operations {
1634
1957
  * @description Deprecated: use `event` instead. Overall review conclusion for the build: "APPROVE" or "REQUEST_CHANGES".
1635
1958
  * @enum {string}
1636
1959
  */
1637
- conclusion?: "APPROVE" | "REQUEST_CHANGES"; /** @description Optional comment to attach to the review. Expected as the JSON representation of a rich-text document. */
1960
+ conclusion?: "APPROVE" | "REQUEST_CHANGES"; /** @description Optional comment to attach to the review. Either Markdown text or the JSON representation of a rich-text document. */
1638
1961
  body?: unknown;
1639
1962
  /**
1640
1963
  * @description Optional per-snapshot review decisions. When omitted, only the build-level review is recorded.
@@ -1657,10 +1980,7 @@ interface operations {
1657
1980
  [name: string]: unknown;
1658
1981
  };
1659
1982
  content: {
1660
- "application/json": {
1661
- id: string; /** @enum {string} */
1662
- state: "approved" | "rejected" | "commented" | "pending";
1663
- };
1983
+ "application/json": components["schemas"]["BuildReview"];
1664
1984
  };
1665
1985
  }; /** @description Invalid parameters */
1666
1986
  400: {
@@ -1705,29 +2025,851 @@ interface operations {
1705
2025
  };
1706
2026
  };
1707
2027
  };
1708
- }
1709
- //#endregion
1710
- //#region src/fetch.d.ts
1711
- declare class APIError extends Error {
1712
- constructor(message: string);
1713
- }
1714
- //#endregion
1715
- //#region src/index.d.ts
1716
- type ArgosAPIClient = ReturnType<typeof createClient>;
1717
- /**
1718
- * Create Argos API client.
1719
- */
1720
- declare function createClient(options?: {
1721
- baseUrl?: string;
1722
- authToken?: string;
1723
- }): import("openapi-fetch").Client<paths, `${string}/${string}`>;
1724
- /**
1725
- * Handle API errors.
2028
+ dismissReview: {
2029
+ parameters: {
2030
+ query?: never;
2031
+ header?: never;
2032
+ path: {
2033
+ owner: string;
2034
+ project: string; /** @description The build number */
2035
+ buildNumber: components["schemas"]["BuildNumber"]; /** @description The ID of the review */
2036
+ reviewId: string;
2037
+ };
2038
+ cookie?: never;
2039
+ };
2040
+ requestBody?: never;
2041
+ responses: {
2042
+ /** @description Review dismissed successfully — returns the review */200: {
2043
+ headers: {
2044
+ [name: string]: unknown;
2045
+ };
2046
+ content: {
2047
+ "application/json": components["schemas"]["BuildReview"];
2048
+ };
2049
+ }; /** @description Invalid parameters */
2050
+ 400: {
2051
+ headers: {
2052
+ [name: string]: unknown;
2053
+ };
2054
+ content: {
2055
+ "application/json": components["schemas"]["Error"];
2056
+ };
2057
+ }; /** @description Unauthorized */
2058
+ 401: {
2059
+ headers: {
2060
+ [name: string]: unknown;
2061
+ };
2062
+ content: {
2063
+ "application/json": components["schemas"]["Error"];
2064
+ };
2065
+ }; /** @description Forbidden */
2066
+ 403: {
2067
+ headers: {
2068
+ [name: string]: unknown;
2069
+ };
2070
+ content: {
2071
+ "application/json": components["schemas"]["Error"];
2072
+ };
2073
+ }; /** @description Not found */
2074
+ 404: {
2075
+ headers: {
2076
+ [name: string]: unknown;
2077
+ };
2078
+ content: {
2079
+ "application/json": components["schemas"]["Error"];
2080
+ };
2081
+ }; /** @description Server error */
2082
+ 500: {
2083
+ headers: {
2084
+ [name: string]: unknown;
2085
+ };
2086
+ content: {
2087
+ "application/json": components["schemas"]["Error"];
2088
+ };
2089
+ };
2090
+ };
2091
+ };
2092
+ listComments: {
2093
+ parameters: {
2094
+ query?: never;
2095
+ header?: never;
2096
+ path: {
2097
+ owner: string;
2098
+ project: string; /** @description The build number */
2099
+ buildNumber: components["schemas"]["BuildNumber"];
2100
+ };
2101
+ cookie?: never;
2102
+ };
2103
+ requestBody?: never;
2104
+ responses: {
2105
+ /** @description Build comments, oldest first. Replies carry a threadId pointing at their root comment. */200: {
2106
+ headers: {
2107
+ [name: string]: unknown;
2108
+ };
2109
+ content: {
2110
+ "application/json": components["schemas"]["Comment"][];
2111
+ };
2112
+ }; /** @description Invalid parameters */
2113
+ 400: {
2114
+ headers: {
2115
+ [name: string]: unknown;
2116
+ };
2117
+ content: {
2118
+ "application/json": components["schemas"]["Error"];
2119
+ };
2120
+ }; /** @description Unauthorized */
2121
+ 401: {
2122
+ headers: {
2123
+ [name: string]: unknown;
2124
+ };
2125
+ content: {
2126
+ "application/json": components["schemas"]["Error"];
2127
+ };
2128
+ }; /** @description Forbidden */
2129
+ 403: {
2130
+ headers: {
2131
+ [name: string]: unknown;
2132
+ };
2133
+ content: {
2134
+ "application/json": components["schemas"]["Error"];
2135
+ };
2136
+ }; /** @description Not found */
2137
+ 404: {
2138
+ headers: {
2139
+ [name: string]: unknown;
2140
+ };
2141
+ content: {
2142
+ "application/json": components["schemas"]["Error"];
2143
+ };
2144
+ }; /** @description Server error */
2145
+ 500: {
2146
+ headers: {
2147
+ [name: string]: unknown;
2148
+ };
2149
+ content: {
2150
+ "application/json": components["schemas"]["Error"];
2151
+ };
2152
+ };
2153
+ };
2154
+ };
2155
+ createComment: {
2156
+ parameters: {
2157
+ query?: never;
2158
+ header?: never;
2159
+ path: {
2160
+ owner: string;
2161
+ project: string; /** @description The build number */
2162
+ buildNumber: components["schemas"]["BuildNumber"];
2163
+ };
2164
+ cookie?: never;
2165
+ };
2166
+ requestBody: {
2167
+ content: {
2168
+ "application/json": {
2169
+ /** @description Comment content. Either Markdown text or the JSON representation of a rich-text document. */body: string | {
2170
+ [key: string]: unknown;
2171
+ }; /** @description Root comment ID to reply to. */
2172
+ threadId?: string; /** @description Screenshot diff to anchor the comment to. Required when anchor is set. */
2173
+ screenshotDiffId?: string; /** @description Where on the referenced screenshot diff the comment points. A point uses normalized (0–1) coordinates; lines is a 1-based inclusive range. */
2174
+ anchor?: {
2175
+ /** @constant */type: "point";
2176
+ x: number;
2177
+ y: number;
2178
+ } | {
2179
+ /** @constant */type: "lines";
2180
+ from: number;
2181
+ to: number;
2182
+ }; /** @description Attach the comment to your pending review (created if needed) instead of posting it immediately. Ignored for replies, which inherit their thread's review. */
2183
+ addToReview?: boolean;
2184
+ };
2185
+ };
2186
+ };
2187
+ responses: {
2188
+ /** @description Comment created successfully — returns the comment */201: {
2189
+ headers: {
2190
+ [name: string]: unknown;
2191
+ };
2192
+ content: {
2193
+ "application/json": components["schemas"]["Comment"];
2194
+ };
2195
+ }; /** @description Invalid parameters */
2196
+ 400: {
2197
+ headers: {
2198
+ [name: string]: unknown;
2199
+ };
2200
+ content: {
2201
+ "application/json": components["schemas"]["Error"];
2202
+ };
2203
+ }; /** @description Unauthorized */
2204
+ 401: {
2205
+ headers: {
2206
+ [name: string]: unknown;
2207
+ };
2208
+ content: {
2209
+ "application/json": components["schemas"]["Error"];
2210
+ };
2211
+ }; /** @description Forbidden */
2212
+ 403: {
2213
+ headers: {
2214
+ [name: string]: unknown;
2215
+ };
2216
+ content: {
2217
+ "application/json": components["schemas"]["Error"];
2218
+ };
2219
+ }; /** @description Not found */
2220
+ 404: {
2221
+ headers: {
2222
+ [name: string]: unknown;
2223
+ };
2224
+ content: {
2225
+ "application/json": components["schemas"]["Error"];
2226
+ };
2227
+ }; /** @description Server error */
2228
+ 500: {
2229
+ headers: {
2230
+ [name: string]: unknown;
2231
+ };
2232
+ content: {
2233
+ "application/json": components["schemas"]["Error"];
2234
+ };
2235
+ };
2236
+ };
2237
+ };
2238
+ getComment: {
2239
+ parameters: {
2240
+ query?: never;
2241
+ header?: never;
2242
+ path: {
2243
+ owner: string;
2244
+ project: string; /** @description The build number */
2245
+ buildNumber: components["schemas"]["BuildNumber"]; /** @description The ID of the comment */
2246
+ commentId: string;
2247
+ };
2248
+ cookie?: never;
2249
+ };
2250
+ requestBody?: never;
2251
+ responses: {
2252
+ /** @description Comment */200: {
2253
+ headers: {
2254
+ [name: string]: unknown;
2255
+ };
2256
+ content: {
2257
+ "application/json": components["schemas"]["Comment"];
2258
+ };
2259
+ }; /** @description Invalid parameters */
2260
+ 400: {
2261
+ headers: {
2262
+ [name: string]: unknown;
2263
+ };
2264
+ content: {
2265
+ "application/json": components["schemas"]["Error"];
2266
+ };
2267
+ }; /** @description Unauthorized */
2268
+ 401: {
2269
+ headers: {
2270
+ [name: string]: unknown;
2271
+ };
2272
+ content: {
2273
+ "application/json": components["schemas"]["Error"];
2274
+ };
2275
+ }; /** @description Forbidden */
2276
+ 403: {
2277
+ headers: {
2278
+ [name: string]: unknown;
2279
+ };
2280
+ content: {
2281
+ "application/json": components["schemas"]["Error"];
2282
+ };
2283
+ }; /** @description Not found */
2284
+ 404: {
2285
+ headers: {
2286
+ [name: string]: unknown;
2287
+ };
2288
+ content: {
2289
+ "application/json": components["schemas"]["Error"];
2290
+ };
2291
+ }; /** @description Server error */
2292
+ 500: {
2293
+ headers: {
2294
+ [name: string]: unknown;
2295
+ };
2296
+ content: {
2297
+ "application/json": components["schemas"]["Error"];
2298
+ };
2299
+ };
2300
+ };
2301
+ };
2302
+ deleteComment: {
2303
+ parameters: {
2304
+ query?: never;
2305
+ header?: never;
2306
+ path: {
2307
+ owner: string;
2308
+ project: string; /** @description The build number */
2309
+ buildNumber: components["schemas"]["BuildNumber"]; /** @description The ID of the comment */
2310
+ commentId: string;
2311
+ };
2312
+ cookie?: never;
2313
+ };
2314
+ requestBody?: never;
2315
+ responses: {
2316
+ /** @description Comment deleted successfully — returns the comment */200: {
2317
+ headers: {
2318
+ [name: string]: unknown;
2319
+ };
2320
+ content: {
2321
+ "application/json": components["schemas"]["Comment"];
2322
+ };
2323
+ }; /** @description Invalid parameters */
2324
+ 400: {
2325
+ headers: {
2326
+ [name: string]: unknown;
2327
+ };
2328
+ content: {
2329
+ "application/json": components["schemas"]["Error"];
2330
+ };
2331
+ }; /** @description Unauthorized */
2332
+ 401: {
2333
+ headers: {
2334
+ [name: string]: unknown;
2335
+ };
2336
+ content: {
2337
+ "application/json": components["schemas"]["Error"];
2338
+ };
2339
+ }; /** @description Forbidden */
2340
+ 403: {
2341
+ headers: {
2342
+ [name: string]: unknown;
2343
+ };
2344
+ content: {
2345
+ "application/json": components["schemas"]["Error"];
2346
+ };
2347
+ }; /** @description Not found */
2348
+ 404: {
2349
+ headers: {
2350
+ [name: string]: unknown;
2351
+ };
2352
+ content: {
2353
+ "application/json": components["schemas"]["Error"];
2354
+ };
2355
+ }; /** @description Server error */
2356
+ 500: {
2357
+ headers: {
2358
+ [name: string]: unknown;
2359
+ };
2360
+ content: {
2361
+ "application/json": components["schemas"]["Error"];
2362
+ };
2363
+ };
2364
+ };
2365
+ };
2366
+ updateComment: {
2367
+ parameters: {
2368
+ query?: never;
2369
+ header?: never;
2370
+ path: {
2371
+ owner: string;
2372
+ project: string; /** @description The build number */
2373
+ buildNumber: components["schemas"]["BuildNumber"]; /** @description The ID of the comment */
2374
+ commentId: string;
2375
+ };
2376
+ cookie?: never;
2377
+ };
2378
+ requestBody: {
2379
+ content: {
2380
+ "application/json": {
2381
+ /** @description Comment content. Either Markdown text or the JSON representation of a rich-text document. */body: string | {
2382
+ [key: string]: unknown;
2383
+ };
2384
+ };
2385
+ };
2386
+ };
2387
+ responses: {
2388
+ /** @description Comment updated successfully — returns the comment */200: {
2389
+ headers: {
2390
+ [name: string]: unknown;
2391
+ };
2392
+ content: {
2393
+ "application/json": components["schemas"]["Comment"];
2394
+ };
2395
+ }; /** @description Invalid parameters */
2396
+ 400: {
2397
+ headers: {
2398
+ [name: string]: unknown;
2399
+ };
2400
+ content: {
2401
+ "application/json": components["schemas"]["Error"];
2402
+ };
2403
+ }; /** @description Unauthorized */
2404
+ 401: {
2405
+ headers: {
2406
+ [name: string]: unknown;
2407
+ };
2408
+ content: {
2409
+ "application/json": components["schemas"]["Error"];
2410
+ };
2411
+ }; /** @description Forbidden */
2412
+ 403: {
2413
+ headers: {
2414
+ [name: string]: unknown;
2415
+ };
2416
+ content: {
2417
+ "application/json": components["schemas"]["Error"];
2418
+ };
2419
+ }; /** @description Not found */
2420
+ 404: {
2421
+ headers: {
2422
+ [name: string]: unknown;
2423
+ };
2424
+ content: {
2425
+ "application/json": components["schemas"]["Error"];
2426
+ };
2427
+ }; /** @description Server error */
2428
+ 500: {
2429
+ headers: {
2430
+ [name: string]: unknown;
2431
+ };
2432
+ content: {
2433
+ "application/json": components["schemas"]["Error"];
2434
+ };
2435
+ };
2436
+ };
2437
+ };
2438
+ addCommentReaction: {
2439
+ parameters: {
2440
+ query?: never;
2441
+ header?: never;
2442
+ path: {
2443
+ owner: string;
2444
+ project: string; /** @description The build number */
2445
+ buildNumber: components["schemas"]["BuildNumber"]; /** @description The ID of the comment */
2446
+ commentId: string;
2447
+ };
2448
+ cookie?: never;
2449
+ };
2450
+ requestBody: {
2451
+ content: {
2452
+ "application/json": {
2453
+ /** @description The emoji to react with. */emoji: string;
2454
+ };
2455
+ };
2456
+ };
2457
+ responses: {
2458
+ /** @description Reaction added — returns the comment */200: {
2459
+ headers: {
2460
+ [name: string]: unknown;
2461
+ };
2462
+ content: {
2463
+ "application/json": components["schemas"]["Comment"];
2464
+ };
2465
+ }; /** @description Invalid parameters */
2466
+ 400: {
2467
+ headers: {
2468
+ [name: string]: unknown;
2469
+ };
2470
+ content: {
2471
+ "application/json": components["schemas"]["Error"];
2472
+ };
2473
+ }; /** @description Unauthorized */
2474
+ 401: {
2475
+ headers: {
2476
+ [name: string]: unknown;
2477
+ };
2478
+ content: {
2479
+ "application/json": components["schemas"]["Error"];
2480
+ };
2481
+ }; /** @description Forbidden */
2482
+ 403: {
2483
+ headers: {
2484
+ [name: string]: unknown;
2485
+ };
2486
+ content: {
2487
+ "application/json": components["schemas"]["Error"];
2488
+ };
2489
+ }; /** @description Not found */
2490
+ 404: {
2491
+ headers: {
2492
+ [name: string]: unknown;
2493
+ };
2494
+ content: {
2495
+ "application/json": components["schemas"]["Error"];
2496
+ };
2497
+ }; /** @description Server error */
2498
+ 500: {
2499
+ headers: {
2500
+ [name: string]: unknown;
2501
+ };
2502
+ content: {
2503
+ "application/json": components["schemas"]["Error"];
2504
+ };
2505
+ };
2506
+ };
2507
+ };
2508
+ removeCommentReaction: {
2509
+ parameters: {
2510
+ query: {
2511
+ /** @description The emoji reaction to remove. */emoji: string;
2512
+ };
2513
+ header?: never;
2514
+ path: {
2515
+ owner: string;
2516
+ project: string; /** @description The build number */
2517
+ buildNumber: components["schemas"]["BuildNumber"]; /** @description The ID of the comment */
2518
+ commentId: string;
2519
+ };
2520
+ cookie?: never;
2521
+ };
2522
+ requestBody?: never;
2523
+ responses: {
2524
+ /** @description Reaction removed — returns the comment */200: {
2525
+ headers: {
2526
+ [name: string]: unknown;
2527
+ };
2528
+ content: {
2529
+ "application/json": components["schemas"]["Comment"];
2530
+ };
2531
+ }; /** @description Invalid parameters */
2532
+ 400: {
2533
+ headers: {
2534
+ [name: string]: unknown;
2535
+ };
2536
+ content: {
2537
+ "application/json": components["schemas"]["Error"];
2538
+ };
2539
+ }; /** @description Unauthorized */
2540
+ 401: {
2541
+ headers: {
2542
+ [name: string]: unknown;
2543
+ };
2544
+ content: {
2545
+ "application/json": components["schemas"]["Error"];
2546
+ };
2547
+ }; /** @description Forbidden */
2548
+ 403: {
2549
+ headers: {
2550
+ [name: string]: unknown;
2551
+ };
2552
+ content: {
2553
+ "application/json": components["schemas"]["Error"];
2554
+ };
2555
+ }; /** @description Not found */
2556
+ 404: {
2557
+ headers: {
2558
+ [name: string]: unknown;
2559
+ };
2560
+ content: {
2561
+ "application/json": components["schemas"]["Error"];
2562
+ };
2563
+ }; /** @description Server error */
2564
+ 500: {
2565
+ headers: {
2566
+ [name: string]: unknown;
2567
+ };
2568
+ content: {
2569
+ "application/json": components["schemas"]["Error"];
2570
+ };
2571
+ };
2572
+ };
2573
+ };
2574
+ resolveCommentThread: {
2575
+ parameters: {
2576
+ query?: never;
2577
+ header?: never;
2578
+ path: {
2579
+ owner: string;
2580
+ project: string; /** @description The build number */
2581
+ buildNumber: components["schemas"]["BuildNumber"]; /** @description ID of any comment in the thread */
2582
+ commentId: string;
2583
+ };
2584
+ cookie?: never;
2585
+ };
2586
+ requestBody?: never;
2587
+ responses: {
2588
+ /** @description Thread resolved — returns the root comment */200: {
2589
+ headers: {
2590
+ [name: string]: unknown;
2591
+ };
2592
+ content: {
2593
+ "application/json": components["schemas"]["Comment"];
2594
+ };
2595
+ }; /** @description Invalid parameters */
2596
+ 400: {
2597
+ headers: {
2598
+ [name: string]: unknown;
2599
+ };
2600
+ content: {
2601
+ "application/json": components["schemas"]["Error"];
2602
+ };
2603
+ }; /** @description Unauthorized */
2604
+ 401: {
2605
+ headers: {
2606
+ [name: string]: unknown;
2607
+ };
2608
+ content: {
2609
+ "application/json": components["schemas"]["Error"];
2610
+ };
2611
+ }; /** @description Forbidden */
2612
+ 403: {
2613
+ headers: {
2614
+ [name: string]: unknown;
2615
+ };
2616
+ content: {
2617
+ "application/json": components["schemas"]["Error"];
2618
+ };
2619
+ }; /** @description Not found */
2620
+ 404: {
2621
+ headers: {
2622
+ [name: string]: unknown;
2623
+ };
2624
+ content: {
2625
+ "application/json": components["schemas"]["Error"];
2626
+ };
2627
+ }; /** @description Server error */
2628
+ 500: {
2629
+ headers: {
2630
+ [name: string]: unknown;
2631
+ };
2632
+ content: {
2633
+ "application/json": components["schemas"]["Error"];
2634
+ };
2635
+ };
2636
+ };
2637
+ };
2638
+ unresolveCommentThread: {
2639
+ parameters: {
2640
+ query?: never;
2641
+ header?: never;
2642
+ path: {
2643
+ owner: string;
2644
+ project: string; /** @description The build number */
2645
+ buildNumber: components["schemas"]["BuildNumber"]; /** @description ID of any comment in the thread */
2646
+ commentId: string;
2647
+ };
2648
+ cookie?: never;
2649
+ };
2650
+ requestBody?: never;
2651
+ responses: {
2652
+ /** @description Thread reopened — returns the root comment */200: {
2653
+ headers: {
2654
+ [name: string]: unknown;
2655
+ };
2656
+ content: {
2657
+ "application/json": components["schemas"]["Comment"];
2658
+ };
2659
+ }; /** @description Invalid parameters */
2660
+ 400: {
2661
+ headers: {
2662
+ [name: string]: unknown;
2663
+ };
2664
+ content: {
2665
+ "application/json": components["schemas"]["Error"];
2666
+ };
2667
+ }; /** @description Unauthorized */
2668
+ 401: {
2669
+ headers: {
2670
+ [name: string]: unknown;
2671
+ };
2672
+ content: {
2673
+ "application/json": components["schemas"]["Error"];
2674
+ };
2675
+ }; /** @description Forbidden */
2676
+ 403: {
2677
+ headers: {
2678
+ [name: string]: unknown;
2679
+ };
2680
+ content: {
2681
+ "application/json": components["schemas"]["Error"];
2682
+ };
2683
+ }; /** @description Not found */
2684
+ 404: {
2685
+ headers: {
2686
+ [name: string]: unknown;
2687
+ };
2688
+ content: {
2689
+ "application/json": components["schemas"]["Error"];
2690
+ };
2691
+ }; /** @description Server error */
2692
+ 500: {
2693
+ headers: {
2694
+ [name: string]: unknown;
2695
+ };
2696
+ content: {
2697
+ "application/json": components["schemas"]["Error"];
2698
+ };
2699
+ };
2700
+ };
2701
+ };
2702
+ subscribeCommentThread: {
2703
+ parameters: {
2704
+ query?: never;
2705
+ header?: never;
2706
+ path: {
2707
+ owner: string;
2708
+ project: string; /** @description The build number */
2709
+ buildNumber: components["schemas"]["BuildNumber"]; /** @description ID of any comment in the thread */
2710
+ commentId: string;
2711
+ };
2712
+ cookie?: never;
2713
+ };
2714
+ requestBody?: never;
2715
+ responses: {
2716
+ /** @description Subscribed — returns the root comment */200: {
2717
+ headers: {
2718
+ [name: string]: unknown;
2719
+ };
2720
+ content: {
2721
+ "application/json": components["schemas"]["Comment"];
2722
+ };
2723
+ }; /** @description Invalid parameters */
2724
+ 400: {
2725
+ headers: {
2726
+ [name: string]: unknown;
2727
+ };
2728
+ content: {
2729
+ "application/json": components["schemas"]["Error"];
2730
+ };
2731
+ }; /** @description Unauthorized */
2732
+ 401: {
2733
+ headers: {
2734
+ [name: string]: unknown;
2735
+ };
2736
+ content: {
2737
+ "application/json": components["schemas"]["Error"];
2738
+ };
2739
+ }; /** @description Forbidden */
2740
+ 403: {
2741
+ headers: {
2742
+ [name: string]: unknown;
2743
+ };
2744
+ content: {
2745
+ "application/json": components["schemas"]["Error"];
2746
+ };
2747
+ }; /** @description Not found */
2748
+ 404: {
2749
+ headers: {
2750
+ [name: string]: unknown;
2751
+ };
2752
+ content: {
2753
+ "application/json": components["schemas"]["Error"];
2754
+ };
2755
+ }; /** @description Server error */
2756
+ 500: {
2757
+ headers: {
2758
+ [name: string]: unknown;
2759
+ };
2760
+ content: {
2761
+ "application/json": components["schemas"]["Error"];
2762
+ };
2763
+ };
2764
+ };
2765
+ };
2766
+ unsubscribeCommentThread: {
2767
+ parameters: {
2768
+ query?: never;
2769
+ header?: never;
2770
+ path: {
2771
+ owner: string;
2772
+ project: string; /** @description The build number */
2773
+ buildNumber: components["schemas"]["BuildNumber"]; /** @description ID of any comment in the thread */
2774
+ commentId: string;
2775
+ };
2776
+ cookie?: never;
2777
+ };
2778
+ requestBody?: never;
2779
+ responses: {
2780
+ /** @description Unsubscribed — returns the root comment */200: {
2781
+ headers: {
2782
+ [name: string]: unknown;
2783
+ };
2784
+ content: {
2785
+ "application/json": components["schemas"]["Comment"];
2786
+ };
2787
+ }; /** @description Invalid parameters */
2788
+ 400: {
2789
+ headers: {
2790
+ [name: string]: unknown;
2791
+ };
2792
+ content: {
2793
+ "application/json": components["schemas"]["Error"];
2794
+ };
2795
+ }; /** @description Unauthorized */
2796
+ 401: {
2797
+ headers: {
2798
+ [name: string]: unknown;
2799
+ };
2800
+ content: {
2801
+ "application/json": components["schemas"]["Error"];
2802
+ };
2803
+ }; /** @description Forbidden */
2804
+ 403: {
2805
+ headers: {
2806
+ [name: string]: unknown;
2807
+ };
2808
+ content: {
2809
+ "application/json": components["schemas"]["Error"];
2810
+ };
2811
+ }; /** @description Not found */
2812
+ 404: {
2813
+ headers: {
2814
+ [name: string]: unknown;
2815
+ };
2816
+ content: {
2817
+ "application/json": components["schemas"]["Error"];
2818
+ };
2819
+ }; /** @description Server error */
2820
+ 500: {
2821
+ headers: {
2822
+ [name: string]: unknown;
2823
+ };
2824
+ content: {
2825
+ "application/json": components["schemas"]["Error"];
2826
+ };
2827
+ };
2828
+ };
2829
+ };
2830
+ }
2831
+ //#endregion
2832
+ //#region src/fetch.d.ts
2833
+ declare class APIError extends Error {
2834
+ /**
2835
+ * HTTP status code of the response that triggered the error, when available.
2836
+ */
2837
+ status?: number;
2838
+ /**
2839
+ * Raw error payload returned by the API (or the infrastructure in front of
2840
+ * it). Useful when the body does not match the expected error shape.
2841
+ */
2842
+ data?: unknown;
2843
+ constructor(message: string, options?: {
2844
+ status?: number;
2845
+ data?: unknown;
2846
+ cause?: unknown;
2847
+ });
2848
+ }
2849
+ //#endregion
2850
+ //#region src/index.d.ts
2851
+ type ArgosAPIClient = ReturnType<typeof createClient>;
2852
+ /**
2853
+ * Create Argos API client.
2854
+ */
2855
+ declare function createClient(options?: {
2856
+ baseUrl?: string;
2857
+ authToken?: string;
2858
+ }): import("openapi-fetch").Client<paths, `${string}/${string}`>;
2859
+ /**
2860
+ * Format an API error into a human-readable message.
2861
+ *
2862
+ * When the body matches the expected `{ error, details }` shape, it is used
2863
+ * directly. Otherwise — empty body, HTML error page, plain text, etc., which
2864
+ * happens when the response comes from infrastructure in front of the API
2865
+ * (proxy, load balancer, CDN, rate limiter) rather than from the API itself —
2866
+ * we fall back to the HTTP status and the raw body so the failure stays
2867
+ * debuggable instead of surfacing an empty message.
1726
2868
  */
1727
- declare function formatAPIError(error: components["schemas"]["Error"]): string;
2869
+ declare function formatAPIError(error: unknown, response?: Response): string;
1728
2870
  /**
1729
2871
  * Handle API errors.
1730
2872
  */
1731
- declare function throwAPIError(error: components["schemas"]["Error"]): never;
2873
+ declare function throwAPIError(error: unknown, response?: Response): never;
1732
2874
  //#endregion
1733
2875
  export { APIError, ArgosAPIClient, schema_d_exports as ArgosAPISchema, createClient, formatAPIError, throwAPIError };