@roarkanalytics/sdk 5.11.0 → 5.12.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.
@@ -26,6 +26,25 @@ export declare class MetricCollectionJob extends APIResource {
26
26
  * ```
27
27
  */
28
28
  list(query?: MetricCollectionJobListParams | null | undefined, options?: RequestOptions): APIPromise<MetricCollectionJobListResponse>;
29
+ /**
30
+ * Stops a metric collection job that has not finished. No further conversations
31
+ * are processed and the job ends in CANCELED.
32
+ *
33
+ * Items the job had not reached are marked SKIPPED. Metric values already produced
34
+ * are kept, and items that were mid-computation when the cancel arrived may still
35
+ * complete. Only the items that completed are billed.
36
+ *
37
+ * Safe to call more than once: a job that has already finished (COMPLETED, FAILED,
38
+ * or CANCELED) is returned unchanged.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const response = await client.metricCollectionJob.cancel(
43
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
44
+ * );
45
+ * ```
46
+ */
47
+ cancel(jobID: string, options?: RequestOptions): APIPromise<MetricCollectionJobCancelResponse>;
29
48
  /**
30
49
  * Returns a specific metric collection job with progress information.
31
50
  *
@@ -58,7 +77,8 @@ export declare namespace MetricCollectionJobCreateResponse {
58
77
  */
59
78
  completedAt: string | null;
60
79
  /**
61
- * Number of successfully completed items
80
+ * Number of items that finished without failing: a value was written, or the
81
+ * metric did not apply to the conversation
62
82
  */
63
83
  completedItems: number;
64
84
  /**
@@ -66,11 +86,13 @@ export declare namespace MetricCollectionJobCreateResponse {
66
86
  */
67
87
  createdAt: string;
68
88
  /**
69
- * Error message if the job failed
89
+ * Why the job failed or, on a COMPLETED job with failedItems above 0, why those
90
+ * items failed
70
91
  */
71
92
  errorMessage: string | null;
72
93
  /**
73
- * Number of failed items
94
+ * Number of items that could not be computed, for example because an artifact the
95
+ * metric reads (such as diarization) failed to generate
74
96
  */
75
97
  failedItems: number;
76
98
  /**
@@ -120,7 +142,8 @@ export declare namespace MetricCollectionJobListResponse {
120
142
  */
121
143
  completedAt: string | null;
122
144
  /**
123
- * Number of successfully completed items
145
+ * Number of items that finished without failing: a value was written, or the
146
+ * metric did not apply to the conversation
124
147
  */
125
148
  completedItems: number;
126
149
  /**
@@ -128,11 +151,13 @@ export declare namespace MetricCollectionJobListResponse {
128
151
  */
129
152
  createdAt: string;
130
153
  /**
131
- * Error message if the job failed
154
+ * Why the job failed or, on a COMPLETED job with failedItems above 0, why those
155
+ * items failed
132
156
  */
133
157
  errorMessage: string | null;
134
158
  /**
135
- * Number of failed items
159
+ * Number of items that could not be computed, for example because an artifact the
160
+ * metric reads (such as diarization) failed to generate
136
161
  */
137
162
  failedItems: number;
138
163
  /**
@@ -175,6 +200,70 @@ export declare namespace MetricCollectionJobListResponse {
175
200
  total: number;
176
201
  }
177
202
  }
203
+ export interface MetricCollectionJobCancelResponse {
204
+ /**
205
+ * A metric collection job that processes metrics for calls or chats
206
+ */
207
+ data: MetricCollectionJobCancelResponse.Data;
208
+ }
209
+ export declare namespace MetricCollectionJobCancelResponse {
210
+ /**
211
+ * A metric collection job that processes metrics for calls or chats
212
+ */
213
+ interface Data {
214
+ /**
215
+ * Unique identifier of the metric collection job
216
+ */
217
+ id: string;
218
+ /**
219
+ * When the job completed
220
+ */
221
+ completedAt: string | null;
222
+ /**
223
+ * Number of items that finished without failing: a value was written, or the
224
+ * metric did not apply to the conversation
225
+ */
226
+ completedItems: number;
227
+ /**
228
+ * When the job was created
229
+ */
230
+ createdAt: string;
231
+ /**
232
+ * Why the job failed or, on a COMPLETED job with failedItems above 0, why those
233
+ * items failed
234
+ */
235
+ errorMessage: string | null;
236
+ /**
237
+ * Number of items that could not be computed, for example because an artifact the
238
+ * metric reads (such as diarization) failed to generate
239
+ */
240
+ failedItems: number;
241
+ /**
242
+ * IDs of the metric policies that triggered this job
243
+ */
244
+ policyIds: Array<string>;
245
+ /**
246
+ * When the job started processing
247
+ */
248
+ startedAt: string | null;
249
+ /**
250
+ * Current status of the job
251
+ */
252
+ status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED';
253
+ /**
254
+ * Total number of call-metric pairs to process
255
+ */
256
+ totalItems: number;
257
+ /**
258
+ * What triggered this job
259
+ */
260
+ triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION';
261
+ /**
262
+ * When the job was last updated
263
+ */
264
+ updatedAt: string;
265
+ }
266
+ }
178
267
  export interface MetricCollectionJobGetByIDResponse {
179
268
  /**
180
269
  * A metric collection job that processes metrics for calls or chats
@@ -195,7 +284,8 @@ export declare namespace MetricCollectionJobGetByIDResponse {
195
284
  */
196
285
  completedAt: string | null;
197
286
  /**
198
- * Number of successfully completed items
287
+ * Number of items that finished without failing: a value was written, or the
288
+ * metric did not apply to the conversation
199
289
  */
200
290
  completedItems: number;
201
291
  /**
@@ -203,11 +293,13 @@ export declare namespace MetricCollectionJobGetByIDResponse {
203
293
  */
204
294
  createdAt: string;
205
295
  /**
206
- * Error message if the job failed
296
+ * Why the job failed or, on a COMPLETED job with failedItems above 0, why those
297
+ * items failed
207
298
  */
208
299
  errorMessage: string | null;
209
300
  /**
210
- * Number of failed items
301
+ * Number of items that could not be computed, for example because an artifact the
302
+ * metric reads (such as diarization) failed to generate
211
303
  */
212
304
  failedItems: number;
213
305
  /**
@@ -283,6 +375,6 @@ export interface MetricCollectionJobListParams {
283
375
  status?: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED';
284
376
  }
285
377
  export declare namespace MetricCollectionJob {
286
- export { type MetricCollectionJobCreateResponse as MetricCollectionJobCreateResponse, type MetricCollectionJobListResponse as MetricCollectionJobListResponse, type MetricCollectionJobGetByIDResponse as MetricCollectionJobGetByIDResponse, type MetricCollectionJobCreateParams as MetricCollectionJobCreateParams, type MetricCollectionJobListParams as MetricCollectionJobListParams, };
378
+ export { type MetricCollectionJobCreateResponse as MetricCollectionJobCreateResponse, type MetricCollectionJobListResponse as MetricCollectionJobListResponse, type MetricCollectionJobCancelResponse as MetricCollectionJobCancelResponse, type MetricCollectionJobGetByIDResponse as MetricCollectionJobGetByIDResponse, type MetricCollectionJobCreateParams as MetricCollectionJobCreateParams, type MetricCollectionJobListParams as MetricCollectionJobListParams, };
287
379
  }
288
380
  //# sourceMappingURL=metric-collection-job.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"metric-collection-job.d.ts","sourceRoot":"","sources":["../src/resources/metric-collection-job.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D,qBAAa,mBAAoB,SAAQ,WAAW;IAClD;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,IAAI,GAAE,+BAA+B,GAAG,IAAI,GAAG,SAAc,EAC7D,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iCAAiC,CAAC;IAIhD;;;;;;;;OAQG;IACH,IAAI,CACF,KAAK,GAAE,6BAA6B,GAAG,IAAI,GAAG,SAAc,EAC5D,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,+BAA+B,CAAC;IAI9C;;;;;;;;;OASG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kCAAkC,CAAC;CAGjG;AAED,MAAM,WAAW,iCAAiC;IAChD;;OAEG;IACH,IAAI,EAAE,iCAAiC,CAAC,IAAI,CAAC;CAC9C;AAED,yBAAiB,iCAAiC,CAAC;IACjD;;OAEG;IACH,UAAiB,IAAI;QACnB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAE3B;;WAEG;QACH,cAAc,EAAE,MAAM,CAAC;QAEvB;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB;;WAEG;QACH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G,UAAU,GAAG,eAAe,GAAG,YAAY,CAAC;QAEzE;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;KACnB;CACF;AAED,MAAM,WAAW,+BAA+B;IAC9C;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAExB;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAExB;;;;OAIG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,+BAA+B,CAAC,MAAM,CAAC,CAAC;IAExD;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,yBAAiB,+BAA+B,CAAC;IAC/C,UAAiB,MAAM;QACrB,EAAE,EAAE,MAAM,CAAC;KACZ;CACF;AAED,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;CACzE;AAED,MAAM,CAAC,OAAO,WAAW,mBAAmB,CAAC;IAC3C,OAAO,EACL,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,kCAAkC,IAAI,kCAAkC,EAC7E,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,6BAA6B,IAAI,6BAA6B,GACpE,CAAC;CACH"}
@@ -33,6 +33,27 @@ class MetricCollectionJob extends resource_1.APIResource {
33
33
  list(query = {}, options) {
34
34
  return this._client.get('/v1/metric/collection-jobs', { query, ...options });
35
35
  }
36
+ /**
37
+ * Stops a metric collection job that has not finished. No further conversations
38
+ * are processed and the job ends in CANCELED.
39
+ *
40
+ * Items the job had not reached are marked SKIPPED. Metric values already produced
41
+ * are kept, and items that were mid-computation when the cancel arrived may still
42
+ * complete. Only the items that completed are billed.
43
+ *
44
+ * Safe to call more than once: a job that has already finished (COMPLETED, FAILED,
45
+ * or CANCELED) is returned unchanged.
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * const response = await client.metricCollectionJob.cancel(
50
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
51
+ * );
52
+ * ```
53
+ */
54
+ cancel(jobID, options) {
55
+ return this._client.post((0, path_1.path) `/v1/metric/collection-jobs/${jobID}/cancel`, options);
56
+ }
36
57
  /**
37
58
  * Returns a specific metric collection job with progress information.
38
59
  *
@@ -1 +1 @@
1
- {"version":3,"file":"metric-collection-job.js","sourceRoot":"","sources":["../src/resources/metric-collection-job.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C,MAAa,mBAAoB,SAAQ,sBAAW;IAClD;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,OAA2D,EAAE,EAC7D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CACF,QAA0D,EAAE,EAC5D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;;OASG;IACH,OAAO,CAAC,KAAa,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,8BAA8B,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;CACF;AAlDD,kDAkDC"}
1
+ {"version":3,"file":"metric-collection-job.js","sourceRoot":"","sources":["../src/resources/metric-collection-job.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C,MAAa,mBAAoB,SAAQ,sBAAW;IAClD;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,OAA2D,EAAE,EAC7D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CACF,QAA0D,EAAE,EAC5D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,KAAa,EAAE,OAAwB;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,8BAA8B,KAAK,SAAS,EAAE,OAAO,CAAC,CAAC;IACtF,CAAC;IAED;;;;;;;;;OASG;IACH,OAAO,CAAC,KAAa,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,8BAA8B,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;CACF;AAxED,kDAwEC"}
@@ -30,6 +30,27 @@ export class MetricCollectionJob extends APIResource {
30
30
  list(query = {}, options) {
31
31
  return this._client.get('/v1/metric/collection-jobs', { query, ...options });
32
32
  }
33
+ /**
34
+ * Stops a metric collection job that has not finished. No further conversations
35
+ * are processed and the job ends in CANCELED.
36
+ *
37
+ * Items the job had not reached are marked SKIPPED. Metric values already produced
38
+ * are kept, and items that were mid-computation when the cancel arrived may still
39
+ * complete. Only the items that completed are billed.
40
+ *
41
+ * Safe to call more than once: a job that has already finished (COMPLETED, FAILED,
42
+ * or CANCELED) is returned unchanged.
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * const response = await client.metricCollectionJob.cancel(
47
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
48
+ * );
49
+ * ```
50
+ */
51
+ cancel(jobID, options) {
52
+ return this._client.post(path `/v1/metric/collection-jobs/${jobID}/cancel`, options);
53
+ }
33
54
  /**
34
55
  * Returns a specific metric collection job with progress information.
35
56
  *
@@ -1 +1 @@
1
- {"version":3,"file":"metric-collection-job.mjs","sourceRoot":"","sources":["../src/resources/metric-collection-job.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAG/C,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C,MAAM,OAAO,mBAAoB,SAAQ,WAAW;IAClD;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,OAA2D,EAAE,EAC7D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CACF,QAA0D,EAAE,EAC5D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;;OASG;IACH,OAAO,CAAC,KAAa,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,8BAA8B,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;CACF"}
1
+ {"version":3,"file":"metric-collection-job.mjs","sourceRoot":"","sources":["../src/resources/metric-collection-job.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAG/C,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C,MAAM,OAAO,mBAAoB,SAAQ,WAAW;IAClD;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,OAA2D,EAAE,EAC7D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CACF,QAA0D,EAAE,EAC5D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,KAAa,EAAE,OAAwB;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,8BAA8B,KAAK,SAAS,EAAE,OAAO,CAAC,CAAC;IACtF,CAAC;IAED;;;;;;;;;OASG;IACH,OAAO,CAAC,KAAa,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,8BAA8B,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;CACF"}
package/src/client.ts CHANGED
@@ -204,6 +204,7 @@ import {
204
204
  } from './resources/metric';
205
205
  import {
206
206
  MetricCollectionJob,
207
+ MetricCollectionJobCancelResponse,
207
208
  MetricCollectionJobCreateParams,
208
209
  MetricCollectionJobCreateResponse,
209
210
  MetricCollectionJobGetByIDResponse,
@@ -1250,6 +1251,7 @@ export declare namespace Roark {
1250
1251
  MetricCollectionJob as MetricCollectionJob,
1251
1252
  type MetricCollectionJobCreateResponse as MetricCollectionJobCreateResponse,
1252
1253
  type MetricCollectionJobListResponse as MetricCollectionJobListResponse,
1254
+ type MetricCollectionJobCancelResponse as MetricCollectionJobCancelResponse,
1253
1255
  type MetricCollectionJobGetByIDResponse as MetricCollectionJobGetByIDResponse,
1254
1256
  type MetricCollectionJobCreateParams as MetricCollectionJobCreateParams,
1255
1257
  type MetricCollectionJobListParams as MetricCollectionJobListParams,
@@ -560,7 +560,8 @@ export namespace CallAppendToolInvocationsResponse {
560
560
  completedAt: string | null;
561
561
 
562
562
  /**
563
- * Number of successfully completed items
563
+ * Number of items that finished without failing: a value was written, or the
564
+ * metric did not apply to the conversation
564
565
  */
565
566
  completedItems: number;
566
567
 
@@ -570,12 +571,14 @@ export namespace CallAppendToolInvocationsResponse {
570
571
  createdAt: string;
571
572
 
572
573
  /**
573
- * Error message if the job failed
574
+ * Why the job failed or, on a COMPLETED job with failedItems above 0, why those
575
+ * items failed
574
576
  */
575
577
  errorMessage: string | null;
576
578
 
577
579
  /**
578
- * Number of failed items
580
+ * Number of items that could not be computed, for example because an artifact the
581
+ * metric reads (such as diarization) failed to generate
579
582
  */
580
583
  failedItems: number;
581
584
 
@@ -1764,7 +1767,8 @@ export namespace CallUpdatePropertiesResponse {
1764
1767
  completedAt: string | null;
1765
1768
 
1766
1769
  /**
1767
- * Number of successfully completed items
1770
+ * Number of items that finished without failing: a value was written, or the
1771
+ * metric did not apply to the conversation
1768
1772
  */
1769
1773
  completedItems: number;
1770
1774
 
@@ -1774,12 +1778,14 @@ export namespace CallUpdatePropertiesResponse {
1774
1778
  createdAt: string;
1775
1779
 
1776
1780
  /**
1777
- * Error message if the job failed
1781
+ * Why the job failed or, on a COMPLETED job with failedItems above 0, why those
1782
+ * items failed
1778
1783
  */
1779
1784
  errorMessage: string | null;
1780
1785
 
1781
1786
  /**
1782
- * Number of failed items
1787
+ * Number of items that could not be computed, for example because an artifact the
1788
+ * metric reads (such as diarization) failed to generate
1783
1789
  */
1784
1790
  failedItems: number;
1785
1791
 
@@ -189,6 +189,7 @@ export {
189
189
  MetricCollectionJob,
190
190
  type MetricCollectionJobCreateResponse,
191
191
  type MetricCollectionJobListResponse,
192
+ type MetricCollectionJobCancelResponse,
192
193
  type MetricCollectionJobGetByIDResponse,
193
194
  type MetricCollectionJobCreateParams,
194
195
  type MetricCollectionJobListParams,
@@ -42,6 +42,28 @@ export class MetricCollectionJob extends APIResource {
42
42
  return this._client.get('/v1/metric/collection-jobs', { query, ...options });
43
43
  }
44
44
 
45
+ /**
46
+ * Stops a metric collection job that has not finished. No further conversations
47
+ * are processed and the job ends in CANCELED.
48
+ *
49
+ * Items the job had not reached are marked SKIPPED. Metric values already produced
50
+ * are kept, and items that were mid-computation when the cancel arrived may still
51
+ * complete. Only the items that completed are billed.
52
+ *
53
+ * Safe to call more than once: a job that has already finished (COMPLETED, FAILED,
54
+ * or CANCELED) is returned unchanged.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * const response = await client.metricCollectionJob.cancel(
59
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
60
+ * );
61
+ * ```
62
+ */
63
+ cancel(jobID: string, options?: RequestOptions): APIPromise<MetricCollectionJobCancelResponse> {
64
+ return this._client.post(path`/v1/metric/collection-jobs/${jobID}/cancel`, options);
65
+ }
66
+
45
67
  /**
46
68
  * Returns a specific metric collection job with progress information.
47
69
  *
@@ -80,7 +102,8 @@ export namespace MetricCollectionJobCreateResponse {
80
102
  completedAt: string | null;
81
103
 
82
104
  /**
83
- * Number of successfully completed items
105
+ * Number of items that finished without failing: a value was written, or the
106
+ * metric did not apply to the conversation
84
107
  */
85
108
  completedItems: number;
86
109
 
@@ -90,12 +113,14 @@ export namespace MetricCollectionJobCreateResponse {
90
113
  createdAt: string;
91
114
 
92
115
  /**
93
- * Error message if the job failed
116
+ * Why the job failed or, on a COMPLETED job with failedItems above 0, why those
117
+ * items failed
94
118
  */
95
119
  errorMessage: string | null;
96
120
 
97
121
  /**
98
- * Number of failed items
122
+ * Number of items that could not be computed, for example because an artifact the
123
+ * metric reads (such as diarization) failed to generate
99
124
  */
100
125
  failedItems: number;
101
126
 
@@ -156,7 +181,8 @@ export namespace MetricCollectionJobListResponse {
156
181
  completedAt: string | null;
157
182
 
158
183
  /**
159
- * Number of successfully completed items
184
+ * Number of items that finished without failing: a value was written, or the
185
+ * metric did not apply to the conversation
160
186
  */
161
187
  completedItems: number;
162
188
 
@@ -166,12 +192,14 @@ export namespace MetricCollectionJobListResponse {
166
192
  createdAt: string;
167
193
 
168
194
  /**
169
- * Error message if the job failed
195
+ * Why the job failed or, on a COMPLETED job with failedItems above 0, why those
196
+ * items failed
170
197
  */
171
198
  errorMessage: string | null;
172
199
 
173
200
  /**
174
- * Number of failed items
201
+ * Number of items that could not be computed, for example because an artifact the
202
+ * metric reads (such as diarization) failed to generate
175
203
  */
176
204
  failedItems: number;
177
205
 
@@ -224,6 +252,83 @@ export namespace MetricCollectionJobListResponse {
224
252
  }
225
253
  }
226
254
 
255
+ export interface MetricCollectionJobCancelResponse {
256
+ /**
257
+ * A metric collection job that processes metrics for calls or chats
258
+ */
259
+ data: MetricCollectionJobCancelResponse.Data;
260
+ }
261
+
262
+ export namespace MetricCollectionJobCancelResponse {
263
+ /**
264
+ * A metric collection job that processes metrics for calls or chats
265
+ */
266
+ export interface Data {
267
+ /**
268
+ * Unique identifier of the metric collection job
269
+ */
270
+ id: string;
271
+
272
+ /**
273
+ * When the job completed
274
+ */
275
+ completedAt: string | null;
276
+
277
+ /**
278
+ * Number of items that finished without failing: a value was written, or the
279
+ * metric did not apply to the conversation
280
+ */
281
+ completedItems: number;
282
+
283
+ /**
284
+ * When the job was created
285
+ */
286
+ createdAt: string;
287
+
288
+ /**
289
+ * Why the job failed or, on a COMPLETED job with failedItems above 0, why those
290
+ * items failed
291
+ */
292
+ errorMessage: string | null;
293
+
294
+ /**
295
+ * Number of items that could not be computed, for example because an artifact the
296
+ * metric reads (such as diarization) failed to generate
297
+ */
298
+ failedItems: number;
299
+
300
+ /**
301
+ * IDs of the metric policies that triggered this job
302
+ */
303
+ policyIds: Array<string>;
304
+
305
+ /**
306
+ * When the job started processing
307
+ */
308
+ startedAt: string | null;
309
+
310
+ /**
311
+ * Current status of the job
312
+ */
313
+ status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED';
314
+
315
+ /**
316
+ * Total number of call-metric pairs to process
317
+ */
318
+ totalItems: number;
319
+
320
+ /**
321
+ * What triggered this job
322
+ */
323
+ triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION';
324
+
325
+ /**
326
+ * When the job was last updated
327
+ */
328
+ updatedAt: string;
329
+ }
330
+ }
331
+
227
332
  export interface MetricCollectionJobGetByIDResponse {
228
333
  /**
229
334
  * A metric collection job that processes metrics for calls or chats
@@ -247,7 +352,8 @@ export namespace MetricCollectionJobGetByIDResponse {
247
352
  completedAt: string | null;
248
353
 
249
354
  /**
250
- * Number of successfully completed items
355
+ * Number of items that finished without failing: a value was written, or the
356
+ * metric did not apply to the conversation
251
357
  */
252
358
  completedItems: number;
253
359
 
@@ -257,12 +363,14 @@ export namespace MetricCollectionJobGetByIDResponse {
257
363
  createdAt: string;
258
364
 
259
365
  /**
260
- * Error message if the job failed
366
+ * Why the job failed or, on a COMPLETED job with failedItems above 0, why those
367
+ * items failed
261
368
  */
262
369
  errorMessage: string | null;
263
370
 
264
371
  /**
265
- * Number of failed items
372
+ * Number of items that could not be computed, for example because an artifact the
373
+ * metric reads (such as diarization) failed to generate
266
374
  */
267
375
  failedItems: number;
268
376
 
@@ -356,6 +464,7 @@ export declare namespace MetricCollectionJob {
356
464
  export {
357
465
  type MetricCollectionJobCreateResponse as MetricCollectionJobCreateResponse,
358
466
  type MetricCollectionJobListResponse as MetricCollectionJobListResponse,
467
+ type MetricCollectionJobCancelResponse as MetricCollectionJobCancelResponse,
359
468
  type MetricCollectionJobGetByIDResponse as MetricCollectionJobGetByIDResponse,
360
469
  type MetricCollectionJobCreateParams as MetricCollectionJobCreateParams,
361
470
  type MetricCollectionJobListParams as MetricCollectionJobListParams,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '5.11.0'; // x-release-please-version
1
+ export const VERSION = '5.12.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "5.11.0";
1
+ export declare const VERSION = "5.12.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "5.11.0";
1
+ export declare const VERSION = "5.12.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 = '5.11.0'; // x-release-please-version
4
+ exports.VERSION = '5.12.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '5.11.0'; // x-release-please-version
1
+ export const VERSION = '5.12.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map