@argos-ci/api-client 0.25.0 → 0.27.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 +330 -12
  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;
@@ -569,7 +629,15 @@ interface components {
569
629
  ScreenshotInput: {
570
630
  key: string;
571
631
  name: string;
572
- baseName?: string | null;
632
+ /**
633
+ * @description Name(s) to compare this screenshot against, instead of its own name. An array is tried in order: the first name that exists in the baseline wins, which lets a new screenshot fall back to an existing one.
634
+ * @example home.png
635
+ * @example [
636
+ * "home-variant-b.png",
637
+ * "home.png"
638
+ * ]
639
+ */
640
+ baseName?: (string | string[]) | null;
573
641
  parentName?: string | null;
574
642
  metadata?: {
575
643
  /**
@@ -649,7 +717,61 @@ interface components {
649
717
  * @description The build number
650
718
  * @example 42
651
719
  */
652
- BuildNumber: string; /** @description Build */
720
+ BuildNumber: string;
721
+ AccountAnalytics: {
722
+ screenshots: {
723
+ series: {
724
+ total: number; /** @description Counts keyed by project ID. Use the sibling `projects` array to resolve each project name. */
725
+ projects: {
726
+ [key: string]: number;
727
+ }; /** @description Unix timestamp in milliseconds at the start of the period. */
728
+ ts: number;
729
+ }[];
730
+ all: {
731
+ total: number; /** @description Counts keyed by project ID. Use the sibling `projects` array to resolve each project name. */
732
+ projects: {
733
+ [key: string]: number;
734
+ };
735
+ };
736
+ projects: {
737
+ id: string;
738
+ name: string;
739
+ }[];
740
+ };
741
+ builds: {
742
+ series: {
743
+ total: number; /** @description Counts keyed by project ID. Use the sibling `projects` array to resolve each project name. */
744
+ projects: {
745
+ [key: string]: number;
746
+ };
747
+ changesDetected: number;
748
+ noChanges: number;
749
+ accepted: number;
750
+ rejected: number; /** @description Unix timestamp in milliseconds at the start of the period. */
751
+ ts: number;
752
+ }[];
753
+ all: {
754
+ total: number; /** @description Counts keyed by project ID. Use the sibling `projects` array to resolve each project name. */
755
+ projects: {
756
+ [key: string]: number;
757
+ };
758
+ changesDetected: number;
759
+ noChanges: number;
760
+ accepted: number;
761
+ rejected: number;
762
+ };
763
+ projects: {
764
+ id: string;
765
+ name: string;
766
+ }[];
767
+ };
768
+ }; /** @description Error response */
769
+ Error: {
770
+ error: string;
771
+ details?: {
772
+ message: string;
773
+ }[];
774
+ }; /** @description Build */
653
775
  Build: {
654
776
  id: components["schemas"]["BuildId"];
655
777
  number: components["schemas"]["BuildNumberOutput"]; /** @description The head reference of the build */
@@ -700,12 +822,6 @@ interface components {
700
822
  BuildGitReference: {
701
823
  /** @description The commit SHA */sha: components["schemas"]["Sha1Hash"]; /** @description The branch name */
702
824
  branch: string;
703
- }; /** @description Error response */
704
- Error: {
705
- error: string;
706
- details?: {
707
- message: string;
708
- }[];
709
825
  }; /** @description A user. */
710
826
  User: {
711
827
  id: string;
@@ -878,6 +994,27 @@ interface components {
878
994
  url: string; /** @description Content type of the snapshot file */
879
995
  contentType: string;
880
996
  } | null;
997
+ test: components["schemas"]["Test"] | null;
998
+ change: components["schemas"]["Change"] | null;
999
+ }; /** @description Test associated to a diff, with flakiness metrics to help decide whether a change is worth reviewing. */
1000
+ Test: {
1001
+ /** @description Unique identifier of the test */id: string; /** @description Name of the test */
1002
+ name: string; /** @description Name of the build the test belongs to */
1003
+ buildName: string;
1004
+ metrics: components["schemas"]["TestMetrics"];
1005
+ }; /** @description Flakiness metrics of a test over the requested period. */
1006
+ TestMetrics: {
1007
+ /** @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. */
1008
+ 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. */
1009
+ uniqueChanges: number; /** @description Ratio of builds without a change, between 0 and 1. `1` means the test never changed. */
1010
+ 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. */
1011
+ consistency: number; /** @description Overall flakiness score between 0 and 1, derived from stability and consistency. `0` means stable, `1` means highly flaky. */
1012
+ flakiness: number;
1013
+ }; /** @description A test change: a specific visual difference (fingerprint) of a test that can be ignored to silence flaky changes. */
1014
+ Change: {
1015
+ /** @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. */
1016
+ 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. */
1017
+ occurrences: number;
881
1018
  }; /** @description Build review */
882
1019
  BuildReview: {
883
1020
  id: string;
@@ -933,6 +1070,56 @@ interface components {
933
1070
  }
934
1071
  type $defs = Record<string, never>;
935
1072
  interface operations {
1073
+ getAccountAnalytics: {
1074
+ parameters: {
1075
+ query: {
1076
+ /** @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. */
1077
+ to?: string; /** @description Time period used to group each series data point. */
1078
+ groupBy: "day" | "week" | "month"; /** @description Optional project name filter. Pass one value or repeat the parameter for multiple projects. */
1079
+ projectNames?: string | string[];
1080
+ };
1081
+ header?: never;
1082
+ path: {
1083
+ /** @description Slug of the account to retrieve analytics for. */accountSlug: string;
1084
+ };
1085
+ cookie?: never;
1086
+ };
1087
+ requestBody?: never;
1088
+ responses: {
1089
+ /** @description Account analytics */200: {
1090
+ headers: {
1091
+ [name: string]: unknown;
1092
+ };
1093
+ content: {
1094
+ "application/json": components["schemas"]["AccountAnalytics"];
1095
+ };
1096
+ }; /** @description Invalid parameters */
1097
+ 400: {
1098
+ headers: {
1099
+ [name: string]: unknown;
1100
+ };
1101
+ content: {
1102
+ "application/json": components["schemas"]["Error"];
1103
+ };
1104
+ }; /** @description Unauthorized */
1105
+ 401: {
1106
+ headers: {
1107
+ [name: string]: unknown;
1108
+ };
1109
+ content: {
1110
+ "application/json": components["schemas"]["Error"];
1111
+ };
1112
+ }; /** @description Server error */
1113
+ 500: {
1114
+ headers: {
1115
+ [name: string]: unknown;
1116
+ };
1117
+ content: {
1118
+ "application/json": components["schemas"]["Error"];
1119
+ };
1120
+ };
1121
+ };
1122
+ };
936
1123
  createBuild: {
937
1124
  parameters: {
938
1125
  query?: never;
@@ -2023,12 +2210,13 @@ interface operations {
2023
2210
  };
2024
2211
  };
2025
2212
  };
2026
- getBuildDiffs: {
2213
+ listBuildDiffs: {
2027
2214
  parameters: {
2028
2215
  query?: {
2029
2216
  /** @description Number of items per page (max 100) */perPage?: string; /** @description Page number */
2030
2217
  page?: string; /** @description Only return diffs that require review. Matches `changed`, `added`, and `removed`, except `removed` is excluded for subset builds. */
2031
- needsReview?: string;
2218
+ needsReview?: string; /** @description Period over which the test flakiness metrics are computed. */
2219
+ metricsPeriod?: "LAST_24_HOURS" | "LAST_3_DAYS" | "LAST_7_DAYS" | "LAST_30_DAYS" | "LAST_90_DAYS";
2032
2220
  };
2033
2221
  header?: never;
2034
2222
  path: {
@@ -2085,6 +2273,136 @@ interface operations {
2085
2273
  };
2086
2274
  };
2087
2275
  };
2276
+ ignoreChange: {
2277
+ parameters: {
2278
+ query?: {
2279
+ /** @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";
2280
+ };
2281
+ header?: never;
2282
+ path: {
2283
+ owner: string;
2284
+ project: string; /** @description Identifier of the change to update, as returned in a diff's `change.id`. */
2285
+ changeId: string;
2286
+ };
2287
+ cookie?: never;
2288
+ };
2289
+ requestBody?: never;
2290
+ responses: {
2291
+ /** @description Change ignored — returns the updated change */200: {
2292
+ headers: {
2293
+ [name: string]: unknown;
2294
+ };
2295
+ content: {
2296
+ "application/json": components["schemas"]["Change"];
2297
+ };
2298
+ }; /** @description Invalid parameters */
2299
+ 400: {
2300
+ headers: {
2301
+ [name: string]: unknown;
2302
+ };
2303
+ content: {
2304
+ "application/json": components["schemas"]["Error"];
2305
+ };
2306
+ }; /** @description Unauthorized */
2307
+ 401: {
2308
+ headers: {
2309
+ [name: string]: unknown;
2310
+ };
2311
+ content: {
2312
+ "application/json": components["schemas"]["Error"];
2313
+ };
2314
+ }; /** @description Forbidden */
2315
+ 403: {
2316
+ headers: {
2317
+ [name: string]: unknown;
2318
+ };
2319
+ content: {
2320
+ "application/json": components["schemas"]["Error"];
2321
+ };
2322
+ }; /** @description Not found */
2323
+ 404: {
2324
+ headers: {
2325
+ [name: string]: unknown;
2326
+ };
2327
+ content: {
2328
+ "application/json": components["schemas"]["Error"];
2329
+ };
2330
+ }; /** @description Server error */
2331
+ 500: {
2332
+ headers: {
2333
+ [name: string]: unknown;
2334
+ };
2335
+ content: {
2336
+ "application/json": components["schemas"]["Error"];
2337
+ };
2338
+ };
2339
+ };
2340
+ };
2341
+ unignoreChange: {
2342
+ parameters: {
2343
+ query?: {
2344
+ /** @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";
2345
+ };
2346
+ header?: never;
2347
+ path: {
2348
+ owner: string;
2349
+ project: string; /** @description Identifier of the change to update, as returned in a diff's `change.id`. */
2350
+ changeId: string;
2351
+ };
2352
+ cookie?: never;
2353
+ };
2354
+ requestBody?: never;
2355
+ responses: {
2356
+ /** @description Change unignored — returns the updated change */200: {
2357
+ headers: {
2358
+ [name: string]: unknown;
2359
+ };
2360
+ content: {
2361
+ "application/json": components["schemas"]["Change"];
2362
+ };
2363
+ }; /** @description Invalid parameters */
2364
+ 400: {
2365
+ headers: {
2366
+ [name: string]: unknown;
2367
+ };
2368
+ content: {
2369
+ "application/json": components["schemas"]["Error"];
2370
+ };
2371
+ }; /** @description Unauthorized */
2372
+ 401: {
2373
+ headers: {
2374
+ [name: string]: unknown;
2375
+ };
2376
+ content: {
2377
+ "application/json": components["schemas"]["Error"];
2378
+ };
2379
+ }; /** @description Forbidden */
2380
+ 403: {
2381
+ headers: {
2382
+ [name: string]: unknown;
2383
+ };
2384
+ content: {
2385
+ "application/json": components["schemas"]["Error"];
2386
+ };
2387
+ }; /** @description Not found */
2388
+ 404: {
2389
+ headers: {
2390
+ [name: string]: unknown;
2391
+ };
2392
+ content: {
2393
+ "application/json": components["schemas"]["Error"];
2394
+ };
2395
+ }; /** @description Server error */
2396
+ 500: {
2397
+ headers: {
2398
+ [name: string]: unknown;
2399
+ };
2400
+ content: {
2401
+ "application/json": components["schemas"]["Error"];
2402
+ };
2403
+ };
2404
+ };
2405
+ };
2088
2406
  listReviews: {
2089
2407
  parameters: {
2090
2408
  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.27.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": "a3083087b11004e0b315e2d14f1e9179cbd56da2"
58
58
  }