@roarkanalytics/sdk 2.23.1 → 2.25.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.
- package/CHANGELOG.md +37 -0
- package/README.md +18 -23
- package/client.d.mts +14 -8
- package/client.d.mts.map +1 -1
- package/client.d.ts +14 -8
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +9 -3
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/call.d.mts +0 -20
- package/resources/call.d.mts.map +1 -1
- package/resources/call.d.ts +0 -20
- package/resources/call.d.ts.map +1 -1
- package/resources/evaluation.d.mts +0 -2783
- package/resources/evaluation.d.mts.map +1 -1
- package/resources/evaluation.d.ts +0 -2783
- package/resources/evaluation.d.ts.map +1 -1
- package/resources/evaluation.js +0 -46
- package/resources/evaluation.js.map +1 -1
- package/resources/evaluation.mjs +0 -46
- package/resources/evaluation.mjs.map +1 -1
- package/resources/index.d.mts +6 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +5 -3
- package/resources/index.mjs.map +1 -1
- package/resources/integrations.d.mts +0 -110
- package/resources/integrations.d.mts.map +1 -1
- package/resources/integrations.d.ts +0 -110
- package/resources/integrations.d.ts.map +1 -1
- package/resources/integrations.js +0 -37
- package/resources/integrations.js.map +1 -1
- package/resources/integrations.mjs +0 -37
- package/resources/integrations.mjs.map +1 -1
- package/resources/metric-collection-job.d.mts +237 -0
- package/resources/metric-collection-job.d.mts.map +1 -0
- package/resources/metric-collection-job.d.ts +237 -0
- package/resources/metric-collection-job.d.ts.map +1 -0
- package/resources/metric-collection-job.js +29 -0
- package/resources/metric-collection-job.js.map +1 -0
- package/resources/metric-collection-job.mjs +25 -0
- package/resources/metric-collection-job.mjs.map +1 -0
- package/resources/metric-policy.d.mts +502 -0
- package/resources/metric-policy.d.mts.map +1 -0
- package/resources/metric-policy.d.ts +502 -0
- package/resources/metric-policy.d.ts.map +1 -0
- package/resources/metric-policy.js +76 -0
- package/resources/metric-policy.js.map +1 -0
- package/resources/metric-policy.mjs +72 -0
- package/resources/metric-policy.mjs.map +1 -0
- package/resources/metric.d.mts +188 -2
- package/resources/metric.d.mts.map +1 -1
- package/resources/metric.d.ts +188 -2
- package/resources/metric.d.ts.map +1 -1
- package/resources/metric.js +21 -0
- package/resources/metric.js.map +1 -1
- package/resources/metric.mjs +21 -0
- package/resources/metric.mjs.map +1 -1
- package/resources/simulation-job.d.mts +12 -2
- package/resources/simulation-job.d.mts.map +1 -1
- package/resources/simulation-job.d.ts +12 -2
- package/resources/simulation-job.d.ts.map +1 -1
- package/resources/simulation-persona.d.mts +36 -6
- package/resources/simulation-persona.d.mts.map +1 -1
- package/resources/simulation-persona.d.ts +36 -6
- package/resources/simulation-persona.d.ts.map +1 -1
- package/resources/simulation-run-plan-job.d.mts +41 -5
- package/resources/simulation-run-plan-job.d.mts.map +1 -1
- package/resources/simulation-run-plan-job.d.ts +41 -5
- package/resources/simulation-run-plan-job.d.ts.map +1 -1
- package/resources/simulation-run-plan-job.js +4 -3
- package/resources/simulation-run-plan-job.js.map +1 -1
- package/resources/simulation-run-plan-job.mjs +4 -3
- package/resources/simulation-run-plan-job.mjs.map +1 -1
- package/resources/simulation-run-plan.d.mts +90 -16
- package/resources/simulation-run-plan.d.mts.map +1 -1
- package/resources/simulation-run-plan.d.ts +90 -16
- package/resources/simulation-run-plan.d.ts.map +1 -1
- package/resources/simulation-run-plan.js +2 -2
- package/resources/simulation-run-plan.mjs +2 -2
- package/resources/simulation-scenario.d.mts +27 -7
- package/resources/simulation-scenario.d.mts.map +1 -1
- package/resources/simulation-scenario.d.ts +27 -7
- package/resources/simulation-scenario.d.ts.map +1 -1
- package/src/client.ts +59 -43
- package/src/resources/call.ts +0 -20
- package/src/resources/evaluation.ts +1 -3570
- package/src/resources/index.ts +27 -22
- package/src/resources/integrations.ts +1 -131
- package/src/resources/metric-collection-job.ts +307 -0
- package/src/resources/metric-policy.ts +679 -0
- package/src/resources/metric.ts +233 -2
- package/src/resources/simulation-job.ts +14 -2
- package/src/resources/simulation-persona.ts +42 -6
- package/src/resources/simulation-run-plan-job.ts +46 -4
- package/src/resources/simulation-run-plan.ts +102 -16
- package/src/resources/simulation-scenario.ts +49 -3
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/resources/index.ts
CHANGED
|
@@ -34,21 +34,7 @@ export {
|
|
|
34
34
|
type CallGetTranscriptParams,
|
|
35
35
|
type CallListMetricsParams,
|
|
36
36
|
} from './call';
|
|
37
|
-
export {
|
|
38
|
-
Evaluation,
|
|
39
|
-
type EvaluationCreateEvaluatorResponse,
|
|
40
|
-
type EvaluationCreateJobResponse,
|
|
41
|
-
type EvaluationGetEvaluatorByIDResponse,
|
|
42
|
-
type EvaluationGetJobResponse,
|
|
43
|
-
type EvaluationListEvaluatorsResponse,
|
|
44
|
-
type EvaluationListJobRunsResponse,
|
|
45
|
-
type EvaluationUpdateEvaluatorResponse,
|
|
46
|
-
type EvaluationCreateEvaluatorParams,
|
|
47
|
-
type EvaluationCreateJobParams,
|
|
48
|
-
type EvaluationListEvaluatorsParams,
|
|
49
|
-
type EvaluationListJobRunsParams,
|
|
50
|
-
type EvaluationUpdateEvaluatorParams,
|
|
51
|
-
} from './evaluation';
|
|
37
|
+
export { Evaluation } from './evaluation';
|
|
52
38
|
export {
|
|
53
39
|
HTTPRequestDefinition,
|
|
54
40
|
type HTTPRequestDefinitionCreateResponse,
|
|
@@ -60,14 +46,32 @@ export {
|
|
|
60
46
|
type HTTPRequestDefinitionListParams,
|
|
61
47
|
} from './http-request-definition';
|
|
62
48
|
export { Health, type HealthGetResponse } from './health';
|
|
49
|
+
export { Integrations } from './integrations';
|
|
50
|
+
export {
|
|
51
|
+
Metric,
|
|
52
|
+
type MetricCreateDefinitionResponse,
|
|
53
|
+
type MetricListDefinitionsResponse,
|
|
54
|
+
type MetricCreateDefinitionParams,
|
|
55
|
+
} from './metric';
|
|
56
|
+
export {
|
|
57
|
+
MetricCollectionJob,
|
|
58
|
+
type MetricCollectionJobCreateResponse,
|
|
59
|
+
type MetricCollectionJobListResponse,
|
|
60
|
+
type MetricCollectionJobGetByIDResponse,
|
|
61
|
+
type MetricCollectionJobCreateParams,
|
|
62
|
+
type MetricCollectionJobListParams,
|
|
63
|
+
} from './metric-collection-job';
|
|
63
64
|
export {
|
|
64
|
-
|
|
65
|
-
type
|
|
66
|
-
type
|
|
67
|
-
type
|
|
68
|
-
type
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
MetricPolicy,
|
|
66
|
+
type MetricPolicyCreateResponse,
|
|
67
|
+
type MetricPolicyUpdateResponse,
|
|
68
|
+
type MetricPolicyListResponse,
|
|
69
|
+
type MetricPolicyDeleteResponse,
|
|
70
|
+
type MetricPolicyGetByIDResponse,
|
|
71
|
+
type MetricPolicyCreateParams,
|
|
72
|
+
type MetricPolicyUpdateParams,
|
|
73
|
+
type MetricPolicyListParams,
|
|
74
|
+
} from './metric-policy';
|
|
71
75
|
export {
|
|
72
76
|
SimulationJob,
|
|
73
77
|
type SimulationJobGetByIDResponse,
|
|
@@ -101,6 +105,7 @@ export {
|
|
|
101
105
|
type SimulationRunPlanJobGetByIDResponse,
|
|
102
106
|
type SimulationRunPlanJobStartResponse,
|
|
103
107
|
type SimulationRunPlanJobListParams,
|
|
108
|
+
type SimulationRunPlanJobStartParams,
|
|
104
109
|
} from './simulation-run-plan-job';
|
|
105
110
|
export {
|
|
106
111
|
SimulationScenario,
|
|
@@ -1,135 +1,5 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
|
-
import { APIPromise } from '../core/api-promise';
|
|
5
|
-
import { RequestOptions } from '../internal/request-options';
|
|
6
4
|
|
|
7
|
-
export class Integrations extends APIResource {
|
|
8
|
-
/**
|
|
9
|
-
* Process and upload a Retell call to Roark evaluation
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* const response = await client.integrations.createRetellCall(
|
|
14
|
-
* { retellCallEndedPayload: { event: 'bar', call: 'bar' } },
|
|
15
|
-
* );
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
createRetellCall(
|
|
19
|
-
body: IntegrationCreateRetellCallParams,
|
|
20
|
-
options?: RequestOptions,
|
|
21
|
-
): APIPromise<IntegrationCreateRetellCallResponse> {
|
|
22
|
-
return this._client.post('/v1/retell/call', { body, ...options });
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Process and upload a VAPI call to Roark evaluation
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```ts
|
|
30
|
-
* const response = await client.integrations.createVapiCall({
|
|
31
|
-
* vapiEndOfCallReportPayload: {
|
|
32
|
-
* call: 'bar',
|
|
33
|
-
* type: 'bar',
|
|
34
|
-
* status: 'bar',
|
|
35
|
-
* assistant: 'bar',
|
|
36
|
-
* customer: 'bar',
|
|
37
|
-
* phoneNumber: 'bar',
|
|
38
|
-
* artifact: 'bar',
|
|
39
|
-
* startedAt: 'bar',
|
|
40
|
-
* endedAt: 'bar',
|
|
41
|
-
* endedReason: 'bar',
|
|
42
|
-
* },
|
|
43
|
-
* });
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
createVapiCall(
|
|
47
|
-
body: IntegrationCreateVapiCallParams,
|
|
48
|
-
options?: RequestOptions,
|
|
49
|
-
): APIPromise<IntegrationCreateVapiCallResponse> {
|
|
50
|
-
return this._client.post('/v1/vapi/call', { body, ...options });
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export interface IntegrationCreateRetellCallResponse {
|
|
55
|
-
/**
|
|
56
|
-
* Retell call upload response
|
|
57
|
-
*/
|
|
58
|
-
data: IntegrationCreateRetellCallResponse.Data;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export namespace IntegrationCreateRetellCallResponse {
|
|
62
|
-
/**
|
|
63
|
-
* Retell call upload response
|
|
64
|
-
*/
|
|
65
|
-
export interface Data {
|
|
66
|
-
/**
|
|
67
|
-
* ID of the uploaded call
|
|
68
|
-
*/
|
|
69
|
-
callId: string;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export interface IntegrationCreateVapiCallResponse {
|
|
74
|
-
/**
|
|
75
|
-
* Vapi call upload response
|
|
76
|
-
*/
|
|
77
|
-
data: IntegrationCreateVapiCallResponse.Data;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export namespace IntegrationCreateVapiCallResponse {
|
|
81
|
-
/**
|
|
82
|
-
* Vapi call upload response
|
|
83
|
-
*/
|
|
84
|
-
export interface Data {
|
|
85
|
-
/**
|
|
86
|
-
* ID of the uploaded call
|
|
87
|
-
*/
|
|
88
|
-
callId: string;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export interface IntegrationCreateRetellCallParams {
|
|
93
|
-
/**
|
|
94
|
-
* Raw Retell data forwarded directly from the Retell call_ended webhook
|
|
95
|
-
*/
|
|
96
|
-
retellCallEndedPayload: { [key: string]: unknown };
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Optional metadata (key-value pairs) to include with the call. Useful for
|
|
100
|
-
* filtering and display in call details.
|
|
101
|
-
*/
|
|
102
|
-
properties?: { [key: string]: unknown };
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Skip already imported Retell calls with the same Retell call id.
|
|
106
|
-
*/
|
|
107
|
-
skipAlreadyImported?: boolean;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export interface IntegrationCreateVapiCallParams {
|
|
111
|
-
/**
|
|
112
|
-
* Raw Vapi data forwarded directly from the Vapi end-of-call-report webhook
|
|
113
|
-
*/
|
|
114
|
-
vapiEndOfCallReportPayload: { [key: string]: unknown };
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Optional metadata (key-value pairs) to include with the call. Useful for
|
|
118
|
-
* filtering and display in call details.
|
|
119
|
-
*/
|
|
120
|
-
properties?: { [key: string]: unknown };
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Skip already imported Vapi calls with the same Vapi call id.
|
|
124
|
-
*/
|
|
125
|
-
skipAlreadyImported?: boolean;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export declare namespace Integrations {
|
|
129
|
-
export {
|
|
130
|
-
type IntegrationCreateRetellCallResponse as IntegrationCreateRetellCallResponse,
|
|
131
|
-
type IntegrationCreateVapiCallResponse as IntegrationCreateVapiCallResponse,
|
|
132
|
-
type IntegrationCreateRetellCallParams as IntegrationCreateRetellCallParams,
|
|
133
|
-
type IntegrationCreateVapiCallParams as IntegrationCreateVapiCallParams,
|
|
134
|
-
};
|
|
135
|
-
}
|
|
5
|
+
export class Integrations extends APIResource {}
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
import { path } from '../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
export class MetricCollectionJob extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Creates a metric collection job for the specified calls and metrics, then
|
|
11
|
+
* triggers processing.
|
|
12
|
+
*/
|
|
13
|
+
create(
|
|
14
|
+
body: MetricCollectionJobCreateParams,
|
|
15
|
+
options?: RequestOptions,
|
|
16
|
+
): APIPromise<MetricCollectionJobCreateResponse> {
|
|
17
|
+
return this._client.post('/v1/metric/collection-jobs', { body, ...options });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Returns a paginated list of metric collection jobs for the project.
|
|
22
|
+
*/
|
|
23
|
+
list(
|
|
24
|
+
query: MetricCollectionJobListParams | null | undefined = {},
|
|
25
|
+
options?: RequestOptions,
|
|
26
|
+
): APIPromise<MetricCollectionJobListResponse> {
|
|
27
|
+
return this._client.get('/v1/metric/collection-jobs', { query, ...options });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Returns a specific metric collection job with progress information.
|
|
32
|
+
*/
|
|
33
|
+
getByID(jobID: string, options?: RequestOptions): APIPromise<MetricCollectionJobGetByIDResponse> {
|
|
34
|
+
return this._client.get(path`/v1/metric/collection-jobs/${jobID}`, options);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface MetricCollectionJobCreateResponse {
|
|
39
|
+
/**
|
|
40
|
+
* A metric collection job that processes metrics for calls
|
|
41
|
+
*/
|
|
42
|
+
data: MetricCollectionJobCreateResponse.Data;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export namespace MetricCollectionJobCreateResponse {
|
|
46
|
+
/**
|
|
47
|
+
* A metric collection job that processes metrics for calls
|
|
48
|
+
*/
|
|
49
|
+
export interface Data {
|
|
50
|
+
/**
|
|
51
|
+
* Unique identifier of the metric collection job
|
|
52
|
+
*/
|
|
53
|
+
id: string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* When the job completed
|
|
57
|
+
*/
|
|
58
|
+
completedAt: string | null;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Number of successfully completed items
|
|
62
|
+
*/
|
|
63
|
+
completedItems: number;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* When the job was created
|
|
67
|
+
*/
|
|
68
|
+
createdAt: string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Error message if the job failed
|
|
72
|
+
*/
|
|
73
|
+
errorMessage: string | null;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Number of failed items
|
|
77
|
+
*/
|
|
78
|
+
failedItems: number;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* When the job started processing
|
|
82
|
+
*/
|
|
83
|
+
startedAt: string | null;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Current status of the job
|
|
87
|
+
*/
|
|
88
|
+
status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED';
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Total number of call-metric pairs to process
|
|
92
|
+
*/
|
|
93
|
+
totalItems: number;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* What triggered this job
|
|
97
|
+
*/
|
|
98
|
+
triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION';
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* When the job was last updated
|
|
102
|
+
*/
|
|
103
|
+
updatedAt: string;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Paginated list of metric collection jobs
|
|
109
|
+
*/
|
|
110
|
+
export interface MetricCollectionJobListResponse {
|
|
111
|
+
data: Array<MetricCollectionJobListResponse.Data>;
|
|
112
|
+
|
|
113
|
+
pagination: MetricCollectionJobListResponse.Pagination;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export namespace MetricCollectionJobListResponse {
|
|
117
|
+
/**
|
|
118
|
+
* A metric collection job that processes metrics for calls
|
|
119
|
+
*/
|
|
120
|
+
export interface Data {
|
|
121
|
+
/**
|
|
122
|
+
* Unique identifier of the metric collection job
|
|
123
|
+
*/
|
|
124
|
+
id: string;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* When the job completed
|
|
128
|
+
*/
|
|
129
|
+
completedAt: string | null;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Number of successfully completed items
|
|
133
|
+
*/
|
|
134
|
+
completedItems: number;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* When the job was created
|
|
138
|
+
*/
|
|
139
|
+
createdAt: string;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Error message if the job failed
|
|
143
|
+
*/
|
|
144
|
+
errorMessage: string | null;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Number of failed items
|
|
148
|
+
*/
|
|
149
|
+
failedItems: number;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* When the job started processing
|
|
153
|
+
*/
|
|
154
|
+
startedAt: string | null;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Current status of the job
|
|
158
|
+
*/
|
|
159
|
+
status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED';
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Total number of call-metric pairs to process
|
|
163
|
+
*/
|
|
164
|
+
totalItems: number;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* What triggered this job
|
|
168
|
+
*/
|
|
169
|
+
triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION';
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* When the job was last updated
|
|
173
|
+
*/
|
|
174
|
+
updatedAt: string;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface Pagination {
|
|
178
|
+
/**
|
|
179
|
+
* Whether there are more items to fetch
|
|
180
|
+
*/
|
|
181
|
+
hasMore: boolean;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Cursor for the next page of items
|
|
185
|
+
*/
|
|
186
|
+
nextCursor: string | null;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Total number of items
|
|
190
|
+
*/
|
|
191
|
+
total: number;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export interface MetricCollectionJobGetByIDResponse {
|
|
196
|
+
/**
|
|
197
|
+
* A metric collection job that processes metrics for calls
|
|
198
|
+
*/
|
|
199
|
+
data: MetricCollectionJobGetByIDResponse.Data;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export namespace MetricCollectionJobGetByIDResponse {
|
|
203
|
+
/**
|
|
204
|
+
* A metric collection job that processes metrics for calls
|
|
205
|
+
*/
|
|
206
|
+
export interface Data {
|
|
207
|
+
/**
|
|
208
|
+
* Unique identifier of the metric collection job
|
|
209
|
+
*/
|
|
210
|
+
id: string;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* When the job completed
|
|
214
|
+
*/
|
|
215
|
+
completedAt: string | null;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Number of successfully completed items
|
|
219
|
+
*/
|
|
220
|
+
completedItems: number;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* When the job was created
|
|
224
|
+
*/
|
|
225
|
+
createdAt: string;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Error message if the job failed
|
|
229
|
+
*/
|
|
230
|
+
errorMessage: string | null;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Number of failed items
|
|
234
|
+
*/
|
|
235
|
+
failedItems: number;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* When the job started processing
|
|
239
|
+
*/
|
|
240
|
+
startedAt: string | null;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Current status of the job
|
|
244
|
+
*/
|
|
245
|
+
status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED';
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Total number of call-metric pairs to process
|
|
249
|
+
*/
|
|
250
|
+
totalItems: number;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* What triggered this job
|
|
254
|
+
*/
|
|
255
|
+
triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION';
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* When the job was last updated
|
|
259
|
+
*/
|
|
260
|
+
updatedAt: string;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export interface MetricCollectionJobCreateParams {
|
|
265
|
+
/**
|
|
266
|
+
* Call IDs to collect metrics for
|
|
267
|
+
*/
|
|
268
|
+
callIds: Array<string>;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Metric definitions to collect
|
|
272
|
+
*/
|
|
273
|
+
metrics: Array<MetricCollectionJobCreateParams.Metric>;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export namespace MetricCollectionJobCreateParams {
|
|
277
|
+
export interface Metric {
|
|
278
|
+
id: string;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export interface MetricCollectionJobListParams {
|
|
283
|
+
/**
|
|
284
|
+
* Cursor for pagination - use the nextCursor value from a previous response
|
|
285
|
+
*/
|
|
286
|
+
after?: string;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Maximum number of jobs to return (default: 20, max: 50)
|
|
290
|
+
*/
|
|
291
|
+
limit?: number;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Filter by job status
|
|
295
|
+
*/
|
|
296
|
+
status?: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED';
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export declare namespace MetricCollectionJob {
|
|
300
|
+
export {
|
|
301
|
+
type MetricCollectionJobCreateResponse as MetricCollectionJobCreateResponse,
|
|
302
|
+
type MetricCollectionJobListResponse as MetricCollectionJobListResponse,
|
|
303
|
+
type MetricCollectionJobGetByIDResponse as MetricCollectionJobGetByIDResponse,
|
|
304
|
+
type MetricCollectionJobCreateParams as MetricCollectionJobCreateParams,
|
|
305
|
+
type MetricCollectionJobListParams as MetricCollectionJobListParams,
|
|
306
|
+
};
|
|
307
|
+
}
|