@roarkanalytics/sdk 2.24.0 → 2.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.
- package/CHANGELOG.md +25 -0
- package/client.d.mts +8 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +8 -2
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +7 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +3 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -1
- 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 +3 -1
- package/resources/index.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 +187 -1
- package/resources/metric.d.mts.map +1 -1
- package/resources/metric.d.ts +187 -1
- 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 +34 -2
- package/resources/simulation-job.d.mts.map +1 -1
- package/resources/simulation-job.d.ts +34 -2
- package/resources/simulation-job.d.ts.map +1 -1
- package/resources/simulation-persona.d.mts +102 -6
- package/resources/simulation-persona.d.mts.map +1 -1
- package/resources/simulation-persona.d.ts +102 -6
- package/resources/simulation-persona.d.ts.map +1 -1
- package/resources/simulation-run-plan-job.d.mts +24 -7
- package/resources/simulation-run-plan-job.d.mts.map +1 -1
- package/resources/simulation-run-plan-job.d.ts +24 -7
- package/resources/simulation-run-plan-job.d.ts.map +1 -1
- package/resources/simulation-run-plan.d.mts +31 -1
- package/resources/simulation-run-plan.d.mts.map +1 -1
- package/resources/simulation-run-plan.d.ts +31 -1
- package/resources/simulation-run-plan.d.ts.map +1 -1
- package/resources/webhook.d.mts +4 -4
- package/resources/webhook.d.mts.map +1 -1
- package/resources/webhook.d.ts +4 -4
- package/resources/webhook.d.ts.map +1 -1
- package/src/client.ts +56 -2
- package/src/resources/index.ts +25 -1
- package/src/resources/metric-collection-job.ts +307 -0
- package/src/resources/metric-policy.ts +679 -0
- package/src/resources/metric.ts +232 -1
- package/src/resources/simulation-job.ts +42 -2
- package/src/resources/simulation-persona.ts +126 -6
- package/src/resources/simulation-run-plan-job.ts +32 -6
- package/src/resources/simulation-run-plan.ts +38 -1
- package/src/resources/webhook.ts +4 -0
- 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
|
@@ -0,0 +1,679 @@
|
|
|
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 MetricPolicy extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new metric policy. Policies define which metrics to collect and under
|
|
11
|
+
* what conditions.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const metricPolicy = await client.metricPolicy.create({
|
|
16
|
+
* metrics: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }],
|
|
17
|
+
* name: 'Evaluate all inbound calls',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
create(body: MetricPolicyCreateParams, options?: RequestOptions): APIPromise<MetricPolicyCreateResponse> {
|
|
22
|
+
return this._client.post('/v1/metric/policies', { body, ...options });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Updates an existing metric policy. System policies cannot be modified.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const metricPolicy = await client.metricPolicy.update(
|
|
31
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
32
|
+
* );
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
update(
|
|
36
|
+
policyID: string,
|
|
37
|
+
body: MetricPolicyUpdateParams | null | undefined = {},
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<MetricPolicyUpdateResponse> {
|
|
40
|
+
return this._client.put(path`/v1/metric/policies/${policyID}`, { body, ...options });
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Returns a paginated list of metric policies for the project, including system
|
|
45
|
+
* policies.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const metricPolicies = await client.metricPolicy.list();
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
list(
|
|
53
|
+
query: MetricPolicyListParams | null | undefined = {},
|
|
54
|
+
options?: RequestOptions,
|
|
55
|
+
): APIPromise<MetricPolicyListResponse> {
|
|
56
|
+
return this._client.get('/v1/metric/policies', { query, ...options });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Soft-deletes a metric policy. System policies cannot be deleted.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* const metricPolicy = await client.metricPolicy.delete(
|
|
65
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
66
|
+
* );
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
delete(policyID: string, options?: RequestOptions): APIPromise<MetricPolicyDeleteResponse> {
|
|
70
|
+
return this._client.delete(path`/v1/metric/policies/${policyID}`, options);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Returns a specific metric policy with its conditions and metrics.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* const response = await client.metricPolicy.getByID(
|
|
79
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
80
|
+
* );
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
getByID(policyID: string, options?: RequestOptions): APIPromise<MetricPolicyGetByIDResponse> {
|
|
84
|
+
return this._client.get(path`/v1/metric/policies/${policyID}`, options);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface MetricPolicyCreateResponse {
|
|
89
|
+
/**
|
|
90
|
+
* A metric policy defining when metrics should be collected
|
|
91
|
+
*/
|
|
92
|
+
data: MetricPolicyCreateResponse.Data;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export namespace MetricPolicyCreateResponse {
|
|
96
|
+
/**
|
|
97
|
+
* A metric policy defining when metrics should be collected
|
|
98
|
+
*/
|
|
99
|
+
export interface Data {
|
|
100
|
+
/**
|
|
101
|
+
* Unique identifier of the metric policy
|
|
102
|
+
*/
|
|
103
|
+
id: string;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Condition groups for this policy. Null means the policy matches all calls.
|
|
107
|
+
*/
|
|
108
|
+
conditions: Array<Data.Condition> | null;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* When the policy was created
|
|
112
|
+
*/
|
|
113
|
+
createdAt: string;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Metric definitions associated with this policy
|
|
117
|
+
*/
|
|
118
|
+
metrics: Array<Data.Metric>;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Name of the metric policy
|
|
122
|
+
*/
|
|
123
|
+
name: string;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Status of the metric policy (ACTIVE or INACTIVE)
|
|
127
|
+
*/
|
|
128
|
+
status: 'ACTIVE' | 'INACTIVE';
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Type of the metric policy (SYSTEM or USER)
|
|
132
|
+
*/
|
|
133
|
+
type: 'SYSTEM' | 'USER';
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* When the policy was last updated
|
|
137
|
+
*/
|
|
138
|
+
updatedAt: string;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export namespace Data {
|
|
142
|
+
export interface Condition {
|
|
143
|
+
conditions: Array<Condition.Condition>;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export namespace Condition {
|
|
147
|
+
export interface Condition {
|
|
148
|
+
/**
|
|
149
|
+
* Key to match against. For AGENT: the agent ID. For CALL_SOURCE: the source name.
|
|
150
|
+
* For CALL_PROPERTY: the property key.
|
|
151
|
+
*/
|
|
152
|
+
conditionKey: string;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Comparison operator. Required for CALL_PROPERTY conditions.
|
|
156
|
+
*/
|
|
157
|
+
conditionOperator:
|
|
158
|
+
| 'EQUALS'
|
|
159
|
+
| 'NOT_EQUALS'
|
|
160
|
+
| 'CONTAINS'
|
|
161
|
+
| 'STARTS_WITH'
|
|
162
|
+
| 'GREATER_THAN'
|
|
163
|
+
| 'LESS_THAN'
|
|
164
|
+
| 'GREATER_THAN_OR_EQUALS'
|
|
165
|
+
| 'LESS_THAN_OR_EQUALS'
|
|
166
|
+
| null;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Type of condition: AGENT (match by agent ID), CALL_SOURCE (match by source e.g.
|
|
170
|
+
* VAPI, RETELL), CALL_PROPERTY (match by call property key/value)
|
|
171
|
+
*/
|
|
172
|
+
conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY';
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Value to compare against. Required for CALL_PROPERTY conditions.
|
|
176
|
+
*/
|
|
177
|
+
conditionValue: string | null;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export interface Metric {
|
|
182
|
+
id: string;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface MetricPolicyUpdateResponse {
|
|
188
|
+
/**
|
|
189
|
+
* A metric policy defining when metrics should be collected
|
|
190
|
+
*/
|
|
191
|
+
data: MetricPolicyUpdateResponse.Data;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export namespace MetricPolicyUpdateResponse {
|
|
195
|
+
/**
|
|
196
|
+
* A metric policy defining when metrics should be collected
|
|
197
|
+
*/
|
|
198
|
+
export interface Data {
|
|
199
|
+
/**
|
|
200
|
+
* Unique identifier of the metric policy
|
|
201
|
+
*/
|
|
202
|
+
id: string;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Condition groups for this policy. Null means the policy matches all calls.
|
|
206
|
+
*/
|
|
207
|
+
conditions: Array<Data.Condition> | null;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* When the policy was created
|
|
211
|
+
*/
|
|
212
|
+
createdAt: string;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Metric definitions associated with this policy
|
|
216
|
+
*/
|
|
217
|
+
metrics: Array<Data.Metric>;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Name of the metric policy
|
|
221
|
+
*/
|
|
222
|
+
name: string;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Status of the metric policy (ACTIVE or INACTIVE)
|
|
226
|
+
*/
|
|
227
|
+
status: 'ACTIVE' | 'INACTIVE';
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Type of the metric policy (SYSTEM or USER)
|
|
231
|
+
*/
|
|
232
|
+
type: 'SYSTEM' | 'USER';
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* When the policy was last updated
|
|
236
|
+
*/
|
|
237
|
+
updatedAt: string;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export namespace Data {
|
|
241
|
+
export interface Condition {
|
|
242
|
+
conditions: Array<Condition.Condition>;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export namespace Condition {
|
|
246
|
+
export interface Condition {
|
|
247
|
+
/**
|
|
248
|
+
* Key to match against. For AGENT: the agent ID. For CALL_SOURCE: the source name.
|
|
249
|
+
* For CALL_PROPERTY: the property key.
|
|
250
|
+
*/
|
|
251
|
+
conditionKey: string;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Comparison operator. Required for CALL_PROPERTY conditions.
|
|
255
|
+
*/
|
|
256
|
+
conditionOperator:
|
|
257
|
+
| 'EQUALS'
|
|
258
|
+
| 'NOT_EQUALS'
|
|
259
|
+
| 'CONTAINS'
|
|
260
|
+
| 'STARTS_WITH'
|
|
261
|
+
| 'GREATER_THAN'
|
|
262
|
+
| 'LESS_THAN'
|
|
263
|
+
| 'GREATER_THAN_OR_EQUALS'
|
|
264
|
+
| 'LESS_THAN_OR_EQUALS'
|
|
265
|
+
| null;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Type of condition: AGENT (match by agent ID), CALL_SOURCE (match by source e.g.
|
|
269
|
+
* VAPI, RETELL), CALL_PROPERTY (match by call property key/value)
|
|
270
|
+
*/
|
|
271
|
+
conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY';
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Value to compare against. Required for CALL_PROPERTY conditions.
|
|
275
|
+
*/
|
|
276
|
+
conditionValue: string | null;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export interface Metric {
|
|
281
|
+
id: string;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Paginated list of metric policies
|
|
288
|
+
*/
|
|
289
|
+
export interface MetricPolicyListResponse {
|
|
290
|
+
data: Array<MetricPolicyListResponse.Data>;
|
|
291
|
+
|
|
292
|
+
pagination: MetricPolicyListResponse.Pagination;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export namespace MetricPolicyListResponse {
|
|
296
|
+
/**
|
|
297
|
+
* A metric policy defining when metrics should be collected
|
|
298
|
+
*/
|
|
299
|
+
export interface Data {
|
|
300
|
+
/**
|
|
301
|
+
* Unique identifier of the metric policy
|
|
302
|
+
*/
|
|
303
|
+
id: string;
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Condition groups for this policy. Null means the policy matches all calls.
|
|
307
|
+
*/
|
|
308
|
+
conditions: Array<Data.Condition> | null;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* When the policy was created
|
|
312
|
+
*/
|
|
313
|
+
createdAt: string;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Metric definitions associated with this policy
|
|
317
|
+
*/
|
|
318
|
+
metrics: Array<Data.Metric>;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Name of the metric policy
|
|
322
|
+
*/
|
|
323
|
+
name: string;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Status of the metric policy (ACTIVE or INACTIVE)
|
|
327
|
+
*/
|
|
328
|
+
status: 'ACTIVE' | 'INACTIVE';
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Type of the metric policy (SYSTEM or USER)
|
|
332
|
+
*/
|
|
333
|
+
type: 'SYSTEM' | 'USER';
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* When the policy was last updated
|
|
337
|
+
*/
|
|
338
|
+
updatedAt: string;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export namespace Data {
|
|
342
|
+
export interface Condition {
|
|
343
|
+
conditions: Array<Condition.Condition>;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export namespace Condition {
|
|
347
|
+
export interface Condition {
|
|
348
|
+
/**
|
|
349
|
+
* Key to match against. For AGENT: the agent ID. For CALL_SOURCE: the source name.
|
|
350
|
+
* For CALL_PROPERTY: the property key.
|
|
351
|
+
*/
|
|
352
|
+
conditionKey: string;
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Comparison operator. Required for CALL_PROPERTY conditions.
|
|
356
|
+
*/
|
|
357
|
+
conditionOperator:
|
|
358
|
+
| 'EQUALS'
|
|
359
|
+
| 'NOT_EQUALS'
|
|
360
|
+
| 'CONTAINS'
|
|
361
|
+
| 'STARTS_WITH'
|
|
362
|
+
| 'GREATER_THAN'
|
|
363
|
+
| 'LESS_THAN'
|
|
364
|
+
| 'GREATER_THAN_OR_EQUALS'
|
|
365
|
+
| 'LESS_THAN_OR_EQUALS'
|
|
366
|
+
| null;
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Type of condition: AGENT (match by agent ID), CALL_SOURCE (match by source e.g.
|
|
370
|
+
* VAPI, RETELL), CALL_PROPERTY (match by call property key/value)
|
|
371
|
+
*/
|
|
372
|
+
conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY';
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Value to compare against. Required for CALL_PROPERTY conditions.
|
|
376
|
+
*/
|
|
377
|
+
conditionValue: string | null;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
export interface Metric {
|
|
382
|
+
id: string;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export interface Pagination {
|
|
387
|
+
/**
|
|
388
|
+
* Whether there are more items to fetch
|
|
389
|
+
*/
|
|
390
|
+
hasMore: boolean;
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Cursor for the next page of items
|
|
394
|
+
*/
|
|
395
|
+
nextCursor: string | null;
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Total number of items
|
|
399
|
+
*/
|
|
400
|
+
total: number;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
export interface MetricPolicyDeleteResponse {
|
|
405
|
+
data: MetricPolicyDeleteResponse.Data;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
export namespace MetricPolicyDeleteResponse {
|
|
409
|
+
export interface Data {
|
|
410
|
+
/**
|
|
411
|
+
* Whether the policy was deleted
|
|
412
|
+
*/
|
|
413
|
+
deleted: boolean;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export interface MetricPolicyGetByIDResponse {
|
|
418
|
+
/**
|
|
419
|
+
* A metric policy defining when metrics should be collected
|
|
420
|
+
*/
|
|
421
|
+
data: MetricPolicyGetByIDResponse.Data;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
export namespace MetricPolicyGetByIDResponse {
|
|
425
|
+
/**
|
|
426
|
+
* A metric policy defining when metrics should be collected
|
|
427
|
+
*/
|
|
428
|
+
export interface Data {
|
|
429
|
+
/**
|
|
430
|
+
* Unique identifier of the metric policy
|
|
431
|
+
*/
|
|
432
|
+
id: string;
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Condition groups for this policy. Null means the policy matches all calls.
|
|
436
|
+
*/
|
|
437
|
+
conditions: Array<Data.Condition> | null;
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* When the policy was created
|
|
441
|
+
*/
|
|
442
|
+
createdAt: string;
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Metric definitions associated with this policy
|
|
446
|
+
*/
|
|
447
|
+
metrics: Array<Data.Metric>;
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Name of the metric policy
|
|
451
|
+
*/
|
|
452
|
+
name: string;
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Status of the metric policy (ACTIVE or INACTIVE)
|
|
456
|
+
*/
|
|
457
|
+
status: 'ACTIVE' | 'INACTIVE';
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Type of the metric policy (SYSTEM or USER)
|
|
461
|
+
*/
|
|
462
|
+
type: 'SYSTEM' | 'USER';
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* When the policy was last updated
|
|
466
|
+
*/
|
|
467
|
+
updatedAt: string;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
export namespace Data {
|
|
471
|
+
export interface Condition {
|
|
472
|
+
conditions: Array<Condition.Condition>;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
export namespace Condition {
|
|
476
|
+
export interface Condition {
|
|
477
|
+
/**
|
|
478
|
+
* Key to match against. For AGENT: the agent ID. For CALL_SOURCE: the source name.
|
|
479
|
+
* For CALL_PROPERTY: the property key.
|
|
480
|
+
*/
|
|
481
|
+
conditionKey: string;
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Comparison operator. Required for CALL_PROPERTY conditions.
|
|
485
|
+
*/
|
|
486
|
+
conditionOperator:
|
|
487
|
+
| 'EQUALS'
|
|
488
|
+
| 'NOT_EQUALS'
|
|
489
|
+
| 'CONTAINS'
|
|
490
|
+
| 'STARTS_WITH'
|
|
491
|
+
| 'GREATER_THAN'
|
|
492
|
+
| 'LESS_THAN'
|
|
493
|
+
| 'GREATER_THAN_OR_EQUALS'
|
|
494
|
+
| 'LESS_THAN_OR_EQUALS'
|
|
495
|
+
| null;
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Type of condition: AGENT (match by agent ID), CALL_SOURCE (match by source e.g.
|
|
499
|
+
* VAPI, RETELL), CALL_PROPERTY (match by call property key/value)
|
|
500
|
+
*/
|
|
501
|
+
conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY';
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Value to compare against. Required for CALL_PROPERTY conditions.
|
|
505
|
+
*/
|
|
506
|
+
conditionValue: string | null;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
export interface Metric {
|
|
511
|
+
id: string;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
export interface MetricPolicyCreateParams {
|
|
517
|
+
/**
|
|
518
|
+
* Metric definitions to collect when this policy matches
|
|
519
|
+
*/
|
|
520
|
+
metrics: Array<MetricPolicyCreateParams.Metric>;
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* Name of the metric policy
|
|
524
|
+
*/
|
|
525
|
+
name: string;
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Condition groups. Omit to match all calls.
|
|
529
|
+
*/
|
|
530
|
+
conditions?: Array<MetricPolicyCreateParams.Condition>;
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* Status of the policy (default: ACTIVE)
|
|
534
|
+
*/
|
|
535
|
+
status?: 'ACTIVE' | 'INACTIVE';
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
export namespace MetricPolicyCreateParams {
|
|
539
|
+
export interface Metric {
|
|
540
|
+
id: string;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
export interface Condition {
|
|
544
|
+
conditions: Array<Condition.Condition>;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
export namespace Condition {
|
|
548
|
+
export interface Condition {
|
|
549
|
+
/**
|
|
550
|
+
* Key to match against. For AGENT: the agent ID. For CALL_SOURCE: the source name.
|
|
551
|
+
* For CALL_PROPERTY: the property key.
|
|
552
|
+
*/
|
|
553
|
+
conditionKey: string;
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Type of condition: AGENT (match by agent ID), CALL_SOURCE (match by source e.g.
|
|
557
|
+
* VAPI, RETELL), CALL_PROPERTY (match by call property key/value)
|
|
558
|
+
*/
|
|
559
|
+
conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY';
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Comparison operator. Required for CALL_PROPERTY conditions.
|
|
563
|
+
*/
|
|
564
|
+
conditionOperator?:
|
|
565
|
+
| 'EQUALS'
|
|
566
|
+
| 'NOT_EQUALS'
|
|
567
|
+
| 'CONTAINS'
|
|
568
|
+
| 'STARTS_WITH'
|
|
569
|
+
| 'GREATER_THAN'
|
|
570
|
+
| 'LESS_THAN'
|
|
571
|
+
| 'GREATER_THAN_OR_EQUALS'
|
|
572
|
+
| 'LESS_THAN_OR_EQUALS'
|
|
573
|
+
| null;
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Value to compare against. Required for CALL_PROPERTY conditions.
|
|
577
|
+
*/
|
|
578
|
+
conditionValue?: string | null;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
export interface MetricPolicyUpdateParams {
|
|
584
|
+
/**
|
|
585
|
+
* Condition groups. Omit to keep existing, provide empty array to remove all
|
|
586
|
+
* conditions.
|
|
587
|
+
*/
|
|
588
|
+
conditions?: Array<MetricPolicyUpdateParams.Condition>;
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* Metric definitions to collect when this policy matches
|
|
592
|
+
*/
|
|
593
|
+
metrics?: Array<MetricPolicyUpdateParams.Metric>;
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* Name of the metric policy
|
|
597
|
+
*/
|
|
598
|
+
name?: string;
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* Status of the policy
|
|
602
|
+
*/
|
|
603
|
+
status?: 'ACTIVE' | 'INACTIVE';
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
export namespace MetricPolicyUpdateParams {
|
|
607
|
+
export interface Condition {
|
|
608
|
+
conditions: Array<Condition.Condition>;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
export namespace Condition {
|
|
612
|
+
export interface Condition {
|
|
613
|
+
/**
|
|
614
|
+
* Key to match against. For AGENT: the agent ID. For CALL_SOURCE: the source name.
|
|
615
|
+
* For CALL_PROPERTY: the property key.
|
|
616
|
+
*/
|
|
617
|
+
conditionKey: string;
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Type of condition: AGENT (match by agent ID), CALL_SOURCE (match by source e.g.
|
|
621
|
+
* VAPI, RETELL), CALL_PROPERTY (match by call property key/value)
|
|
622
|
+
*/
|
|
623
|
+
conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY';
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* Comparison operator. Required for CALL_PROPERTY conditions.
|
|
627
|
+
*/
|
|
628
|
+
conditionOperator?:
|
|
629
|
+
| 'EQUALS'
|
|
630
|
+
| 'NOT_EQUALS'
|
|
631
|
+
| 'CONTAINS'
|
|
632
|
+
| 'STARTS_WITH'
|
|
633
|
+
| 'GREATER_THAN'
|
|
634
|
+
| 'LESS_THAN'
|
|
635
|
+
| 'GREATER_THAN_OR_EQUALS'
|
|
636
|
+
| 'LESS_THAN_OR_EQUALS'
|
|
637
|
+
| null;
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* Value to compare against. Required for CALL_PROPERTY conditions.
|
|
641
|
+
*/
|
|
642
|
+
conditionValue?: string | null;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
export interface Metric {
|
|
647
|
+
id: string;
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
export interface MetricPolicyListParams {
|
|
652
|
+
/**
|
|
653
|
+
* Cursor for pagination - use the nextCursor value from a previous response
|
|
654
|
+
*/
|
|
655
|
+
after?: string;
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* Maximum number of policies to return (default: 20, max: 50)
|
|
659
|
+
*/
|
|
660
|
+
limit?: number;
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* Filter by policy status
|
|
664
|
+
*/
|
|
665
|
+
status?: 'ACTIVE' | 'INACTIVE';
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
export declare namespace MetricPolicy {
|
|
669
|
+
export {
|
|
670
|
+
type MetricPolicyCreateResponse as MetricPolicyCreateResponse,
|
|
671
|
+
type MetricPolicyUpdateResponse as MetricPolicyUpdateResponse,
|
|
672
|
+
type MetricPolicyListResponse as MetricPolicyListResponse,
|
|
673
|
+
type MetricPolicyDeleteResponse as MetricPolicyDeleteResponse,
|
|
674
|
+
type MetricPolicyGetByIDResponse as MetricPolicyGetByIDResponse,
|
|
675
|
+
type MetricPolicyCreateParams as MetricPolicyCreateParams,
|
|
676
|
+
type MetricPolicyUpdateParams as MetricPolicyUpdateParams,
|
|
677
|
+
type MetricPolicyListParams as MetricPolicyListParams,
|
|
678
|
+
};
|
|
679
|
+
}
|