@argos-ci/api-client 0.24.4 → 0.26.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.
Files changed (2) hide show
  1. package/dist/index.d.mts +399 -11
  2. package/package.json +2 -2
package/dist/index.d.mts CHANGED
@@ -6,6 +6,26 @@ declare namespace schema_d_exports {
6
6
  * Do not make direct changes to the file.
7
7
  */
8
8
  interface paths {
9
+ "/accounts/{accountSlug}/analytics": {
10
+ parameters: {
11
+ query?: never;
12
+ header?: never;
13
+ path?: never;
14
+ cookie?: never;
15
+ };
16
+ /**
17
+ * Get account analytics
18
+ * @description Retrieve build and screenshot metrics for an account. The personal access token must be scoped to the account.
19
+ */
20
+ get: operations["getAccountAnalytics"];
21
+ put?: never;
22
+ post?: never;
23
+ delete?: never;
24
+ options?: never;
25
+ head?: never;
26
+ patch?: never;
27
+ trace?: never;
28
+ };
9
29
  "/builds": {
10
30
  parameters: {
11
31
  query?: never;
@@ -266,6 +286,26 @@ interface paths {
266
286
  patch?: never;
267
287
  trace?: never;
268
288
  };
289
+ "/projects": {
290
+ parameters: {
291
+ query?: never;
292
+ header?: never;
293
+ path?: never;
294
+ cookie?: never;
295
+ };
296
+ get?: never;
297
+ put?: never;
298
+ /**
299
+ * Create a project
300
+ * @description Create a new project in an account you administer. The authenticated personal access token must be scoped to the target account, and the acting user must be an administrator of it.
301
+ */
302
+ post: operations["createProject"];
303
+ delete?: never;
304
+ options?: never;
305
+ head?: never;
306
+ patch?: never;
307
+ trace?: never;
308
+ };
269
309
  "/projects/{owner}/{project}": {
270
310
  parameters: {
271
311
  query?: never;
@@ -335,9 +375,9 @@ interface paths {
335
375
  };
336
376
  /**
337
377
  * List a build's screenshot diffs
338
- * @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.
378
+ * @description List the screenshot diffs of a build, with pagination. Each diff compares a baseline screenshot to the one captured by the build. Each diff also carries its test's flakiness metrics and, when it is a change, its ignore state and occurrence count — so you can tell whether a change is worth reviewing or is just a flaky one. Use `needsReview` to return only the diffs that require review.
339
379
  */
340
- get: operations["getBuildDiffs"];
380
+ get: operations["listBuildDiffs"];
341
381
  put?: never;
342
382
  post?: never;
343
383
  delete?: never;
@@ -346,6 +386,46 @@ interface paths {
346
386
  patch?: never;
347
387
  trace?: never;
348
388
  };
389
+ "/projects/{owner}/{project}/changes/{changeId}/ignore": {
390
+ parameters: {
391
+ query?: never;
392
+ header?: never;
393
+ path?: never;
394
+ cookie?: never;
395
+ };
396
+ get?: never;
397
+ put?: never;
398
+ /**
399
+ * Ignore a test change
400
+ * @description Ignore a test change so its diffs no longer require review and are automatically approved on future builds. Use it to silence a change that has been identified as flaky.
401
+ */
402
+ post: operations["ignoreChange"];
403
+ delete?: never;
404
+ options?: never;
405
+ head?: never;
406
+ patch?: never;
407
+ trace?: never;
408
+ };
409
+ "/projects/{owner}/{project}/changes/{changeId}/unignore": {
410
+ parameters: {
411
+ query?: never;
412
+ header?: never;
413
+ path?: never;
414
+ cookie?: never;
415
+ };
416
+ get?: never;
417
+ put?: never;
418
+ /**
419
+ * Unignore a test change
420
+ * @description Stop ignoring a test change so its diffs require review again on future builds.
421
+ */
422
+ post: operations["unignoreChange"];
423
+ delete?: never;
424
+ options?: never;
425
+ head?: never;
426
+ patch?: never;
427
+ trace?: never;
428
+ };
349
429
  "/projects/{owner}/{project}/builds/{buildNumber}/reviews": {
350
430
  parameters: {
351
431
  query?: never;
@@ -629,7 +709,61 @@ interface components {
629
709
  * @description The build number
630
710
  * @example 42
631
711
  */
632
- BuildNumber: string; /** @description Build */
712
+ BuildNumber: string;
713
+ AccountAnalytics: {
714
+ screenshots: {
715
+ series: {
716
+ total: number; /** @description Counts keyed by project ID. Use the sibling `projects` array to resolve each project name. */
717
+ projects: {
718
+ [key: string]: number;
719
+ }; /** @description Unix timestamp in milliseconds at the start of the period. */
720
+ ts: number;
721
+ }[];
722
+ all: {
723
+ total: number; /** @description Counts keyed by project ID. Use the sibling `projects` array to resolve each project name. */
724
+ projects: {
725
+ [key: string]: number;
726
+ };
727
+ };
728
+ projects: {
729
+ id: string;
730
+ name: string;
731
+ }[];
732
+ };
733
+ builds: {
734
+ series: {
735
+ total: number; /** @description Counts keyed by project ID. Use the sibling `projects` array to resolve each project name. */
736
+ projects: {
737
+ [key: string]: number;
738
+ };
739
+ changesDetected: number;
740
+ noChanges: number;
741
+ accepted: number;
742
+ rejected: number; /** @description Unix timestamp in milliseconds at the start of the period. */
743
+ ts: number;
744
+ }[];
745
+ all: {
746
+ total: number; /** @description Counts keyed by project ID. Use the sibling `projects` array to resolve each project name. */
747
+ projects: {
748
+ [key: string]: number;
749
+ };
750
+ changesDetected: number;
751
+ noChanges: number;
752
+ accepted: number;
753
+ rejected: number;
754
+ };
755
+ projects: {
756
+ id: string;
757
+ name: string;
758
+ }[];
759
+ };
760
+ }; /** @description Error response */
761
+ Error: {
762
+ error: string;
763
+ details?: {
764
+ message: string;
765
+ }[];
766
+ }; /** @description Build */
633
767
  Build: {
634
768
  id: components["schemas"]["BuildId"];
635
769
  number: components["schemas"]["BuildNumberOutput"]; /** @description The head reference of the build */
@@ -680,12 +814,6 @@ interface components {
680
814
  BuildGitReference: {
681
815
  /** @description The commit SHA */sha: components["schemas"]["Sha1Hash"]; /** @description The branch name */
682
816
  branch: string;
683
- }; /** @description Error response */
684
- Error: {
685
- error: string;
686
- details?: {
687
- message: string;
688
- }[];
689
817
  }; /** @description A user. */
690
818
  User: {
691
819
  id: string;
@@ -858,6 +986,27 @@ interface components {
858
986
  url: string; /** @description Content type of the snapshot file */
859
987
  contentType: string;
860
988
  } | null;
989
+ test: components["schemas"]["Test"] | null;
990
+ change: components["schemas"]["Change"] | null;
991
+ }; /** @description Test associated to a diff, with flakiness metrics to help decide whether a change is worth reviewing. */
992
+ Test: {
993
+ /** @description Unique identifier of the test */id: string; /** @description Name of the test */
994
+ name: string; /** @description Name of the build the test belongs to */
995
+ buildName: string;
996
+ metrics: components["schemas"]["TestMetrics"];
997
+ }; /** @description Flakiness metrics of a test over the requested period. */
998
+ TestMetrics: {
999
+ /** @description Number of builds in which this test ran over the metrics period. */total: number; /** @description Number of times the test changed (produced a diff) over the metrics period. */
1000
+ changes: number; /** @description Number of changes that were seen only once over the metrics period. A high ratio of unique changes is a strong flakiness signal. */
1001
+ uniqueChanges: number; /** @description Ratio of builds without a change, between 0 and 1. `1` means the test never changed. */
1002
+ stability: number; /** @description How consistent the changes are, between 0 and 1. `1` means changes repeat the same way; a low value means changes are erratic. */
1003
+ consistency: number; /** @description Overall flakiness score between 0 and 1, derived from stability and consistency. `0` means stable, `1` means highly flaky. */
1004
+ flakiness: number;
1005
+ }; /** @description A test change: a specific visual difference (fingerprint) of a test that can be ignored to silence flaky changes. */
1006
+ Change: {
1007
+ /** @description Unique identifier of the change (a test + fingerprint pair). Use it with the ignore/unignore endpoints. */id: string; /** @description Whether this change is currently ignored. Ignored changes no longer require review and are automatically approved. */
1008
+ ignored: boolean; /** @description Number of times this change has been seen over the metrics period. A high count for a recurring change is a strong flakiness signal. */
1009
+ occurrences: number;
861
1010
  }; /** @description Build review */
862
1011
  BuildReview: {
863
1012
  id: string;
@@ -913,6 +1062,56 @@ interface components {
913
1062
  }
914
1063
  type $defs = Record<string, never>;
915
1064
  interface operations {
1065
+ getAccountAnalytics: {
1066
+ parameters: {
1067
+ query: {
1068
+ /** @description Start of the analytics period, as an ISO 8601 datetime. */from: string; /** @description End of the analytics period, as an ISO 8601 datetime. Defaults to the current time. */
1069
+ to?: string; /** @description Time period used to group each series data point. */
1070
+ groupBy: "day" | "week" | "month"; /** @description Optional project name filter. Pass one value or repeat the parameter for multiple projects. */
1071
+ projectNames?: string | string[];
1072
+ };
1073
+ header?: never;
1074
+ path: {
1075
+ /** @description Slug of the account to retrieve analytics for. */accountSlug: string;
1076
+ };
1077
+ cookie?: never;
1078
+ };
1079
+ requestBody?: never;
1080
+ responses: {
1081
+ /** @description Account analytics */200: {
1082
+ headers: {
1083
+ [name: string]: unknown;
1084
+ };
1085
+ content: {
1086
+ "application/json": components["schemas"]["AccountAnalytics"];
1087
+ };
1088
+ }; /** @description Invalid parameters */
1089
+ 400: {
1090
+ headers: {
1091
+ [name: string]: unknown;
1092
+ };
1093
+ content: {
1094
+ "application/json": components["schemas"]["Error"];
1095
+ };
1096
+ }; /** @description Unauthorized */
1097
+ 401: {
1098
+ headers: {
1099
+ [name: string]: unknown;
1100
+ };
1101
+ content: {
1102
+ "application/json": components["schemas"]["Error"];
1103
+ };
1104
+ }; /** @description Server error */
1105
+ 500: {
1106
+ headers: {
1107
+ [name: string]: unknown;
1108
+ };
1109
+ content: {
1110
+ "application/json": components["schemas"]["Error"];
1111
+ };
1112
+ };
1113
+ };
1114
+ };
916
1115
  createBuild: {
917
1116
  parameters: {
918
1117
  query?: never;
@@ -1757,6 +1956,64 @@ interface operations {
1757
1956
  };
1758
1957
  };
1759
1958
  };
1959
+ createProject: {
1960
+ parameters: {
1961
+ query?: never;
1962
+ header?: never;
1963
+ path?: never;
1964
+ cookie?: never;
1965
+ };
1966
+ requestBody: {
1967
+ content: {
1968
+ "application/json": {
1969
+ /** @description Name of the project to create. Must be unique within the account (case-insensitive) and cannot be a reserved name. */name: string; /** @description Slug of the account (personal or team) that will own the project. The personal access token must be scoped to this account and the acting user must be one of its administrators. */
1970
+ accountSlug: string;
1971
+ };
1972
+ };
1973
+ };
1974
+ responses: {
1975
+ /** @description Project created successfully — returns the project */201: {
1976
+ headers: {
1977
+ [name: string]: unknown;
1978
+ };
1979
+ content: {
1980
+ "application/json": components["schemas"]["Project"];
1981
+ };
1982
+ }; /** @description Invalid parameters */
1983
+ 400: {
1984
+ headers: {
1985
+ [name: string]: unknown;
1986
+ };
1987
+ content: {
1988
+ "application/json": components["schemas"]["Error"];
1989
+ };
1990
+ }; /** @description Unauthorized */
1991
+ 401: {
1992
+ headers: {
1993
+ [name: string]: unknown;
1994
+ };
1995
+ content: {
1996
+ "application/json": components["schemas"]["Error"];
1997
+ };
1998
+ }; /** @description Forbidden */
1999
+ 403: {
2000
+ headers: {
2001
+ [name: string]: unknown;
2002
+ };
2003
+ content: {
2004
+ "application/json": components["schemas"]["Error"];
2005
+ };
2006
+ }; /** @description Server error */
2007
+ 500: {
2008
+ headers: {
2009
+ [name: string]: unknown;
2010
+ };
2011
+ content: {
2012
+ "application/json": components["schemas"]["Error"];
2013
+ };
2014
+ };
2015
+ };
2016
+ };
1760
2017
  getProject: {
1761
2018
  parameters: {
1762
2019
  query?: never;
@@ -1945,12 +2202,13 @@ interface operations {
1945
2202
  };
1946
2203
  };
1947
2204
  };
1948
- getBuildDiffs: {
2205
+ listBuildDiffs: {
1949
2206
  parameters: {
1950
2207
  query?: {
1951
2208
  /** @description Number of items per page (max 100) */perPage?: string; /** @description Page number */
1952
2209
  page?: string; /** @description Only return diffs that require review. Matches `changed`, `added`, and `removed`, except `removed` is excluded for subset builds. */
1953
- needsReview?: string;
2210
+ needsReview?: string; /** @description Period over which the test flakiness metrics are computed. */
2211
+ metricsPeriod?: "LAST_24_HOURS" | "LAST_3_DAYS" | "LAST_7_DAYS" | "LAST_30_DAYS" | "LAST_90_DAYS";
1954
2212
  };
1955
2213
  header?: never;
1956
2214
  path: {
@@ -2007,6 +2265,136 @@ interface operations {
2007
2265
  };
2008
2266
  };
2009
2267
  };
2268
+ ignoreChange: {
2269
+ parameters: {
2270
+ query?: {
2271
+ /** @description Period over which the test flakiness metrics are computed. */metricsPeriod?: "LAST_24_HOURS" | "LAST_3_DAYS" | "LAST_7_DAYS" | "LAST_30_DAYS" | "LAST_90_DAYS";
2272
+ };
2273
+ header?: never;
2274
+ path: {
2275
+ owner: string;
2276
+ project: string; /** @description Identifier of the change to update, as returned in a diff's `change.id`. */
2277
+ changeId: string;
2278
+ };
2279
+ cookie?: never;
2280
+ };
2281
+ requestBody?: never;
2282
+ responses: {
2283
+ /** @description Change ignored — returns the updated change */200: {
2284
+ headers: {
2285
+ [name: string]: unknown;
2286
+ };
2287
+ content: {
2288
+ "application/json": components["schemas"]["Change"];
2289
+ };
2290
+ }; /** @description Invalid parameters */
2291
+ 400: {
2292
+ headers: {
2293
+ [name: string]: unknown;
2294
+ };
2295
+ content: {
2296
+ "application/json": components["schemas"]["Error"];
2297
+ };
2298
+ }; /** @description Unauthorized */
2299
+ 401: {
2300
+ headers: {
2301
+ [name: string]: unknown;
2302
+ };
2303
+ content: {
2304
+ "application/json": components["schemas"]["Error"];
2305
+ };
2306
+ }; /** @description Forbidden */
2307
+ 403: {
2308
+ headers: {
2309
+ [name: string]: unknown;
2310
+ };
2311
+ content: {
2312
+ "application/json": components["schemas"]["Error"];
2313
+ };
2314
+ }; /** @description Not found */
2315
+ 404: {
2316
+ headers: {
2317
+ [name: string]: unknown;
2318
+ };
2319
+ content: {
2320
+ "application/json": components["schemas"]["Error"];
2321
+ };
2322
+ }; /** @description Server error */
2323
+ 500: {
2324
+ headers: {
2325
+ [name: string]: unknown;
2326
+ };
2327
+ content: {
2328
+ "application/json": components["schemas"]["Error"];
2329
+ };
2330
+ };
2331
+ };
2332
+ };
2333
+ unignoreChange: {
2334
+ parameters: {
2335
+ query?: {
2336
+ /** @description Period over which the test flakiness metrics are computed. */metricsPeriod?: "LAST_24_HOURS" | "LAST_3_DAYS" | "LAST_7_DAYS" | "LAST_30_DAYS" | "LAST_90_DAYS";
2337
+ };
2338
+ header?: never;
2339
+ path: {
2340
+ owner: string;
2341
+ project: string; /** @description Identifier of the change to update, as returned in a diff's `change.id`. */
2342
+ changeId: string;
2343
+ };
2344
+ cookie?: never;
2345
+ };
2346
+ requestBody?: never;
2347
+ responses: {
2348
+ /** @description Change unignored — returns the updated change */200: {
2349
+ headers: {
2350
+ [name: string]: unknown;
2351
+ };
2352
+ content: {
2353
+ "application/json": components["schemas"]["Change"];
2354
+ };
2355
+ }; /** @description Invalid parameters */
2356
+ 400: {
2357
+ headers: {
2358
+ [name: string]: unknown;
2359
+ };
2360
+ content: {
2361
+ "application/json": components["schemas"]["Error"];
2362
+ };
2363
+ }; /** @description Unauthorized */
2364
+ 401: {
2365
+ headers: {
2366
+ [name: string]: unknown;
2367
+ };
2368
+ content: {
2369
+ "application/json": components["schemas"]["Error"];
2370
+ };
2371
+ }; /** @description Forbidden */
2372
+ 403: {
2373
+ headers: {
2374
+ [name: string]: unknown;
2375
+ };
2376
+ content: {
2377
+ "application/json": components["schemas"]["Error"];
2378
+ };
2379
+ }; /** @description Not found */
2380
+ 404: {
2381
+ headers: {
2382
+ [name: string]: unknown;
2383
+ };
2384
+ content: {
2385
+ "application/json": components["schemas"]["Error"];
2386
+ };
2387
+ }; /** @description Server error */
2388
+ 500: {
2389
+ headers: {
2390
+ [name: string]: unknown;
2391
+ };
2392
+ content: {
2393
+ "application/json": components["schemas"]["Error"];
2394
+ };
2395
+ };
2396
+ };
2397
+ };
2010
2398
  listReviews: {
2011
2399
  parameters: {
2012
2400
  query?: never;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@argos-ci/api-client",
3
3
  "description": "Argos API Client library.",
4
- "version": "0.24.4",
4
+ "version": "0.26.0",
5
5
  "author": "Smooth Code",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -54,5 +54,5 @@
54
54
  "openapi-fetch": "^0.17.0",
55
55
  "p-retry": "^8.0.0"
56
56
  },
57
- "gitHead": "1b25b7c1109a3d032d627c5f9d2f2c3937731aea"
57
+ "gitHead": "e6b1b39775bc210c6b8fec81c59165c5a4aa4dc9"
58
58
  }