scorecard-ai 2.1.1 → 2.2.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 (55) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/client.d.mts +6 -6
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +6 -6
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs +2 -2
  8. package/client.mjs.map +1 -1
  9. package/internal/to-file.d.mts +1 -1
  10. package/internal/to-file.d.ts +1 -1
  11. package/internal/to-file.js +1 -1
  12. package/internal/to-file.mjs +1 -1
  13. package/package.json +1 -1
  14. package/resources/index.d.mts +3 -3
  15. package/resources/index.d.mts.map +1 -1
  16. package/resources/index.d.ts +3 -3
  17. package/resources/index.d.ts.map +1 -1
  18. package/resources/index.js.map +1 -1
  19. package/resources/index.mjs +2 -2
  20. package/resources/index.mjs.map +1 -1
  21. package/resources/metrics.d.mts +348 -28
  22. package/resources/metrics.d.mts.map +1 -1
  23. package/resources/metrics.d.ts +348 -28
  24. package/resources/metrics.d.ts.map +1 -1
  25. package/resources/metrics.js +30 -0
  26. package/resources/metrics.js.map +1 -1
  27. package/resources/metrics.mjs +30 -0
  28. package/resources/metrics.mjs.map +1 -1
  29. package/resources/records.d.mts +30 -1
  30. package/resources/records.d.mts.map +1 -1
  31. package/resources/records.d.ts +30 -1
  32. package/resources/records.d.ts.map +1 -1
  33. package/resources/records.js +21 -0
  34. package/resources/records.js.map +1 -1
  35. package/resources/records.mjs +21 -0
  36. package/resources/records.mjs.map +1 -1
  37. package/resources/runs.d.mts +52 -5
  38. package/resources/runs.d.mts.map +1 -1
  39. package/resources/runs.d.ts +52 -5
  40. package/resources/runs.d.ts.map +1 -1
  41. package/resources/runs.js +30 -0
  42. package/resources/runs.js.map +1 -1
  43. package/resources/runs.mjs +30 -0
  44. package/resources/runs.mjs.map +1 -1
  45. package/src/client.ts +34 -5
  46. package/src/internal/to-file.ts +1 -1
  47. package/src/resources/index.ts +17 -3
  48. package/src/resources/metrics.ts +438 -27
  49. package/src/resources/records.ts +48 -1
  50. package/src/resources/runs.ts +76 -5
  51. package/src/version.ts +1 -1
  52. package/version.d.mts +1 -1
  53. package/version.d.ts +1 -1
  54. package/version.js +1 -1
  55. package/version.mjs +1 -1
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
4
  import { APIPromise } from '../core/api-promise';
5
+ import { PagePromise, PaginatedResponse, type PaginatedResponseParams } from '../core/pagination';
5
6
  import { RequestOptions } from '../internal/request-options';
6
7
  import { path } from '../internal/utils/path';
7
8
 
@@ -21,8 +22,45 @@ export class Runs extends APIResource {
21
22
  create(projectID: string, body: RunCreateParams, options?: RequestOptions): APIPromise<Run> {
22
23
  return this._client.post(path`/projects/${projectID}/runs`, { body, ...options });
23
24
  }
25
+
26
+ /**
27
+ * Retrieve a paginated list of all Runs for a Project. Runs are ordered by
28
+ * creation date, most recent first.
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * // Automatically fetches more pages as needed.
33
+ * for await (const run of client.runs.list('314')) {
34
+ * // ...
35
+ * }
36
+ * ```
37
+ */
38
+ list(
39
+ projectID: string,
40
+ query: RunListParams | null | undefined = {},
41
+ options?: RequestOptions,
42
+ ): PagePromise<RunsPaginatedResponse, Run> {
43
+ return this._client.getAPIList(path`/projects/${projectID}/runs`, PaginatedResponse<Run>, {
44
+ query,
45
+ ...options,
46
+ });
47
+ }
48
+
49
+ /**
50
+ * Retrieve a specific Run by ID.
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * const run = await client.runs.get('135');
55
+ * ```
56
+ */
57
+ get(runID: string, options?: RequestOptions): APIPromise<Run> {
58
+ return this._client.get(path`/runs/${runID}`, options);
59
+ }
24
60
  }
25
61
 
62
+ export type RunsPaginatedResponse = PaginatedResponse<Run>;
63
+
26
64
  /**
27
65
  * A Run in the Scorecard system.
28
66
  */
@@ -37,6 +75,27 @@ export interface Run {
37
75
  */
38
76
  metricIds: Array<string>;
39
77
 
78
+ /**
79
+ * The IDs of the metric versions this Run is using.
80
+ */
81
+ metricVersionIds: Array<string>;
82
+
83
+ /**
84
+ * The number of expected records in the Run. Determined by the number of testcases
85
+ * in the Run's Testset at the time of Run creation.
86
+ */
87
+ numExpectedRecords: number | null;
88
+
89
+ /**
90
+ * The number of records in the Run.
91
+ */
92
+ numRecords: number;
93
+
94
+ /**
95
+ * The number of completed scores in the Run so far.
96
+ */
97
+ numScores: number;
98
+
40
99
  /**
41
100
  * The status of the Run.
42
101
  */
@@ -50,14 +109,19 @@ export interface Run {
50
109
  | 'completed';
51
110
 
52
111
  /**
53
- * The ID of the Testset this Run is testing.
112
+ * The ID of the system this Run is using.
54
113
  */
55
- testsetId: string | null;
114
+ systemId: string | null;
56
115
 
57
116
  /**
58
117
  * The ID of the system version this Run is using.
59
118
  */
60
- systemVersionId?: string;
119
+ systemVersionId: string | null;
120
+
121
+ /**
122
+ * The ID of the Testset this Run is testing.
123
+ */
124
+ testsetId: string | null;
61
125
  }
62
126
 
63
127
  export interface RunCreateParams {
@@ -69,7 +133,7 @@ export interface RunCreateParams {
69
133
  /**
70
134
  * The ID of the system version this Run is using.
71
135
  */
72
- systemVersionId?: string;
136
+ systemVersionId?: string | null;
73
137
 
74
138
  /**
75
139
  * The ID of the Testset this Run is testing.
@@ -77,6 +141,13 @@ export interface RunCreateParams {
77
141
  testsetId?: string | null;
78
142
  }
79
143
 
144
+ export interface RunListParams extends PaginatedResponseParams {}
145
+
80
146
  export declare namespace Runs {
81
- export { type Run as Run, type RunCreateParams as RunCreateParams };
147
+ export {
148
+ type Run as Run,
149
+ type RunsPaginatedResponse as RunsPaginatedResponse,
150
+ type RunCreateParams as RunCreateParams,
151
+ type RunListParams as RunListParams,
152
+ };
82
153
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '2.1.1'; // x-release-please-version
1
+ export const VERSION = '2.2.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.1.1";
1
+ export declare const VERSION = "2.2.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.1.1";
1
+ export declare const VERSION = "2.2.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '2.1.1'; // x-release-please-version
4
+ exports.VERSION = '2.2.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.1.1'; // x-release-please-version
1
+ export const VERSION = '2.2.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map