@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
|
@@ -0,0 +1,502 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
|
+
export declare class MetricPolicy extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new metric policy. Policies define which metrics to collect and under
|
|
7
|
+
* what conditions.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const metricPolicy = await client.metricPolicy.create({
|
|
12
|
+
* metrics: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }],
|
|
13
|
+
* name: 'Evaluate all inbound calls',
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
create(body: MetricPolicyCreateParams, options?: RequestOptions): APIPromise<MetricPolicyCreateResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Updates an existing metric policy. System policies cannot be modified.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const metricPolicy = await client.metricPolicy.update(
|
|
24
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
25
|
+
* );
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
update(policyID: string, body?: MetricPolicyUpdateParams | null | undefined, options?: RequestOptions): APIPromise<MetricPolicyUpdateResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Returns a paginated list of metric policies for the project, including system
|
|
31
|
+
* policies.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const metricPolicies = await client.metricPolicy.list();
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
list(query?: MetricPolicyListParams | null | undefined, options?: RequestOptions): APIPromise<MetricPolicyListResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* Soft-deletes a metric policy. System policies cannot be deleted.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const metricPolicy = await client.metricPolicy.delete(
|
|
45
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
46
|
+
* );
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
delete(policyID: string, options?: RequestOptions): APIPromise<MetricPolicyDeleteResponse>;
|
|
50
|
+
/**
|
|
51
|
+
* Returns a specific metric policy with its conditions and metrics.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* const response = await client.metricPolicy.getByID(
|
|
56
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
57
|
+
* );
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
getByID(policyID: string, options?: RequestOptions): APIPromise<MetricPolicyGetByIDResponse>;
|
|
61
|
+
}
|
|
62
|
+
export interface MetricPolicyCreateResponse {
|
|
63
|
+
/**
|
|
64
|
+
* A metric policy defining when metrics should be collected
|
|
65
|
+
*/
|
|
66
|
+
data: MetricPolicyCreateResponse.Data;
|
|
67
|
+
}
|
|
68
|
+
export declare namespace MetricPolicyCreateResponse {
|
|
69
|
+
/**
|
|
70
|
+
* A metric policy defining when metrics should be collected
|
|
71
|
+
*/
|
|
72
|
+
interface Data {
|
|
73
|
+
/**
|
|
74
|
+
* Unique identifier of the metric policy
|
|
75
|
+
*/
|
|
76
|
+
id: string;
|
|
77
|
+
/**
|
|
78
|
+
* Condition groups for this policy. Null means the policy matches all calls.
|
|
79
|
+
*/
|
|
80
|
+
conditions: Array<Data.Condition> | null;
|
|
81
|
+
/**
|
|
82
|
+
* When the policy was created
|
|
83
|
+
*/
|
|
84
|
+
createdAt: string;
|
|
85
|
+
/**
|
|
86
|
+
* Metric definitions associated with this policy
|
|
87
|
+
*/
|
|
88
|
+
metrics: Array<Data.Metric>;
|
|
89
|
+
/**
|
|
90
|
+
* Name of the metric policy
|
|
91
|
+
*/
|
|
92
|
+
name: string;
|
|
93
|
+
/**
|
|
94
|
+
* Status of the metric policy (ACTIVE or INACTIVE)
|
|
95
|
+
*/
|
|
96
|
+
status: 'ACTIVE' | 'INACTIVE';
|
|
97
|
+
/**
|
|
98
|
+
* Type of the metric policy (SYSTEM or USER)
|
|
99
|
+
*/
|
|
100
|
+
type: 'SYSTEM' | 'USER';
|
|
101
|
+
/**
|
|
102
|
+
* When the policy was last updated
|
|
103
|
+
*/
|
|
104
|
+
updatedAt: string;
|
|
105
|
+
}
|
|
106
|
+
namespace Data {
|
|
107
|
+
interface Condition {
|
|
108
|
+
conditions: Array<Condition.Condition>;
|
|
109
|
+
}
|
|
110
|
+
namespace Condition {
|
|
111
|
+
interface Condition {
|
|
112
|
+
/**
|
|
113
|
+
* Key to match against. For AGENT: the agent ID. For CALL_SOURCE: the source name.
|
|
114
|
+
* For CALL_PROPERTY: the property key.
|
|
115
|
+
*/
|
|
116
|
+
conditionKey: string;
|
|
117
|
+
/**
|
|
118
|
+
* Comparison operator. Required for CALL_PROPERTY conditions.
|
|
119
|
+
*/
|
|
120
|
+
conditionOperator: 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS' | 'STARTS_WITH' | 'GREATER_THAN' | 'LESS_THAN' | 'GREATER_THAN_OR_EQUALS' | 'LESS_THAN_OR_EQUALS' | null;
|
|
121
|
+
/**
|
|
122
|
+
* Type of condition: AGENT (match by agent ID), CALL_SOURCE (match by source e.g.
|
|
123
|
+
* VAPI, RETELL), CALL_PROPERTY (match by call property key/value)
|
|
124
|
+
*/
|
|
125
|
+
conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY';
|
|
126
|
+
/**
|
|
127
|
+
* Value to compare against. Required for CALL_PROPERTY conditions.
|
|
128
|
+
*/
|
|
129
|
+
conditionValue: string | null;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
interface Metric {
|
|
133
|
+
id: string;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
export interface MetricPolicyUpdateResponse {
|
|
138
|
+
/**
|
|
139
|
+
* A metric policy defining when metrics should be collected
|
|
140
|
+
*/
|
|
141
|
+
data: MetricPolicyUpdateResponse.Data;
|
|
142
|
+
}
|
|
143
|
+
export declare namespace MetricPolicyUpdateResponse {
|
|
144
|
+
/**
|
|
145
|
+
* A metric policy defining when metrics should be collected
|
|
146
|
+
*/
|
|
147
|
+
interface Data {
|
|
148
|
+
/**
|
|
149
|
+
* Unique identifier of the metric policy
|
|
150
|
+
*/
|
|
151
|
+
id: string;
|
|
152
|
+
/**
|
|
153
|
+
* Condition groups for this policy. Null means the policy matches all calls.
|
|
154
|
+
*/
|
|
155
|
+
conditions: Array<Data.Condition> | null;
|
|
156
|
+
/**
|
|
157
|
+
* When the policy was created
|
|
158
|
+
*/
|
|
159
|
+
createdAt: string;
|
|
160
|
+
/**
|
|
161
|
+
* Metric definitions associated with this policy
|
|
162
|
+
*/
|
|
163
|
+
metrics: Array<Data.Metric>;
|
|
164
|
+
/**
|
|
165
|
+
* Name of the metric policy
|
|
166
|
+
*/
|
|
167
|
+
name: string;
|
|
168
|
+
/**
|
|
169
|
+
* Status of the metric policy (ACTIVE or INACTIVE)
|
|
170
|
+
*/
|
|
171
|
+
status: 'ACTIVE' | 'INACTIVE';
|
|
172
|
+
/**
|
|
173
|
+
* Type of the metric policy (SYSTEM or USER)
|
|
174
|
+
*/
|
|
175
|
+
type: 'SYSTEM' | 'USER';
|
|
176
|
+
/**
|
|
177
|
+
* When the policy was last updated
|
|
178
|
+
*/
|
|
179
|
+
updatedAt: string;
|
|
180
|
+
}
|
|
181
|
+
namespace Data {
|
|
182
|
+
interface Condition {
|
|
183
|
+
conditions: Array<Condition.Condition>;
|
|
184
|
+
}
|
|
185
|
+
namespace Condition {
|
|
186
|
+
interface Condition {
|
|
187
|
+
/**
|
|
188
|
+
* Key to match against. For AGENT: the agent ID. For CALL_SOURCE: the source name.
|
|
189
|
+
* For CALL_PROPERTY: the property key.
|
|
190
|
+
*/
|
|
191
|
+
conditionKey: string;
|
|
192
|
+
/**
|
|
193
|
+
* Comparison operator. Required for CALL_PROPERTY conditions.
|
|
194
|
+
*/
|
|
195
|
+
conditionOperator: 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS' | 'STARTS_WITH' | 'GREATER_THAN' | 'LESS_THAN' | 'GREATER_THAN_OR_EQUALS' | 'LESS_THAN_OR_EQUALS' | null;
|
|
196
|
+
/**
|
|
197
|
+
* Type of condition: AGENT (match by agent ID), CALL_SOURCE (match by source e.g.
|
|
198
|
+
* VAPI, RETELL), CALL_PROPERTY (match by call property key/value)
|
|
199
|
+
*/
|
|
200
|
+
conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY';
|
|
201
|
+
/**
|
|
202
|
+
* Value to compare against. Required for CALL_PROPERTY conditions.
|
|
203
|
+
*/
|
|
204
|
+
conditionValue: string | null;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
interface Metric {
|
|
208
|
+
id: string;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Paginated list of metric policies
|
|
214
|
+
*/
|
|
215
|
+
export interface MetricPolicyListResponse {
|
|
216
|
+
data: Array<MetricPolicyListResponse.Data>;
|
|
217
|
+
pagination: MetricPolicyListResponse.Pagination;
|
|
218
|
+
}
|
|
219
|
+
export declare namespace MetricPolicyListResponse {
|
|
220
|
+
/**
|
|
221
|
+
* A metric policy defining when metrics should be collected
|
|
222
|
+
*/
|
|
223
|
+
interface Data {
|
|
224
|
+
/**
|
|
225
|
+
* Unique identifier of the metric policy
|
|
226
|
+
*/
|
|
227
|
+
id: string;
|
|
228
|
+
/**
|
|
229
|
+
* Condition groups for this policy. Null means the policy matches all calls.
|
|
230
|
+
*/
|
|
231
|
+
conditions: Array<Data.Condition> | null;
|
|
232
|
+
/**
|
|
233
|
+
* When the policy was created
|
|
234
|
+
*/
|
|
235
|
+
createdAt: string;
|
|
236
|
+
/**
|
|
237
|
+
* Metric definitions associated with this policy
|
|
238
|
+
*/
|
|
239
|
+
metrics: Array<Data.Metric>;
|
|
240
|
+
/**
|
|
241
|
+
* Name of the metric policy
|
|
242
|
+
*/
|
|
243
|
+
name: string;
|
|
244
|
+
/**
|
|
245
|
+
* Status of the metric policy (ACTIVE or INACTIVE)
|
|
246
|
+
*/
|
|
247
|
+
status: 'ACTIVE' | 'INACTIVE';
|
|
248
|
+
/**
|
|
249
|
+
* Type of the metric policy (SYSTEM or USER)
|
|
250
|
+
*/
|
|
251
|
+
type: 'SYSTEM' | 'USER';
|
|
252
|
+
/**
|
|
253
|
+
* When the policy was last updated
|
|
254
|
+
*/
|
|
255
|
+
updatedAt: string;
|
|
256
|
+
}
|
|
257
|
+
namespace Data {
|
|
258
|
+
interface Condition {
|
|
259
|
+
conditions: Array<Condition.Condition>;
|
|
260
|
+
}
|
|
261
|
+
namespace Condition {
|
|
262
|
+
interface Condition {
|
|
263
|
+
/**
|
|
264
|
+
* Key to match against. For AGENT: the agent ID. For CALL_SOURCE: the source name.
|
|
265
|
+
* For CALL_PROPERTY: the property key.
|
|
266
|
+
*/
|
|
267
|
+
conditionKey: string;
|
|
268
|
+
/**
|
|
269
|
+
* Comparison operator. Required for CALL_PROPERTY conditions.
|
|
270
|
+
*/
|
|
271
|
+
conditionOperator: 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS' | 'STARTS_WITH' | 'GREATER_THAN' | 'LESS_THAN' | 'GREATER_THAN_OR_EQUALS' | 'LESS_THAN_OR_EQUALS' | null;
|
|
272
|
+
/**
|
|
273
|
+
* Type of condition: AGENT (match by agent ID), CALL_SOURCE (match by source e.g.
|
|
274
|
+
* VAPI, RETELL), CALL_PROPERTY (match by call property key/value)
|
|
275
|
+
*/
|
|
276
|
+
conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY';
|
|
277
|
+
/**
|
|
278
|
+
* Value to compare against. Required for CALL_PROPERTY conditions.
|
|
279
|
+
*/
|
|
280
|
+
conditionValue: string | null;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
interface Metric {
|
|
284
|
+
id: string;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
interface Pagination {
|
|
288
|
+
/**
|
|
289
|
+
* Whether there are more items to fetch
|
|
290
|
+
*/
|
|
291
|
+
hasMore: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* Cursor for the next page of items
|
|
294
|
+
*/
|
|
295
|
+
nextCursor: string | null;
|
|
296
|
+
/**
|
|
297
|
+
* Total number of items
|
|
298
|
+
*/
|
|
299
|
+
total: number;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
export interface MetricPolicyDeleteResponse {
|
|
303
|
+
data: MetricPolicyDeleteResponse.Data;
|
|
304
|
+
}
|
|
305
|
+
export declare namespace MetricPolicyDeleteResponse {
|
|
306
|
+
interface Data {
|
|
307
|
+
/**
|
|
308
|
+
* Whether the policy was deleted
|
|
309
|
+
*/
|
|
310
|
+
deleted: boolean;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
export interface MetricPolicyGetByIDResponse {
|
|
314
|
+
/**
|
|
315
|
+
* A metric policy defining when metrics should be collected
|
|
316
|
+
*/
|
|
317
|
+
data: MetricPolicyGetByIDResponse.Data;
|
|
318
|
+
}
|
|
319
|
+
export declare namespace MetricPolicyGetByIDResponse {
|
|
320
|
+
/**
|
|
321
|
+
* A metric policy defining when metrics should be collected
|
|
322
|
+
*/
|
|
323
|
+
interface Data {
|
|
324
|
+
/**
|
|
325
|
+
* Unique identifier of the metric policy
|
|
326
|
+
*/
|
|
327
|
+
id: string;
|
|
328
|
+
/**
|
|
329
|
+
* Condition groups for this policy. Null means the policy matches all calls.
|
|
330
|
+
*/
|
|
331
|
+
conditions: Array<Data.Condition> | null;
|
|
332
|
+
/**
|
|
333
|
+
* When the policy was created
|
|
334
|
+
*/
|
|
335
|
+
createdAt: string;
|
|
336
|
+
/**
|
|
337
|
+
* Metric definitions associated with this policy
|
|
338
|
+
*/
|
|
339
|
+
metrics: Array<Data.Metric>;
|
|
340
|
+
/**
|
|
341
|
+
* Name of the metric policy
|
|
342
|
+
*/
|
|
343
|
+
name: string;
|
|
344
|
+
/**
|
|
345
|
+
* Status of the metric policy (ACTIVE or INACTIVE)
|
|
346
|
+
*/
|
|
347
|
+
status: 'ACTIVE' | 'INACTIVE';
|
|
348
|
+
/**
|
|
349
|
+
* Type of the metric policy (SYSTEM or USER)
|
|
350
|
+
*/
|
|
351
|
+
type: 'SYSTEM' | 'USER';
|
|
352
|
+
/**
|
|
353
|
+
* When the policy was last updated
|
|
354
|
+
*/
|
|
355
|
+
updatedAt: string;
|
|
356
|
+
}
|
|
357
|
+
namespace Data {
|
|
358
|
+
interface Condition {
|
|
359
|
+
conditions: Array<Condition.Condition>;
|
|
360
|
+
}
|
|
361
|
+
namespace Condition {
|
|
362
|
+
interface Condition {
|
|
363
|
+
/**
|
|
364
|
+
* Key to match against. For AGENT: the agent ID. For CALL_SOURCE: the source name.
|
|
365
|
+
* For CALL_PROPERTY: the property key.
|
|
366
|
+
*/
|
|
367
|
+
conditionKey: string;
|
|
368
|
+
/**
|
|
369
|
+
* Comparison operator. Required for CALL_PROPERTY conditions.
|
|
370
|
+
*/
|
|
371
|
+
conditionOperator: 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS' | 'STARTS_WITH' | 'GREATER_THAN' | 'LESS_THAN' | 'GREATER_THAN_OR_EQUALS' | 'LESS_THAN_OR_EQUALS' | null;
|
|
372
|
+
/**
|
|
373
|
+
* Type of condition: AGENT (match by agent ID), CALL_SOURCE (match by source e.g.
|
|
374
|
+
* VAPI, RETELL), CALL_PROPERTY (match by call property key/value)
|
|
375
|
+
*/
|
|
376
|
+
conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY';
|
|
377
|
+
/**
|
|
378
|
+
* Value to compare against. Required for CALL_PROPERTY conditions.
|
|
379
|
+
*/
|
|
380
|
+
conditionValue: string | null;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
interface Metric {
|
|
384
|
+
id: string;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
export interface MetricPolicyCreateParams {
|
|
389
|
+
/**
|
|
390
|
+
* Metric definitions to collect when this policy matches
|
|
391
|
+
*/
|
|
392
|
+
metrics: Array<MetricPolicyCreateParams.Metric>;
|
|
393
|
+
/**
|
|
394
|
+
* Name of the metric policy
|
|
395
|
+
*/
|
|
396
|
+
name: string;
|
|
397
|
+
/**
|
|
398
|
+
* Condition groups. Omit to match all calls.
|
|
399
|
+
*/
|
|
400
|
+
conditions?: Array<MetricPolicyCreateParams.Condition>;
|
|
401
|
+
/**
|
|
402
|
+
* Status of the policy (default: ACTIVE)
|
|
403
|
+
*/
|
|
404
|
+
status?: 'ACTIVE' | 'INACTIVE';
|
|
405
|
+
}
|
|
406
|
+
export declare namespace MetricPolicyCreateParams {
|
|
407
|
+
interface Metric {
|
|
408
|
+
id: string;
|
|
409
|
+
}
|
|
410
|
+
interface Condition {
|
|
411
|
+
conditions: Array<Condition.Condition>;
|
|
412
|
+
}
|
|
413
|
+
namespace Condition {
|
|
414
|
+
interface Condition {
|
|
415
|
+
/**
|
|
416
|
+
* Key to match against. For AGENT: the agent ID. For CALL_SOURCE: the source name.
|
|
417
|
+
* For CALL_PROPERTY: the property key.
|
|
418
|
+
*/
|
|
419
|
+
conditionKey: string;
|
|
420
|
+
/**
|
|
421
|
+
* Type of condition: AGENT (match by agent ID), CALL_SOURCE (match by source e.g.
|
|
422
|
+
* VAPI, RETELL), CALL_PROPERTY (match by call property key/value)
|
|
423
|
+
*/
|
|
424
|
+
conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY';
|
|
425
|
+
/**
|
|
426
|
+
* Comparison operator. Required for CALL_PROPERTY conditions.
|
|
427
|
+
*/
|
|
428
|
+
conditionOperator?: 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS' | 'STARTS_WITH' | 'GREATER_THAN' | 'LESS_THAN' | 'GREATER_THAN_OR_EQUALS' | 'LESS_THAN_OR_EQUALS' | null;
|
|
429
|
+
/**
|
|
430
|
+
* Value to compare against. Required for CALL_PROPERTY conditions.
|
|
431
|
+
*/
|
|
432
|
+
conditionValue?: string | null;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
export interface MetricPolicyUpdateParams {
|
|
437
|
+
/**
|
|
438
|
+
* Condition groups. Omit to keep existing, provide empty array to remove all
|
|
439
|
+
* conditions.
|
|
440
|
+
*/
|
|
441
|
+
conditions?: Array<MetricPolicyUpdateParams.Condition>;
|
|
442
|
+
/**
|
|
443
|
+
* Metric definitions to collect when this policy matches
|
|
444
|
+
*/
|
|
445
|
+
metrics?: Array<MetricPolicyUpdateParams.Metric>;
|
|
446
|
+
/**
|
|
447
|
+
* Name of the metric policy
|
|
448
|
+
*/
|
|
449
|
+
name?: string;
|
|
450
|
+
/**
|
|
451
|
+
* Status of the policy
|
|
452
|
+
*/
|
|
453
|
+
status?: 'ACTIVE' | 'INACTIVE';
|
|
454
|
+
}
|
|
455
|
+
export declare namespace MetricPolicyUpdateParams {
|
|
456
|
+
interface Condition {
|
|
457
|
+
conditions: Array<Condition.Condition>;
|
|
458
|
+
}
|
|
459
|
+
namespace Condition {
|
|
460
|
+
interface Condition {
|
|
461
|
+
/**
|
|
462
|
+
* Key to match against. For AGENT: the agent ID. For CALL_SOURCE: the source name.
|
|
463
|
+
* For CALL_PROPERTY: the property key.
|
|
464
|
+
*/
|
|
465
|
+
conditionKey: string;
|
|
466
|
+
/**
|
|
467
|
+
* Type of condition: AGENT (match by agent ID), CALL_SOURCE (match by source e.g.
|
|
468
|
+
* VAPI, RETELL), CALL_PROPERTY (match by call property key/value)
|
|
469
|
+
*/
|
|
470
|
+
conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY';
|
|
471
|
+
/**
|
|
472
|
+
* Comparison operator. Required for CALL_PROPERTY conditions.
|
|
473
|
+
*/
|
|
474
|
+
conditionOperator?: 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS' | 'STARTS_WITH' | 'GREATER_THAN' | 'LESS_THAN' | 'GREATER_THAN_OR_EQUALS' | 'LESS_THAN_OR_EQUALS' | null;
|
|
475
|
+
/**
|
|
476
|
+
* Value to compare against. Required for CALL_PROPERTY conditions.
|
|
477
|
+
*/
|
|
478
|
+
conditionValue?: string | null;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
interface Metric {
|
|
482
|
+
id: string;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
export interface MetricPolicyListParams {
|
|
486
|
+
/**
|
|
487
|
+
* Cursor for pagination - use the nextCursor value from a previous response
|
|
488
|
+
*/
|
|
489
|
+
after?: string;
|
|
490
|
+
/**
|
|
491
|
+
* Maximum number of policies to return (default: 20, max: 50)
|
|
492
|
+
*/
|
|
493
|
+
limit?: number;
|
|
494
|
+
/**
|
|
495
|
+
* Filter by policy status
|
|
496
|
+
*/
|
|
497
|
+
status?: 'ACTIVE' | 'INACTIVE';
|
|
498
|
+
}
|
|
499
|
+
export declare namespace MetricPolicy {
|
|
500
|
+
export { type MetricPolicyCreateResponse as MetricPolicyCreateResponse, type MetricPolicyUpdateResponse as MetricPolicyUpdateResponse, type MetricPolicyListResponse as MetricPolicyListResponse, type MetricPolicyDeleteResponse as MetricPolicyDeleteResponse, type MetricPolicyGetByIDResponse as MetricPolicyGetByIDResponse, type MetricPolicyCreateParams as MetricPolicyCreateParams, type MetricPolicyUpdateParams as MetricPolicyUpdateParams, type MetricPolicyListParams as MetricPolicyListParams, };
|
|
501
|
+
}
|
|
502
|
+
//# sourceMappingURL=metric-policy.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metric-policy.d.mts","sourceRoot":"","sources":["../src/resources/metric-policy.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAI,EAAE,wBAAwB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;IAIxG;;;;;;;;;OASG;IACH,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,wBAAwB,GAAG,IAAI,GAAG,SAAc,EACtD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,0BAA0B,CAAC;IAIzC;;;;;;;;OAQG;IACH,IAAI,CACF,KAAK,GAAE,sBAAsB,GAAG,IAAI,GAAG,SAAc,EACrD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,wBAAwB,CAAC;IAIvC;;;;;;;;;OASG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;IAI1F;;;;;;;;;OASG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,2BAA2B,CAAC;CAG7F;AAED,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,IAAI,EAAE,0BAA0B,CAAC,IAAI,CAAC;CACvC;AAED,yBAAiB,0BAA0B,CAAC;IA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