@argos-ci/api-client 0.25.0 → 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 +321 -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;
@@ -355,9 +375,9 @@ interface paths {
355
375
  };
356
376
  /**
357
377
  * List a build's screenshot diffs
358
- * @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.
359
379
  */
360
- get: operations["getBuildDiffs"];
380
+ get: operations["listBuildDiffs"];
361
381
  put?: never;
362
382
  post?: never;
363
383
  delete?: never;
@@ -366,6 +386,46 @@ interface paths {
366
386
  patch?: never;
367
387
  trace?: never;
368
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
+ };
369
429
  "/projects/{owner}/{project}/builds/{buildNumber}/reviews": {
370
430
  parameters: {
371
431
  query?: never;
@@ -649,7 +709,61 @@ interface components {
649
709
  * @description The build number
650
710
  * @example 42
651
711
  */
652
- 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 */
653
767
  Build: {
654
768
  id: components["schemas"]["BuildId"];
655
769
  number: components["schemas"]["BuildNumberOutput"]; /** @description The head reference of the build */
@@ -700,12 +814,6 @@ interface components {
700
814
  BuildGitReference: {
701
815
  /** @description The commit SHA */sha: components["schemas"]["Sha1Hash"]; /** @description The branch name */
702
816
  branch: string;
703
- }; /** @description Error response */
704
- Error: {
705
- error: string;
706
- details?: {
707
- message: string;
708
- }[];
709
817
  }; /** @description A user. */
710
818
  User: {
711
819
  id: string;
@@ -878,6 +986,27 @@ interface components {
878
986
  url: string; /** @description Content type of the snapshot file */
879
987
  contentType: string;
880
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;
881
1010
  }; /** @description Build review */
882
1011
  BuildReview: {
883
1012
  id: string;
@@ -933,6 +1062,56 @@ interface components {
933
1062
  }
934
1063
  type $defs = Record<string, never>;
935
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
+ };
936
1115
  createBuild: {
937
1116
  parameters: {
938
1117
  query?: never;
@@ -2023,12 +2202,13 @@ interface operations {
2023
2202
  };
2024
2203
  };
2025
2204
  };
2026
- getBuildDiffs: {
2205
+ listBuildDiffs: {
2027
2206
  parameters: {
2028
2207
  query?: {
2029
2208
  /** @description Number of items per page (max 100) */perPage?: string; /** @description Page number */
2030
2209
  page?: string; /** @description Only return diffs that require review. Matches `changed`, `added`, and `removed`, except `removed` is excluded for subset builds. */
2031
- 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";
2032
2212
  };
2033
2213
  header?: never;
2034
2214
  path: {
@@ -2085,6 +2265,136 @@ interface operations {
2085
2265
  };
2086
2266
  };
2087
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
+ };
2088
2398
  listReviews: {
2089
2399
  parameters: {
2090
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.25.0",
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": "686b6fa8385ed77598ec86f66b073e9897cef176"
57
+ "gitHead": "e6b1b39775bc210c6b8fec81c59165c5a4aa4dc9"
58
58
  }