@roarkanalytics/sdk 5.8.0 → 5.10.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 +26 -0
- package/client.d.mts +13 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +13 -4
- package/client.d.ts.map +1 -1
- package/client.js +9 -0
- package/client.js.map +1 -1
- package/client.mjs +9 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/analytics.d.mts +354 -0
- package/resources/analytics.d.mts.map +1 -0
- package/resources/analytics.d.ts +354 -0
- package/resources/analytics.d.ts.map +1 -0
- package/resources/analytics.js +55 -0
- package/resources/analytics.js.map +1 -0
- package/resources/analytics.mjs +51 -0
- package/resources/analytics.mjs.map +1 -0
- package/resources/call.d.mts +90 -1
- package/resources/call.d.mts.map +1 -1
- package/resources/call.d.ts +90 -1
- package/resources/call.d.ts.map +1 -1
- package/resources/call.js +17 -0
- package/resources/call.js.map +1 -1
- package/resources/call.mjs +17 -0
- package/resources/call.mjs.map +1 -1
- package/resources/config.d.mts +578 -8
- package/resources/config.d.mts.map +1 -1
- package/resources/config.d.ts +578 -8
- package/resources/config.d.ts.map +1 -1
- package/resources/dashboard.d.mts +2280 -0
- package/resources/dashboard.d.mts.map +1 -0
- package/resources/dashboard.d.ts +2280 -0
- package/resources/dashboard.d.ts.map +1 -0
- package/resources/dashboard.js +170 -0
- package/resources/dashboard.js.map +1 -0
- package/resources/dashboard.mjs +166 -0
- package/resources/dashboard.mjs.map +1 -0
- package/resources/index.d.mts +5 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +5 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.map +1 -1
- package/resources/simulation-run-plan-job.d.mts +98 -1
- package/resources/simulation-run-plan-job.d.mts.map +1 -1
- package/resources/simulation-run-plan-job.d.ts +98 -1
- package/resources/simulation-run-plan-job.d.ts.map +1 -1
- package/resources/simulation-run-plan-job.js +17 -0
- package/resources/simulation-run-plan-job.js.map +1 -1
- package/resources/simulation-run-plan-job.mjs +17 -0
- package/resources/simulation-run-plan-job.mjs.map +1 -1
- package/resources/usage.d.mts +116 -0
- package/resources/usage.d.mts.map +1 -0
- package/resources/usage.d.ts +116 -0
- package/resources/usage.d.ts.map +1 -0
- package/resources/usage.js +29 -0
- package/resources/usage.js.map +1 -0
- package/resources/usage.mjs +25 -0
- package/resources/usage.mjs.map +1 -0
- package/src/client.ts +67 -0
- package/src/resources/analytics.ts +573 -0
- package/src/resources/call.ts +136 -0
- package/src/resources/config.ts +1441 -41
- package/src/resources/dashboard.ts +3752 -0
- package/src/resources/index.ts +29 -0
- package/src/resources/simulation-run-plan-job.ts +141 -0
- package/src/resources/usage.ts +149 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
|
@@ -0,0 +1,3752 @@
|
|
|
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 Dashboard extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Creates a dashboard with its widgets. Each widget is an analytics query (see
|
|
11
|
+
* POST /v1/analytics/query) with a name unique on the dashboard, a `display`
|
|
12
|
+
* (LINE, NUMBER, RADAR, STACKED_BAR, TABLE) and a `size` (SMALL, MEDIUM, LARGE,
|
|
13
|
+
* EXTRA_LARGE). Widgets render top to bottom in the order given.
|
|
14
|
+
*
|
|
15
|
+
* Dashboard `filters` apply over every widget and must be conversation-level:
|
|
16
|
+
* AGENT_PROPERTY, CALL_PROPERTY, MODALITY, DATASET or METRIC_VALUE. On a field a
|
|
17
|
+
* widget already filters, the dashboard's wins.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const dashboard = await client.dashboard.create({
|
|
22
|
+
* name: 'x',
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
create(body: DashboardCreateParams, options?: RequestOptions): APIPromise<DashboardCreateResponse> {
|
|
27
|
+
return this._client.post('/v1/dashboard', { body, ...options });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Edits a dashboard. Omitted fields keep their current value. `widgets`, when
|
|
32
|
+
* sent, replaces the list: widgets are matched by name, so a widget that keeps its
|
|
33
|
+
* name keeps its id; a new name adds a widget and a name no longer listed removes
|
|
34
|
+
* it. To change one widget, PUT /v1/dashboard/{dashboardId}/widget/{widgetId}.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const dashboard = await client.dashboard.update(
|
|
39
|
+
* '6f1d2c3b-4a5e-4f60-8b71-9c0d1e2f3a4b',
|
|
40
|
+
* );
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
update(
|
|
44
|
+
dashboardID: string,
|
|
45
|
+
body: DashboardUpdateParams | null | undefined = {},
|
|
46
|
+
options?: RequestOptions,
|
|
47
|
+
): APIPromise<DashboardUpdateResponse> {
|
|
48
|
+
return this._client.put(path`/v1/dashboard/${dashboardID}`, { body, ...options });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Lists the project's dashboards, the default first. GET
|
|
53
|
+
* /v1/dashboard/{dashboardId} returns the widgets.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const dashboards = await client.dashboard.list();
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
list(options?: RequestOptions): APIPromise<DashboardListResponse> {
|
|
61
|
+
return this._client.get('/v1/dashboard', options);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Deletes a dashboard and its widgets. If it was the default, another dashboard
|
|
66
|
+
* becomes the default. A dashboard managed by config as code returns 409.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* const dashboard = await client.dashboard.delete(
|
|
71
|
+
* '6f1d2c3b-4a5e-4f60-8b71-9c0d1e2f3a4b',
|
|
72
|
+
* );
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
delete(dashboardID: string, options?: RequestOptions): APIPromise<DashboardDeleteResponse> {
|
|
76
|
+
return this._client.delete(path`/v1/dashboard/${dashboardID}`, options);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Adds a widget to the top of a dashboard. Its name must be unique on the
|
|
81
|
+
* dashboard.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* const response = await client.dashboard.createWidget(
|
|
86
|
+
* '6f1d2c3b-4a5e-4f60-8b71-9c0d1e2f3a4b',
|
|
87
|
+
* { measures: [{}], name: 'x' },
|
|
88
|
+
* );
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
createWidget(
|
|
92
|
+
dashboardID: string,
|
|
93
|
+
body: DashboardCreateWidgetParams,
|
|
94
|
+
options?: RequestOptions,
|
|
95
|
+
): APIPromise<DashboardCreateWidgetResponse> {
|
|
96
|
+
return this._client.post(path`/v1/dashboard/${dashboardID}/widget`, { body, ...options });
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Removes a widget from a dashboard.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* const response = await client.dashboard.deleteWidget(
|
|
105
|
+
* '7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d',
|
|
106
|
+
* { dashboardId: '6f1d2c3b-4a5e-4f60-8b71-9c0d1e2f3a4b' },
|
|
107
|
+
* );
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
deleteWidget(
|
|
111
|
+
widgetID: string,
|
|
112
|
+
params: DashboardDeleteWidgetParams,
|
|
113
|
+
options?: RequestOptions,
|
|
114
|
+
): APIPromise<DashboardDeleteWidgetResponse> {
|
|
115
|
+
const { dashboardId } = params;
|
|
116
|
+
return this._client.delete(path`/v1/dashboard/${dashboardId}/widget/${widgetID}`, options);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Returns a dashboard with its widgets top to bottom, each in the shape POST
|
|
121
|
+
* /v1/dashboard accepts, so a dashboard can be read, edited and written back.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```ts
|
|
125
|
+
* const response = await client.dashboard.getByID(
|
|
126
|
+
* '6f1d2c3b-4a5e-4f60-8b71-9c0d1e2f3a4b',
|
|
127
|
+
* );
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
getByID(dashboardID: string, options?: RequestOptions): APIPromise<DashboardGetByIDResponse> {
|
|
131
|
+
return this._client.get(path`/v1/dashboard/${dashboardID}`, options);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Runs every widget on the dashboard and returns each one's series, exactly as the
|
|
136
|
+
* dashboard shows them: over the dashboard's saved window and with its filters
|
|
137
|
+
* applied. Pass `from` (and optionally `to`) to read a different window, and
|
|
138
|
+
* `timezone` to align buckets to a zone.
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```ts
|
|
142
|
+
* const response =
|
|
143
|
+
* await client.dashboard.getData('dashboardId');
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
getData(
|
|
147
|
+
dashboardID: string,
|
|
148
|
+
query: DashboardGetDataParams | null | undefined = {},
|
|
149
|
+
options?: RequestOptions,
|
|
150
|
+
): APIPromise<DashboardGetDataResponse> {
|
|
151
|
+
return this._client.get(path`/v1/dashboard/${dashboardID}/data`, { query, ...options });
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Runs one widget and returns its series, as it reads on its dashboard (the
|
|
156
|
+
* dashboard's window and filters). Accepts the same `from` / `to` / `timezone`
|
|
157
|
+
* overrides as GET /v1/dashboard/{dashboardId}/data.
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```ts
|
|
161
|
+
* const response = await client.dashboard.getWidgetData(
|
|
162
|
+
* 'widgetId',
|
|
163
|
+
* { dashboardId: 'dashboardId' },
|
|
164
|
+
* );
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
getWidgetData(
|
|
168
|
+
widgetID: string,
|
|
169
|
+
params: DashboardGetWidgetDataParams,
|
|
170
|
+
options?: RequestOptions,
|
|
171
|
+
): APIPromise<DashboardGetWidgetDataResponse> {
|
|
172
|
+
const { dashboardId, ...query } = params;
|
|
173
|
+
return this._client.get(path`/v1/dashboard/${dashboardId}/widget/${widgetID}/data`, {
|
|
174
|
+
query,
|
|
175
|
+
...options,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Replaces a widget's definition. It keeps its id and its place on the dashboard.
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* ```ts
|
|
184
|
+
* const response = await client.dashboard.updateWidget(
|
|
185
|
+
* '7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d',
|
|
186
|
+
* {
|
|
187
|
+
* dashboardId: '6f1d2c3b-4a5e-4f60-8b71-9c0d1e2f3a4b',
|
|
188
|
+
* measures: [{}],
|
|
189
|
+
* name: 'x',
|
|
190
|
+
* },
|
|
191
|
+
* );
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
194
|
+
updateWidget(
|
|
195
|
+
widgetID: string,
|
|
196
|
+
params: DashboardUpdateWidgetParams,
|
|
197
|
+
options?: RequestOptions,
|
|
198
|
+
): APIPromise<DashboardUpdateWidgetResponse> {
|
|
199
|
+
const { dashboardId, ...body } = params;
|
|
200
|
+
return this._client.put(path`/v1/dashboard/${dashboardId}/widget/${widgetID}`, { body, ...options });
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export interface DashboardCreateResponse {
|
|
205
|
+
data: DashboardCreateResponse.Data;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export namespace DashboardCreateResponse {
|
|
209
|
+
export interface Data {
|
|
210
|
+
id: string;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Managed by config as code (`kind: dashboard`). A managed dashboard is read-only
|
|
214
|
+
* here: edits return 409; change it in the config file.
|
|
215
|
+
*/
|
|
216
|
+
configManaged: boolean;
|
|
217
|
+
|
|
218
|
+
createdAt: string;
|
|
219
|
+
|
|
220
|
+
description: string | null;
|
|
221
|
+
|
|
222
|
+
filters: Array<Data.Filter>;
|
|
223
|
+
|
|
224
|
+
isDefault: boolean;
|
|
225
|
+
|
|
226
|
+
name: string;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* The window: LAST n DAYS/WEEKS/MONTHS up to now, a CALENDAR_ALIGNED period
|
|
230
|
+
* (TODAY, YESTERDAY, THIS_WEEK, LAST_WEEK, THIS_MONTH, LAST_MONTH, THIS_YEAR,
|
|
231
|
+
* LAST_YEAR), FIXED from/to, or SINCE a date. At most 731 days (two years).
|
|
232
|
+
*/
|
|
233
|
+
timeRange: Data.UnionMember0 | Data.UnionMember1 | Data.UnionMember2 | Data.UnionMember3 | null;
|
|
234
|
+
|
|
235
|
+
updatedAt: string;
|
|
236
|
+
|
|
237
|
+
widgets: Array<Data.Widget>;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export namespace Data {
|
|
241
|
+
export interface Filter {
|
|
242
|
+
/**
|
|
243
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
244
|
+
*/
|
|
245
|
+
type:
|
|
246
|
+
| 'METRIC_PROPERTY'
|
|
247
|
+
| 'CALL_PROPERTY'
|
|
248
|
+
| 'AGENT_PROPERTY'
|
|
249
|
+
| 'CALL_ID'
|
|
250
|
+
| 'MODALITY'
|
|
251
|
+
| 'DATASET'
|
|
252
|
+
| 'METRIC_VALUE';
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
256
|
+
*/
|
|
257
|
+
value: string | number | boolean;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Defaults to EQUALS.
|
|
261
|
+
*/
|
|
262
|
+
operator?:
|
|
263
|
+
| 'EQUALS'
|
|
264
|
+
| 'NOT_EQUALS'
|
|
265
|
+
| 'GREATER_THAN'
|
|
266
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
267
|
+
| 'LESS_THAN'
|
|
268
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
269
|
+
| 'CONTAINS'
|
|
270
|
+
| 'STARTS_WITH';
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
274
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
275
|
+
*/
|
|
276
|
+
property?: string;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export interface UnionMember0 {
|
|
280
|
+
type: 'LAST';
|
|
281
|
+
|
|
282
|
+
unit: 'DAYS' | 'WEEKS' | 'MONTHS';
|
|
283
|
+
|
|
284
|
+
value: number;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export interface UnionMember1 {
|
|
288
|
+
period:
|
|
289
|
+
| 'TODAY'
|
|
290
|
+
| 'YESTERDAY'
|
|
291
|
+
| 'THIS_WEEK'
|
|
292
|
+
| 'LAST_WEEK'
|
|
293
|
+
| 'THIS_MONTH'
|
|
294
|
+
| 'LAST_MONTH'
|
|
295
|
+
| 'THIS_YEAR'
|
|
296
|
+
| 'LAST_YEAR';
|
|
297
|
+
|
|
298
|
+
type: 'CALENDAR_ALIGNED';
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export interface UnionMember2 {
|
|
302
|
+
from: string;
|
|
303
|
+
|
|
304
|
+
to: string;
|
|
305
|
+
|
|
306
|
+
type: 'FIXED';
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export interface UnionMember3 {
|
|
310
|
+
from: string;
|
|
311
|
+
|
|
312
|
+
type: 'SINCE';
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export interface Widget {
|
|
316
|
+
id: string;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* What to aggregate: 1 to 10 measures.
|
|
320
|
+
*/
|
|
321
|
+
measures: Array<Widget.Measure>;
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Unique on the dashboard: how the widget is matched on update.
|
|
325
|
+
*/
|
|
326
|
+
name: string;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Run every measure once per named filter set, e.g. one group per agent.
|
|
330
|
+
*/
|
|
331
|
+
comparisonGroups?: Array<Widget.ComparisonGroup>;
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* PREVIOUS_PERIOD adds the preceding window of the same length to every series.
|
|
335
|
+
*/
|
|
336
|
+
comparisonMode?: 'NONE' | 'PREVIOUS_PERIOD';
|
|
337
|
+
|
|
338
|
+
description?: string;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Chart type. Defaults to LINE.
|
|
342
|
+
*/
|
|
343
|
+
display?: 'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE';
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Applied to every measure, on top of each measure's own filters.
|
|
347
|
+
*/
|
|
348
|
+
filters?: Array<Widget.Filter>;
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Bucket size. Defaults from the window's length and steps coarser when the window
|
|
352
|
+
* would exceed 500 buckets.
|
|
353
|
+
*/
|
|
354
|
+
interval?: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Grid width. Defaults to MEDIUM.
|
|
358
|
+
*/
|
|
359
|
+
size?: 'SMALL' | 'MEDIUM' | 'LARGE' | 'EXTRA_LARGE';
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export namespace Widget {
|
|
363
|
+
export interface Measure {
|
|
364
|
+
/**
|
|
365
|
+
* Defaults by output type: AVG for numeric metrics, COUNT (split by value) for
|
|
366
|
+
* classification and text, PASS_RATE for thresholds and uptime, COUNT for
|
|
367
|
+
* conversations.
|
|
368
|
+
*/
|
|
369
|
+
aggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Split the measure into one series per value of this dimension (the largest 50
|
|
373
|
+
* are returned). Ignored while comparisonGroups are set: each group is then one
|
|
374
|
+
* series.
|
|
375
|
+
*/
|
|
376
|
+
breakdown?: Measure.Breakdown;
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Chart color on a dashboard.
|
|
380
|
+
*/
|
|
381
|
+
color?:
|
|
382
|
+
| 'GREEN'
|
|
383
|
+
| 'RED'
|
|
384
|
+
| 'ORANGE'
|
|
385
|
+
| 'PURPLE'
|
|
386
|
+
| 'GREY'
|
|
387
|
+
| 'BLUE'
|
|
388
|
+
| 'PEACH'
|
|
389
|
+
| 'TEAL'
|
|
390
|
+
| 'INDIGO'
|
|
391
|
+
| 'AMBER'
|
|
392
|
+
| 'ROSE'
|
|
393
|
+
| 'CYAN';
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* CALL (default for metrics) folds each conversation to one value first, so a long
|
|
397
|
+
* call does not outweigh a short one. NONE aggregates every value.
|
|
398
|
+
*/
|
|
399
|
+
distinctBy?: 'NONE' | 'CALL';
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Filters for this measure only, on top of the query's filters.
|
|
403
|
+
*/
|
|
404
|
+
filters?: Array<Measure.Filter>;
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Mark one measure as the baseline: every series also reports its value as a
|
|
408
|
+
* percentage of it.
|
|
409
|
+
*/
|
|
410
|
+
isBaseline?: boolean;
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* The metric's slug (e.g. `task_completion`) or id. Required for METRIC.
|
|
414
|
+
*/
|
|
415
|
+
metric?: string;
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* How each conversation is folded when distinctBy is CALL. Defaults to SUM under
|
|
419
|
+
* SUM, else AVG.
|
|
420
|
+
*/
|
|
421
|
+
nestedAggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
|
|
422
|
+
|
|
423
|
+
nestedAggregationPercentile?: number;
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* PASS_RATE condition operator. Omit for a threshold metric: its own condition is
|
|
427
|
+
* used.
|
|
428
|
+
*/
|
|
429
|
+
passOperator?:
|
|
430
|
+
| 'EQUALS'
|
|
431
|
+
| 'NOT_EQUALS'
|
|
432
|
+
| 'GREATER_THAN'
|
|
433
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
434
|
+
| 'LESS_THAN'
|
|
435
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
436
|
+
| 'CONTAINS'
|
|
437
|
+
| 'STARTS_WITH';
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* PASS_RATE condition value, e.g. 4 or "resolved".
|
|
441
|
+
*/
|
|
442
|
+
passValue?: string | number | boolean;
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Required with PERCENTILE, e.g. 95.
|
|
446
|
+
*/
|
|
447
|
+
percentile?: number;
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* METRIC (default): a metric's values. CONVERSATION: conversation counts. UPTIME:
|
|
451
|
+
* health-check outcomes.
|
|
452
|
+
*/
|
|
453
|
+
type?: 'METRIC' | 'CONVERSATION' | 'UPTIME';
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
export namespace Measure {
|
|
457
|
+
/**
|
|
458
|
+
* Split the measure into one series per value of this dimension (the largest 50
|
|
459
|
+
* are returned). Ignored while comparisonGroups are set: each group is then one
|
|
460
|
+
* series.
|
|
461
|
+
*/
|
|
462
|
+
export interface Breakdown {
|
|
463
|
+
type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'DATASET';
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* The property to split by. Required for CALL_PROPERTY and METRIC_PROPERTY.
|
|
467
|
+
*/
|
|
468
|
+
property?: string;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
export interface Filter {
|
|
472
|
+
/**
|
|
473
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
474
|
+
*/
|
|
475
|
+
type:
|
|
476
|
+
| 'METRIC_PROPERTY'
|
|
477
|
+
| 'CALL_PROPERTY'
|
|
478
|
+
| 'AGENT_PROPERTY'
|
|
479
|
+
| 'CALL_ID'
|
|
480
|
+
| 'MODALITY'
|
|
481
|
+
| 'DATASET'
|
|
482
|
+
| 'METRIC_VALUE';
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
486
|
+
*/
|
|
487
|
+
value: string | number | boolean;
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* Defaults to EQUALS.
|
|
491
|
+
*/
|
|
492
|
+
operator?:
|
|
493
|
+
| 'EQUALS'
|
|
494
|
+
| 'NOT_EQUALS'
|
|
495
|
+
| 'GREATER_THAN'
|
|
496
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
497
|
+
| 'LESS_THAN'
|
|
498
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
499
|
+
| 'CONTAINS'
|
|
500
|
+
| 'STARTS_WITH';
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
504
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
505
|
+
*/
|
|
506
|
+
property?: string;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
export interface ComparisonGroup {
|
|
511
|
+
filters: Array<ComparisonGroup.Filter>;
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* The series label; unique within the query.
|
|
515
|
+
*/
|
|
516
|
+
name: string;
|
|
517
|
+
|
|
518
|
+
color?:
|
|
519
|
+
| 'GREEN'
|
|
520
|
+
| 'RED'
|
|
521
|
+
| 'ORANGE'
|
|
522
|
+
| 'PURPLE'
|
|
523
|
+
| 'GREY'
|
|
524
|
+
| 'BLUE'
|
|
525
|
+
| 'PEACH'
|
|
526
|
+
| 'TEAL'
|
|
527
|
+
| 'INDIGO'
|
|
528
|
+
| 'AMBER'
|
|
529
|
+
| 'ROSE'
|
|
530
|
+
| 'CYAN';
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
export namespace ComparisonGroup {
|
|
534
|
+
export interface Filter {
|
|
535
|
+
/**
|
|
536
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
537
|
+
*/
|
|
538
|
+
type:
|
|
539
|
+
| 'METRIC_PROPERTY'
|
|
540
|
+
| 'CALL_PROPERTY'
|
|
541
|
+
| 'AGENT_PROPERTY'
|
|
542
|
+
| 'CALL_ID'
|
|
543
|
+
| 'MODALITY'
|
|
544
|
+
| 'DATASET'
|
|
545
|
+
| 'METRIC_VALUE';
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
549
|
+
*/
|
|
550
|
+
value: string | number | boolean;
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Defaults to EQUALS.
|
|
554
|
+
*/
|
|
555
|
+
operator?:
|
|
556
|
+
| 'EQUALS'
|
|
557
|
+
| 'NOT_EQUALS'
|
|
558
|
+
| 'GREATER_THAN'
|
|
559
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
560
|
+
| 'LESS_THAN'
|
|
561
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
562
|
+
| 'CONTAINS'
|
|
563
|
+
| 'STARTS_WITH';
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
567
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
568
|
+
*/
|
|
569
|
+
property?: string;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
export interface Filter {
|
|
574
|
+
/**
|
|
575
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
576
|
+
*/
|
|
577
|
+
type:
|
|
578
|
+
| 'METRIC_PROPERTY'
|
|
579
|
+
| 'CALL_PROPERTY'
|
|
580
|
+
| 'AGENT_PROPERTY'
|
|
581
|
+
| 'CALL_ID'
|
|
582
|
+
| 'MODALITY'
|
|
583
|
+
| 'DATASET'
|
|
584
|
+
| 'METRIC_VALUE';
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
588
|
+
*/
|
|
589
|
+
value: string | number | boolean;
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* Defaults to EQUALS.
|
|
593
|
+
*/
|
|
594
|
+
operator?:
|
|
595
|
+
| 'EQUALS'
|
|
596
|
+
| 'NOT_EQUALS'
|
|
597
|
+
| 'GREATER_THAN'
|
|
598
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
599
|
+
| 'LESS_THAN'
|
|
600
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
601
|
+
| 'CONTAINS'
|
|
602
|
+
| 'STARTS_WITH';
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
606
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
607
|
+
*/
|
|
608
|
+
property?: string;
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
export interface DashboardUpdateResponse {
|
|
615
|
+
data: DashboardUpdateResponse.Data;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
export namespace DashboardUpdateResponse {
|
|
619
|
+
export interface Data {
|
|
620
|
+
id: string;
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Managed by config as code (`kind: dashboard`). A managed dashboard is read-only
|
|
624
|
+
* here: edits return 409; change it in the config file.
|
|
625
|
+
*/
|
|
626
|
+
configManaged: boolean;
|
|
627
|
+
|
|
628
|
+
createdAt: string;
|
|
629
|
+
|
|
630
|
+
description: string | null;
|
|
631
|
+
|
|
632
|
+
filters: Array<Data.Filter>;
|
|
633
|
+
|
|
634
|
+
isDefault: boolean;
|
|
635
|
+
|
|
636
|
+
name: string;
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* The window: LAST n DAYS/WEEKS/MONTHS up to now, a CALENDAR_ALIGNED period
|
|
640
|
+
* (TODAY, YESTERDAY, THIS_WEEK, LAST_WEEK, THIS_MONTH, LAST_MONTH, THIS_YEAR,
|
|
641
|
+
* LAST_YEAR), FIXED from/to, or SINCE a date. At most 731 days (two years).
|
|
642
|
+
*/
|
|
643
|
+
timeRange: Data.UnionMember0 | Data.UnionMember1 | Data.UnionMember2 | Data.UnionMember3 | null;
|
|
644
|
+
|
|
645
|
+
updatedAt: string;
|
|
646
|
+
|
|
647
|
+
widgets: Array<Data.Widget>;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
export namespace Data {
|
|
651
|
+
export interface Filter {
|
|
652
|
+
/**
|
|
653
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
654
|
+
*/
|
|
655
|
+
type:
|
|
656
|
+
| 'METRIC_PROPERTY'
|
|
657
|
+
| 'CALL_PROPERTY'
|
|
658
|
+
| 'AGENT_PROPERTY'
|
|
659
|
+
| 'CALL_ID'
|
|
660
|
+
| 'MODALITY'
|
|
661
|
+
| 'DATASET'
|
|
662
|
+
| 'METRIC_VALUE';
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
666
|
+
*/
|
|
667
|
+
value: string | number | boolean;
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* Defaults to EQUALS.
|
|
671
|
+
*/
|
|
672
|
+
operator?:
|
|
673
|
+
| 'EQUALS'
|
|
674
|
+
| 'NOT_EQUALS'
|
|
675
|
+
| 'GREATER_THAN'
|
|
676
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
677
|
+
| 'LESS_THAN'
|
|
678
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
679
|
+
| 'CONTAINS'
|
|
680
|
+
| 'STARTS_WITH';
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
684
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
685
|
+
*/
|
|
686
|
+
property?: string;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
export interface UnionMember0 {
|
|
690
|
+
type: 'LAST';
|
|
691
|
+
|
|
692
|
+
unit: 'DAYS' | 'WEEKS' | 'MONTHS';
|
|
693
|
+
|
|
694
|
+
value: number;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
export interface UnionMember1 {
|
|
698
|
+
period:
|
|
699
|
+
| 'TODAY'
|
|
700
|
+
| 'YESTERDAY'
|
|
701
|
+
| 'THIS_WEEK'
|
|
702
|
+
| 'LAST_WEEK'
|
|
703
|
+
| 'THIS_MONTH'
|
|
704
|
+
| 'LAST_MONTH'
|
|
705
|
+
| 'THIS_YEAR'
|
|
706
|
+
| 'LAST_YEAR';
|
|
707
|
+
|
|
708
|
+
type: 'CALENDAR_ALIGNED';
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
export interface UnionMember2 {
|
|
712
|
+
from: string;
|
|
713
|
+
|
|
714
|
+
to: string;
|
|
715
|
+
|
|
716
|
+
type: 'FIXED';
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
export interface UnionMember3 {
|
|
720
|
+
from: string;
|
|
721
|
+
|
|
722
|
+
type: 'SINCE';
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
export interface Widget {
|
|
726
|
+
id: string;
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* What to aggregate: 1 to 10 measures.
|
|
730
|
+
*/
|
|
731
|
+
measures: Array<Widget.Measure>;
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* Unique on the dashboard: how the widget is matched on update.
|
|
735
|
+
*/
|
|
736
|
+
name: string;
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* Run every measure once per named filter set, e.g. one group per agent.
|
|
740
|
+
*/
|
|
741
|
+
comparisonGroups?: Array<Widget.ComparisonGroup>;
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* PREVIOUS_PERIOD adds the preceding window of the same length to every series.
|
|
745
|
+
*/
|
|
746
|
+
comparisonMode?: 'NONE' | 'PREVIOUS_PERIOD';
|
|
747
|
+
|
|
748
|
+
description?: string;
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* Chart type. Defaults to LINE.
|
|
752
|
+
*/
|
|
753
|
+
display?: 'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE';
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* Applied to every measure, on top of each measure's own filters.
|
|
757
|
+
*/
|
|
758
|
+
filters?: Array<Widget.Filter>;
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* Bucket size. Defaults from the window's length and steps coarser when the window
|
|
762
|
+
* would exceed 500 buckets.
|
|
763
|
+
*/
|
|
764
|
+
interval?: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
|
|
765
|
+
|
|
766
|
+
/**
|
|
767
|
+
* Grid width. Defaults to MEDIUM.
|
|
768
|
+
*/
|
|
769
|
+
size?: 'SMALL' | 'MEDIUM' | 'LARGE' | 'EXTRA_LARGE';
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
export namespace Widget {
|
|
773
|
+
export interface Measure {
|
|
774
|
+
/**
|
|
775
|
+
* Defaults by output type: AVG for numeric metrics, COUNT (split by value) for
|
|
776
|
+
* classification and text, PASS_RATE for thresholds and uptime, COUNT for
|
|
777
|
+
* conversations.
|
|
778
|
+
*/
|
|
779
|
+
aggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* Split the measure into one series per value of this dimension (the largest 50
|
|
783
|
+
* are returned). Ignored while comparisonGroups are set: each group is then one
|
|
784
|
+
* series.
|
|
785
|
+
*/
|
|
786
|
+
breakdown?: Measure.Breakdown;
|
|
787
|
+
|
|
788
|
+
/**
|
|
789
|
+
* Chart color on a dashboard.
|
|
790
|
+
*/
|
|
791
|
+
color?:
|
|
792
|
+
| 'GREEN'
|
|
793
|
+
| 'RED'
|
|
794
|
+
| 'ORANGE'
|
|
795
|
+
| 'PURPLE'
|
|
796
|
+
| 'GREY'
|
|
797
|
+
| 'BLUE'
|
|
798
|
+
| 'PEACH'
|
|
799
|
+
| 'TEAL'
|
|
800
|
+
| 'INDIGO'
|
|
801
|
+
| 'AMBER'
|
|
802
|
+
| 'ROSE'
|
|
803
|
+
| 'CYAN';
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* CALL (default for metrics) folds each conversation to one value first, so a long
|
|
807
|
+
* call does not outweigh a short one. NONE aggregates every value.
|
|
808
|
+
*/
|
|
809
|
+
distinctBy?: 'NONE' | 'CALL';
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* Filters for this measure only, on top of the query's filters.
|
|
813
|
+
*/
|
|
814
|
+
filters?: Array<Measure.Filter>;
|
|
815
|
+
|
|
816
|
+
/**
|
|
817
|
+
* Mark one measure as the baseline: every series also reports its value as a
|
|
818
|
+
* percentage of it.
|
|
819
|
+
*/
|
|
820
|
+
isBaseline?: boolean;
|
|
821
|
+
|
|
822
|
+
/**
|
|
823
|
+
* The metric's slug (e.g. `task_completion`) or id. Required for METRIC.
|
|
824
|
+
*/
|
|
825
|
+
metric?: string;
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
* How each conversation is folded when distinctBy is CALL. Defaults to SUM under
|
|
829
|
+
* SUM, else AVG.
|
|
830
|
+
*/
|
|
831
|
+
nestedAggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
|
|
832
|
+
|
|
833
|
+
nestedAggregationPercentile?: number;
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* PASS_RATE condition operator. Omit for a threshold metric: its own condition is
|
|
837
|
+
* used.
|
|
838
|
+
*/
|
|
839
|
+
passOperator?:
|
|
840
|
+
| 'EQUALS'
|
|
841
|
+
| 'NOT_EQUALS'
|
|
842
|
+
| 'GREATER_THAN'
|
|
843
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
844
|
+
| 'LESS_THAN'
|
|
845
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
846
|
+
| 'CONTAINS'
|
|
847
|
+
| 'STARTS_WITH';
|
|
848
|
+
|
|
849
|
+
/**
|
|
850
|
+
* PASS_RATE condition value, e.g. 4 or "resolved".
|
|
851
|
+
*/
|
|
852
|
+
passValue?: string | number | boolean;
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* Required with PERCENTILE, e.g. 95.
|
|
856
|
+
*/
|
|
857
|
+
percentile?: number;
|
|
858
|
+
|
|
859
|
+
/**
|
|
860
|
+
* METRIC (default): a metric's values. CONVERSATION: conversation counts. UPTIME:
|
|
861
|
+
* health-check outcomes.
|
|
862
|
+
*/
|
|
863
|
+
type?: 'METRIC' | 'CONVERSATION' | 'UPTIME';
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
export namespace Measure {
|
|
867
|
+
/**
|
|
868
|
+
* Split the measure into one series per value of this dimension (the largest 50
|
|
869
|
+
* are returned). Ignored while comparisonGroups are set: each group is then one
|
|
870
|
+
* series.
|
|
871
|
+
*/
|
|
872
|
+
export interface Breakdown {
|
|
873
|
+
type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'DATASET';
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* The property to split by. Required for CALL_PROPERTY and METRIC_PROPERTY.
|
|
877
|
+
*/
|
|
878
|
+
property?: string;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
export interface Filter {
|
|
882
|
+
/**
|
|
883
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
884
|
+
*/
|
|
885
|
+
type:
|
|
886
|
+
| 'METRIC_PROPERTY'
|
|
887
|
+
| 'CALL_PROPERTY'
|
|
888
|
+
| 'AGENT_PROPERTY'
|
|
889
|
+
| 'CALL_ID'
|
|
890
|
+
| 'MODALITY'
|
|
891
|
+
| 'DATASET'
|
|
892
|
+
| 'METRIC_VALUE';
|
|
893
|
+
|
|
894
|
+
/**
|
|
895
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
896
|
+
*/
|
|
897
|
+
value: string | number | boolean;
|
|
898
|
+
|
|
899
|
+
/**
|
|
900
|
+
* Defaults to EQUALS.
|
|
901
|
+
*/
|
|
902
|
+
operator?:
|
|
903
|
+
| 'EQUALS'
|
|
904
|
+
| 'NOT_EQUALS'
|
|
905
|
+
| 'GREATER_THAN'
|
|
906
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
907
|
+
| 'LESS_THAN'
|
|
908
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
909
|
+
| 'CONTAINS'
|
|
910
|
+
| 'STARTS_WITH';
|
|
911
|
+
|
|
912
|
+
/**
|
|
913
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
914
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
915
|
+
*/
|
|
916
|
+
property?: string;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
export interface ComparisonGroup {
|
|
921
|
+
filters: Array<ComparisonGroup.Filter>;
|
|
922
|
+
|
|
923
|
+
/**
|
|
924
|
+
* The series label; unique within the query.
|
|
925
|
+
*/
|
|
926
|
+
name: string;
|
|
927
|
+
|
|
928
|
+
color?:
|
|
929
|
+
| 'GREEN'
|
|
930
|
+
| 'RED'
|
|
931
|
+
| 'ORANGE'
|
|
932
|
+
| 'PURPLE'
|
|
933
|
+
| 'GREY'
|
|
934
|
+
| 'BLUE'
|
|
935
|
+
| 'PEACH'
|
|
936
|
+
| 'TEAL'
|
|
937
|
+
| 'INDIGO'
|
|
938
|
+
| 'AMBER'
|
|
939
|
+
| 'ROSE'
|
|
940
|
+
| 'CYAN';
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
export namespace ComparisonGroup {
|
|
944
|
+
export interface Filter {
|
|
945
|
+
/**
|
|
946
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
947
|
+
*/
|
|
948
|
+
type:
|
|
949
|
+
| 'METRIC_PROPERTY'
|
|
950
|
+
| 'CALL_PROPERTY'
|
|
951
|
+
| 'AGENT_PROPERTY'
|
|
952
|
+
| 'CALL_ID'
|
|
953
|
+
| 'MODALITY'
|
|
954
|
+
| 'DATASET'
|
|
955
|
+
| 'METRIC_VALUE';
|
|
956
|
+
|
|
957
|
+
/**
|
|
958
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
959
|
+
*/
|
|
960
|
+
value: string | number | boolean;
|
|
961
|
+
|
|
962
|
+
/**
|
|
963
|
+
* Defaults to EQUALS.
|
|
964
|
+
*/
|
|
965
|
+
operator?:
|
|
966
|
+
| 'EQUALS'
|
|
967
|
+
| 'NOT_EQUALS'
|
|
968
|
+
| 'GREATER_THAN'
|
|
969
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
970
|
+
| 'LESS_THAN'
|
|
971
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
972
|
+
| 'CONTAINS'
|
|
973
|
+
| 'STARTS_WITH';
|
|
974
|
+
|
|
975
|
+
/**
|
|
976
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
977
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
978
|
+
*/
|
|
979
|
+
property?: string;
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
export interface Filter {
|
|
984
|
+
/**
|
|
985
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
986
|
+
*/
|
|
987
|
+
type:
|
|
988
|
+
| 'METRIC_PROPERTY'
|
|
989
|
+
| 'CALL_PROPERTY'
|
|
990
|
+
| 'AGENT_PROPERTY'
|
|
991
|
+
| 'CALL_ID'
|
|
992
|
+
| 'MODALITY'
|
|
993
|
+
| 'DATASET'
|
|
994
|
+
| 'METRIC_VALUE';
|
|
995
|
+
|
|
996
|
+
/**
|
|
997
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
998
|
+
*/
|
|
999
|
+
value: string | number | boolean;
|
|
1000
|
+
|
|
1001
|
+
/**
|
|
1002
|
+
* Defaults to EQUALS.
|
|
1003
|
+
*/
|
|
1004
|
+
operator?:
|
|
1005
|
+
| 'EQUALS'
|
|
1006
|
+
| 'NOT_EQUALS'
|
|
1007
|
+
| 'GREATER_THAN'
|
|
1008
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
1009
|
+
| 'LESS_THAN'
|
|
1010
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
1011
|
+
| 'CONTAINS'
|
|
1012
|
+
| 'STARTS_WITH';
|
|
1013
|
+
|
|
1014
|
+
/**
|
|
1015
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
1016
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
1017
|
+
*/
|
|
1018
|
+
property?: string;
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
export interface DashboardListResponse {
|
|
1025
|
+
data: Array<DashboardListResponse.Data>;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
export namespace DashboardListResponse {
|
|
1029
|
+
export interface Data {
|
|
1030
|
+
id: string;
|
|
1031
|
+
|
|
1032
|
+
/**
|
|
1033
|
+
* Managed by config as code (`kind: dashboard`). A managed dashboard is read-only
|
|
1034
|
+
* here: edits return 409; change it in the config file.
|
|
1035
|
+
*/
|
|
1036
|
+
configManaged: boolean;
|
|
1037
|
+
|
|
1038
|
+
createdAt: string;
|
|
1039
|
+
|
|
1040
|
+
description: string | null;
|
|
1041
|
+
|
|
1042
|
+
isDefault: boolean;
|
|
1043
|
+
|
|
1044
|
+
name: string;
|
|
1045
|
+
|
|
1046
|
+
/**
|
|
1047
|
+
* The window: LAST n DAYS/WEEKS/MONTHS up to now, a CALENDAR_ALIGNED period
|
|
1048
|
+
* (TODAY, YESTERDAY, THIS_WEEK, LAST_WEEK, THIS_MONTH, LAST_MONTH, THIS_YEAR,
|
|
1049
|
+
* LAST_YEAR), FIXED from/to, or SINCE a date. At most 731 days (two years).
|
|
1050
|
+
*/
|
|
1051
|
+
timeRange: Data.UnionMember0 | Data.UnionMember1 | Data.UnionMember2 | Data.UnionMember3 | null;
|
|
1052
|
+
|
|
1053
|
+
updatedAt: string;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
export namespace Data {
|
|
1057
|
+
export interface UnionMember0 {
|
|
1058
|
+
type: 'LAST';
|
|
1059
|
+
|
|
1060
|
+
unit: 'DAYS' | 'WEEKS' | 'MONTHS';
|
|
1061
|
+
|
|
1062
|
+
value: number;
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
export interface UnionMember1 {
|
|
1066
|
+
period:
|
|
1067
|
+
| 'TODAY'
|
|
1068
|
+
| 'YESTERDAY'
|
|
1069
|
+
| 'THIS_WEEK'
|
|
1070
|
+
| 'LAST_WEEK'
|
|
1071
|
+
| 'THIS_MONTH'
|
|
1072
|
+
| 'LAST_MONTH'
|
|
1073
|
+
| 'THIS_YEAR'
|
|
1074
|
+
| 'LAST_YEAR';
|
|
1075
|
+
|
|
1076
|
+
type: 'CALENDAR_ALIGNED';
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
export interface UnionMember2 {
|
|
1080
|
+
from: string;
|
|
1081
|
+
|
|
1082
|
+
to: string;
|
|
1083
|
+
|
|
1084
|
+
type: 'FIXED';
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
export interface UnionMember3 {
|
|
1088
|
+
from: string;
|
|
1089
|
+
|
|
1090
|
+
type: 'SINCE';
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
export interface DashboardDeleteResponse {
|
|
1096
|
+
data: DashboardDeleteResponse.Data;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
export namespace DashboardDeleteResponse {
|
|
1100
|
+
export interface Data {
|
|
1101
|
+
id: string;
|
|
1102
|
+
|
|
1103
|
+
deleted: true;
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
export interface DashboardCreateWidgetResponse {
|
|
1108
|
+
data: DashboardCreateWidgetResponse.Data;
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
export namespace DashboardCreateWidgetResponse {
|
|
1112
|
+
export interface Data {
|
|
1113
|
+
id: string;
|
|
1114
|
+
|
|
1115
|
+
/**
|
|
1116
|
+
* What to aggregate: 1 to 10 measures.
|
|
1117
|
+
*/
|
|
1118
|
+
measures: Array<Data.Measure>;
|
|
1119
|
+
|
|
1120
|
+
/**
|
|
1121
|
+
* Unique on the dashboard: how the widget is matched on update.
|
|
1122
|
+
*/
|
|
1123
|
+
name: string;
|
|
1124
|
+
|
|
1125
|
+
/**
|
|
1126
|
+
* Run every measure once per named filter set, e.g. one group per agent.
|
|
1127
|
+
*/
|
|
1128
|
+
comparisonGroups?: Array<Data.ComparisonGroup>;
|
|
1129
|
+
|
|
1130
|
+
/**
|
|
1131
|
+
* PREVIOUS_PERIOD adds the preceding window of the same length to every series.
|
|
1132
|
+
*/
|
|
1133
|
+
comparisonMode?: 'NONE' | 'PREVIOUS_PERIOD';
|
|
1134
|
+
|
|
1135
|
+
description?: string;
|
|
1136
|
+
|
|
1137
|
+
/**
|
|
1138
|
+
* Chart type. Defaults to LINE.
|
|
1139
|
+
*/
|
|
1140
|
+
display?: 'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE';
|
|
1141
|
+
|
|
1142
|
+
/**
|
|
1143
|
+
* Applied to every measure, on top of each measure's own filters.
|
|
1144
|
+
*/
|
|
1145
|
+
filters?: Array<Data.Filter>;
|
|
1146
|
+
|
|
1147
|
+
/**
|
|
1148
|
+
* Bucket size. Defaults from the window's length and steps coarser when the window
|
|
1149
|
+
* would exceed 500 buckets.
|
|
1150
|
+
*/
|
|
1151
|
+
interval?: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
|
|
1152
|
+
|
|
1153
|
+
/**
|
|
1154
|
+
* Grid width. Defaults to MEDIUM.
|
|
1155
|
+
*/
|
|
1156
|
+
size?: 'SMALL' | 'MEDIUM' | 'LARGE' | 'EXTRA_LARGE';
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
export namespace Data {
|
|
1160
|
+
export interface Measure {
|
|
1161
|
+
/**
|
|
1162
|
+
* Defaults by output type: AVG for numeric metrics, COUNT (split by value) for
|
|
1163
|
+
* classification and text, PASS_RATE for thresholds and uptime, COUNT for
|
|
1164
|
+
* conversations.
|
|
1165
|
+
*/
|
|
1166
|
+
aggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
|
|
1167
|
+
|
|
1168
|
+
/**
|
|
1169
|
+
* Split the measure into one series per value of this dimension (the largest 50
|
|
1170
|
+
* are returned). Ignored while comparisonGroups are set: each group is then one
|
|
1171
|
+
* series.
|
|
1172
|
+
*/
|
|
1173
|
+
breakdown?: Measure.Breakdown;
|
|
1174
|
+
|
|
1175
|
+
/**
|
|
1176
|
+
* Chart color on a dashboard.
|
|
1177
|
+
*/
|
|
1178
|
+
color?:
|
|
1179
|
+
| 'GREEN'
|
|
1180
|
+
| 'RED'
|
|
1181
|
+
| 'ORANGE'
|
|
1182
|
+
| 'PURPLE'
|
|
1183
|
+
| 'GREY'
|
|
1184
|
+
| 'BLUE'
|
|
1185
|
+
| 'PEACH'
|
|
1186
|
+
| 'TEAL'
|
|
1187
|
+
| 'INDIGO'
|
|
1188
|
+
| 'AMBER'
|
|
1189
|
+
| 'ROSE'
|
|
1190
|
+
| 'CYAN';
|
|
1191
|
+
|
|
1192
|
+
/**
|
|
1193
|
+
* CALL (default for metrics) folds each conversation to one value first, so a long
|
|
1194
|
+
* call does not outweigh a short one. NONE aggregates every value.
|
|
1195
|
+
*/
|
|
1196
|
+
distinctBy?: 'NONE' | 'CALL';
|
|
1197
|
+
|
|
1198
|
+
/**
|
|
1199
|
+
* Filters for this measure only, on top of the query's filters.
|
|
1200
|
+
*/
|
|
1201
|
+
filters?: Array<Measure.Filter>;
|
|
1202
|
+
|
|
1203
|
+
/**
|
|
1204
|
+
* Mark one measure as the baseline: every series also reports its value as a
|
|
1205
|
+
* percentage of it.
|
|
1206
|
+
*/
|
|
1207
|
+
isBaseline?: boolean;
|
|
1208
|
+
|
|
1209
|
+
/**
|
|
1210
|
+
* The metric's slug (e.g. `task_completion`) or id. Required for METRIC.
|
|
1211
|
+
*/
|
|
1212
|
+
metric?: string;
|
|
1213
|
+
|
|
1214
|
+
/**
|
|
1215
|
+
* How each conversation is folded when distinctBy is CALL. Defaults to SUM under
|
|
1216
|
+
* SUM, else AVG.
|
|
1217
|
+
*/
|
|
1218
|
+
nestedAggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
|
|
1219
|
+
|
|
1220
|
+
nestedAggregationPercentile?: number;
|
|
1221
|
+
|
|
1222
|
+
/**
|
|
1223
|
+
* PASS_RATE condition operator. Omit for a threshold metric: its own condition is
|
|
1224
|
+
* used.
|
|
1225
|
+
*/
|
|
1226
|
+
passOperator?:
|
|
1227
|
+
| 'EQUALS'
|
|
1228
|
+
| 'NOT_EQUALS'
|
|
1229
|
+
| 'GREATER_THAN'
|
|
1230
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
1231
|
+
| 'LESS_THAN'
|
|
1232
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
1233
|
+
| 'CONTAINS'
|
|
1234
|
+
| 'STARTS_WITH';
|
|
1235
|
+
|
|
1236
|
+
/**
|
|
1237
|
+
* PASS_RATE condition value, e.g. 4 or "resolved".
|
|
1238
|
+
*/
|
|
1239
|
+
passValue?: string | number | boolean;
|
|
1240
|
+
|
|
1241
|
+
/**
|
|
1242
|
+
* Required with PERCENTILE, e.g. 95.
|
|
1243
|
+
*/
|
|
1244
|
+
percentile?: number;
|
|
1245
|
+
|
|
1246
|
+
/**
|
|
1247
|
+
* METRIC (default): a metric's values. CONVERSATION: conversation counts. UPTIME:
|
|
1248
|
+
* health-check outcomes.
|
|
1249
|
+
*/
|
|
1250
|
+
type?: 'METRIC' | 'CONVERSATION' | 'UPTIME';
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
export namespace Measure {
|
|
1254
|
+
/**
|
|
1255
|
+
* Split the measure into one series per value of this dimension (the largest 50
|
|
1256
|
+
* are returned). Ignored while comparisonGroups are set: each group is then one
|
|
1257
|
+
* series.
|
|
1258
|
+
*/
|
|
1259
|
+
export interface Breakdown {
|
|
1260
|
+
type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'DATASET';
|
|
1261
|
+
|
|
1262
|
+
/**
|
|
1263
|
+
* The property to split by. Required for CALL_PROPERTY and METRIC_PROPERTY.
|
|
1264
|
+
*/
|
|
1265
|
+
property?: string;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
export interface Filter {
|
|
1269
|
+
/**
|
|
1270
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
1271
|
+
*/
|
|
1272
|
+
type:
|
|
1273
|
+
| 'METRIC_PROPERTY'
|
|
1274
|
+
| 'CALL_PROPERTY'
|
|
1275
|
+
| 'AGENT_PROPERTY'
|
|
1276
|
+
| 'CALL_ID'
|
|
1277
|
+
| 'MODALITY'
|
|
1278
|
+
| 'DATASET'
|
|
1279
|
+
| 'METRIC_VALUE';
|
|
1280
|
+
|
|
1281
|
+
/**
|
|
1282
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
1283
|
+
*/
|
|
1284
|
+
value: string | number | boolean;
|
|
1285
|
+
|
|
1286
|
+
/**
|
|
1287
|
+
* Defaults to EQUALS.
|
|
1288
|
+
*/
|
|
1289
|
+
operator?:
|
|
1290
|
+
| 'EQUALS'
|
|
1291
|
+
| 'NOT_EQUALS'
|
|
1292
|
+
| 'GREATER_THAN'
|
|
1293
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
1294
|
+
| 'LESS_THAN'
|
|
1295
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
1296
|
+
| 'CONTAINS'
|
|
1297
|
+
| 'STARTS_WITH';
|
|
1298
|
+
|
|
1299
|
+
/**
|
|
1300
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
1301
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
1302
|
+
*/
|
|
1303
|
+
property?: string;
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
export interface ComparisonGroup {
|
|
1308
|
+
filters: Array<ComparisonGroup.Filter>;
|
|
1309
|
+
|
|
1310
|
+
/**
|
|
1311
|
+
* The series label; unique within the query.
|
|
1312
|
+
*/
|
|
1313
|
+
name: string;
|
|
1314
|
+
|
|
1315
|
+
color?:
|
|
1316
|
+
| 'GREEN'
|
|
1317
|
+
| 'RED'
|
|
1318
|
+
| 'ORANGE'
|
|
1319
|
+
| 'PURPLE'
|
|
1320
|
+
| 'GREY'
|
|
1321
|
+
| 'BLUE'
|
|
1322
|
+
| 'PEACH'
|
|
1323
|
+
| 'TEAL'
|
|
1324
|
+
| 'INDIGO'
|
|
1325
|
+
| 'AMBER'
|
|
1326
|
+
| 'ROSE'
|
|
1327
|
+
| 'CYAN';
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
export namespace ComparisonGroup {
|
|
1331
|
+
export interface Filter {
|
|
1332
|
+
/**
|
|
1333
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
1334
|
+
*/
|
|
1335
|
+
type:
|
|
1336
|
+
| 'METRIC_PROPERTY'
|
|
1337
|
+
| 'CALL_PROPERTY'
|
|
1338
|
+
| 'AGENT_PROPERTY'
|
|
1339
|
+
| 'CALL_ID'
|
|
1340
|
+
| 'MODALITY'
|
|
1341
|
+
| 'DATASET'
|
|
1342
|
+
| 'METRIC_VALUE';
|
|
1343
|
+
|
|
1344
|
+
/**
|
|
1345
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
1346
|
+
*/
|
|
1347
|
+
value: string | number | boolean;
|
|
1348
|
+
|
|
1349
|
+
/**
|
|
1350
|
+
* Defaults to EQUALS.
|
|
1351
|
+
*/
|
|
1352
|
+
operator?:
|
|
1353
|
+
| 'EQUALS'
|
|
1354
|
+
| 'NOT_EQUALS'
|
|
1355
|
+
| 'GREATER_THAN'
|
|
1356
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
1357
|
+
| 'LESS_THAN'
|
|
1358
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
1359
|
+
| 'CONTAINS'
|
|
1360
|
+
| 'STARTS_WITH';
|
|
1361
|
+
|
|
1362
|
+
/**
|
|
1363
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
1364
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
1365
|
+
*/
|
|
1366
|
+
property?: string;
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
export interface Filter {
|
|
1371
|
+
/**
|
|
1372
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
1373
|
+
*/
|
|
1374
|
+
type:
|
|
1375
|
+
| 'METRIC_PROPERTY'
|
|
1376
|
+
| 'CALL_PROPERTY'
|
|
1377
|
+
| 'AGENT_PROPERTY'
|
|
1378
|
+
| 'CALL_ID'
|
|
1379
|
+
| 'MODALITY'
|
|
1380
|
+
| 'DATASET'
|
|
1381
|
+
| 'METRIC_VALUE';
|
|
1382
|
+
|
|
1383
|
+
/**
|
|
1384
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
1385
|
+
*/
|
|
1386
|
+
value: string | number | boolean;
|
|
1387
|
+
|
|
1388
|
+
/**
|
|
1389
|
+
* Defaults to EQUALS.
|
|
1390
|
+
*/
|
|
1391
|
+
operator?:
|
|
1392
|
+
| 'EQUALS'
|
|
1393
|
+
| 'NOT_EQUALS'
|
|
1394
|
+
| 'GREATER_THAN'
|
|
1395
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
1396
|
+
| 'LESS_THAN'
|
|
1397
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
1398
|
+
| 'CONTAINS'
|
|
1399
|
+
| 'STARTS_WITH';
|
|
1400
|
+
|
|
1401
|
+
/**
|
|
1402
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
1403
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
1404
|
+
*/
|
|
1405
|
+
property?: string;
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
export interface DashboardDeleteWidgetResponse {
|
|
1411
|
+
data: DashboardDeleteWidgetResponse.Data;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
export namespace DashboardDeleteWidgetResponse {
|
|
1415
|
+
export interface Data {
|
|
1416
|
+
id: string;
|
|
1417
|
+
|
|
1418
|
+
deleted: true;
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
export interface DashboardGetByIDResponse {
|
|
1423
|
+
data: DashboardGetByIDResponse.Data;
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
export namespace DashboardGetByIDResponse {
|
|
1427
|
+
export interface Data {
|
|
1428
|
+
id: string;
|
|
1429
|
+
|
|
1430
|
+
/**
|
|
1431
|
+
* Managed by config as code (`kind: dashboard`). A managed dashboard is read-only
|
|
1432
|
+
* here: edits return 409; change it in the config file.
|
|
1433
|
+
*/
|
|
1434
|
+
configManaged: boolean;
|
|
1435
|
+
|
|
1436
|
+
createdAt: string;
|
|
1437
|
+
|
|
1438
|
+
description: string | null;
|
|
1439
|
+
|
|
1440
|
+
filters: Array<Data.Filter>;
|
|
1441
|
+
|
|
1442
|
+
isDefault: boolean;
|
|
1443
|
+
|
|
1444
|
+
name: string;
|
|
1445
|
+
|
|
1446
|
+
/**
|
|
1447
|
+
* The window: LAST n DAYS/WEEKS/MONTHS up to now, a CALENDAR_ALIGNED period
|
|
1448
|
+
* (TODAY, YESTERDAY, THIS_WEEK, LAST_WEEK, THIS_MONTH, LAST_MONTH, THIS_YEAR,
|
|
1449
|
+
* LAST_YEAR), FIXED from/to, or SINCE a date. At most 731 days (two years).
|
|
1450
|
+
*/
|
|
1451
|
+
timeRange: Data.UnionMember0 | Data.UnionMember1 | Data.UnionMember2 | Data.UnionMember3 | null;
|
|
1452
|
+
|
|
1453
|
+
updatedAt: string;
|
|
1454
|
+
|
|
1455
|
+
widgets: Array<Data.Widget>;
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
export namespace Data {
|
|
1459
|
+
export interface Filter {
|
|
1460
|
+
/**
|
|
1461
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
1462
|
+
*/
|
|
1463
|
+
type:
|
|
1464
|
+
| 'METRIC_PROPERTY'
|
|
1465
|
+
| 'CALL_PROPERTY'
|
|
1466
|
+
| 'AGENT_PROPERTY'
|
|
1467
|
+
| 'CALL_ID'
|
|
1468
|
+
| 'MODALITY'
|
|
1469
|
+
| 'DATASET'
|
|
1470
|
+
| 'METRIC_VALUE';
|
|
1471
|
+
|
|
1472
|
+
/**
|
|
1473
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
1474
|
+
*/
|
|
1475
|
+
value: string | number | boolean;
|
|
1476
|
+
|
|
1477
|
+
/**
|
|
1478
|
+
* Defaults to EQUALS.
|
|
1479
|
+
*/
|
|
1480
|
+
operator?:
|
|
1481
|
+
| 'EQUALS'
|
|
1482
|
+
| 'NOT_EQUALS'
|
|
1483
|
+
| 'GREATER_THAN'
|
|
1484
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
1485
|
+
| 'LESS_THAN'
|
|
1486
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
1487
|
+
| 'CONTAINS'
|
|
1488
|
+
| 'STARTS_WITH';
|
|
1489
|
+
|
|
1490
|
+
/**
|
|
1491
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
1492
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
1493
|
+
*/
|
|
1494
|
+
property?: string;
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
export interface UnionMember0 {
|
|
1498
|
+
type: 'LAST';
|
|
1499
|
+
|
|
1500
|
+
unit: 'DAYS' | 'WEEKS' | 'MONTHS';
|
|
1501
|
+
|
|
1502
|
+
value: number;
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
export interface UnionMember1 {
|
|
1506
|
+
period:
|
|
1507
|
+
| 'TODAY'
|
|
1508
|
+
| 'YESTERDAY'
|
|
1509
|
+
| 'THIS_WEEK'
|
|
1510
|
+
| 'LAST_WEEK'
|
|
1511
|
+
| 'THIS_MONTH'
|
|
1512
|
+
| 'LAST_MONTH'
|
|
1513
|
+
| 'THIS_YEAR'
|
|
1514
|
+
| 'LAST_YEAR';
|
|
1515
|
+
|
|
1516
|
+
type: 'CALENDAR_ALIGNED';
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
export interface UnionMember2 {
|
|
1520
|
+
from: string;
|
|
1521
|
+
|
|
1522
|
+
to: string;
|
|
1523
|
+
|
|
1524
|
+
type: 'FIXED';
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
export interface UnionMember3 {
|
|
1528
|
+
from: string;
|
|
1529
|
+
|
|
1530
|
+
type: 'SINCE';
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
export interface Widget {
|
|
1534
|
+
id: string;
|
|
1535
|
+
|
|
1536
|
+
/**
|
|
1537
|
+
* What to aggregate: 1 to 10 measures.
|
|
1538
|
+
*/
|
|
1539
|
+
measures: Array<Widget.Measure>;
|
|
1540
|
+
|
|
1541
|
+
/**
|
|
1542
|
+
* Unique on the dashboard: how the widget is matched on update.
|
|
1543
|
+
*/
|
|
1544
|
+
name: string;
|
|
1545
|
+
|
|
1546
|
+
/**
|
|
1547
|
+
* Run every measure once per named filter set, e.g. one group per agent.
|
|
1548
|
+
*/
|
|
1549
|
+
comparisonGroups?: Array<Widget.ComparisonGroup>;
|
|
1550
|
+
|
|
1551
|
+
/**
|
|
1552
|
+
* PREVIOUS_PERIOD adds the preceding window of the same length to every series.
|
|
1553
|
+
*/
|
|
1554
|
+
comparisonMode?: 'NONE' | 'PREVIOUS_PERIOD';
|
|
1555
|
+
|
|
1556
|
+
description?: string;
|
|
1557
|
+
|
|
1558
|
+
/**
|
|
1559
|
+
* Chart type. Defaults to LINE.
|
|
1560
|
+
*/
|
|
1561
|
+
display?: 'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE';
|
|
1562
|
+
|
|
1563
|
+
/**
|
|
1564
|
+
* Applied to every measure, on top of each measure's own filters.
|
|
1565
|
+
*/
|
|
1566
|
+
filters?: Array<Widget.Filter>;
|
|
1567
|
+
|
|
1568
|
+
/**
|
|
1569
|
+
* Bucket size. Defaults from the window's length and steps coarser when the window
|
|
1570
|
+
* would exceed 500 buckets.
|
|
1571
|
+
*/
|
|
1572
|
+
interval?: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
|
|
1573
|
+
|
|
1574
|
+
/**
|
|
1575
|
+
* Grid width. Defaults to MEDIUM.
|
|
1576
|
+
*/
|
|
1577
|
+
size?: 'SMALL' | 'MEDIUM' | 'LARGE' | 'EXTRA_LARGE';
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
export namespace Widget {
|
|
1581
|
+
export interface Measure {
|
|
1582
|
+
/**
|
|
1583
|
+
* Defaults by output type: AVG for numeric metrics, COUNT (split by value) for
|
|
1584
|
+
* classification and text, PASS_RATE for thresholds and uptime, COUNT for
|
|
1585
|
+
* conversations.
|
|
1586
|
+
*/
|
|
1587
|
+
aggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
|
|
1588
|
+
|
|
1589
|
+
/**
|
|
1590
|
+
* Split the measure into one series per value of this dimension (the largest 50
|
|
1591
|
+
* are returned). Ignored while comparisonGroups are set: each group is then one
|
|
1592
|
+
* series.
|
|
1593
|
+
*/
|
|
1594
|
+
breakdown?: Measure.Breakdown;
|
|
1595
|
+
|
|
1596
|
+
/**
|
|
1597
|
+
* Chart color on a dashboard.
|
|
1598
|
+
*/
|
|
1599
|
+
color?:
|
|
1600
|
+
| 'GREEN'
|
|
1601
|
+
| 'RED'
|
|
1602
|
+
| 'ORANGE'
|
|
1603
|
+
| 'PURPLE'
|
|
1604
|
+
| 'GREY'
|
|
1605
|
+
| 'BLUE'
|
|
1606
|
+
| 'PEACH'
|
|
1607
|
+
| 'TEAL'
|
|
1608
|
+
| 'INDIGO'
|
|
1609
|
+
| 'AMBER'
|
|
1610
|
+
| 'ROSE'
|
|
1611
|
+
| 'CYAN';
|
|
1612
|
+
|
|
1613
|
+
/**
|
|
1614
|
+
* CALL (default for metrics) folds each conversation to one value first, so a long
|
|
1615
|
+
* call does not outweigh a short one. NONE aggregates every value.
|
|
1616
|
+
*/
|
|
1617
|
+
distinctBy?: 'NONE' | 'CALL';
|
|
1618
|
+
|
|
1619
|
+
/**
|
|
1620
|
+
* Filters for this measure only, on top of the query's filters.
|
|
1621
|
+
*/
|
|
1622
|
+
filters?: Array<Measure.Filter>;
|
|
1623
|
+
|
|
1624
|
+
/**
|
|
1625
|
+
* Mark one measure as the baseline: every series also reports its value as a
|
|
1626
|
+
* percentage of it.
|
|
1627
|
+
*/
|
|
1628
|
+
isBaseline?: boolean;
|
|
1629
|
+
|
|
1630
|
+
/**
|
|
1631
|
+
* The metric's slug (e.g. `task_completion`) or id. Required for METRIC.
|
|
1632
|
+
*/
|
|
1633
|
+
metric?: string;
|
|
1634
|
+
|
|
1635
|
+
/**
|
|
1636
|
+
* How each conversation is folded when distinctBy is CALL. Defaults to SUM under
|
|
1637
|
+
* SUM, else AVG.
|
|
1638
|
+
*/
|
|
1639
|
+
nestedAggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
|
|
1640
|
+
|
|
1641
|
+
nestedAggregationPercentile?: number;
|
|
1642
|
+
|
|
1643
|
+
/**
|
|
1644
|
+
* PASS_RATE condition operator. Omit for a threshold metric: its own condition is
|
|
1645
|
+
* used.
|
|
1646
|
+
*/
|
|
1647
|
+
passOperator?:
|
|
1648
|
+
| 'EQUALS'
|
|
1649
|
+
| 'NOT_EQUALS'
|
|
1650
|
+
| 'GREATER_THAN'
|
|
1651
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
1652
|
+
| 'LESS_THAN'
|
|
1653
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
1654
|
+
| 'CONTAINS'
|
|
1655
|
+
| 'STARTS_WITH';
|
|
1656
|
+
|
|
1657
|
+
/**
|
|
1658
|
+
* PASS_RATE condition value, e.g. 4 or "resolved".
|
|
1659
|
+
*/
|
|
1660
|
+
passValue?: string | number | boolean;
|
|
1661
|
+
|
|
1662
|
+
/**
|
|
1663
|
+
* Required with PERCENTILE, e.g. 95.
|
|
1664
|
+
*/
|
|
1665
|
+
percentile?: number;
|
|
1666
|
+
|
|
1667
|
+
/**
|
|
1668
|
+
* METRIC (default): a metric's values. CONVERSATION: conversation counts. UPTIME:
|
|
1669
|
+
* health-check outcomes.
|
|
1670
|
+
*/
|
|
1671
|
+
type?: 'METRIC' | 'CONVERSATION' | 'UPTIME';
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
export namespace Measure {
|
|
1675
|
+
/**
|
|
1676
|
+
* Split the measure into one series per value of this dimension (the largest 50
|
|
1677
|
+
* are returned). Ignored while comparisonGroups are set: each group is then one
|
|
1678
|
+
* series.
|
|
1679
|
+
*/
|
|
1680
|
+
export interface Breakdown {
|
|
1681
|
+
type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'DATASET';
|
|
1682
|
+
|
|
1683
|
+
/**
|
|
1684
|
+
* The property to split by. Required for CALL_PROPERTY and METRIC_PROPERTY.
|
|
1685
|
+
*/
|
|
1686
|
+
property?: string;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
export interface Filter {
|
|
1690
|
+
/**
|
|
1691
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
1692
|
+
*/
|
|
1693
|
+
type:
|
|
1694
|
+
| 'METRIC_PROPERTY'
|
|
1695
|
+
| 'CALL_PROPERTY'
|
|
1696
|
+
| 'AGENT_PROPERTY'
|
|
1697
|
+
| 'CALL_ID'
|
|
1698
|
+
| 'MODALITY'
|
|
1699
|
+
| 'DATASET'
|
|
1700
|
+
| 'METRIC_VALUE';
|
|
1701
|
+
|
|
1702
|
+
/**
|
|
1703
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
1704
|
+
*/
|
|
1705
|
+
value: string | number | boolean;
|
|
1706
|
+
|
|
1707
|
+
/**
|
|
1708
|
+
* Defaults to EQUALS.
|
|
1709
|
+
*/
|
|
1710
|
+
operator?:
|
|
1711
|
+
| 'EQUALS'
|
|
1712
|
+
| 'NOT_EQUALS'
|
|
1713
|
+
| 'GREATER_THAN'
|
|
1714
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
1715
|
+
| 'LESS_THAN'
|
|
1716
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
1717
|
+
| 'CONTAINS'
|
|
1718
|
+
| 'STARTS_WITH';
|
|
1719
|
+
|
|
1720
|
+
/**
|
|
1721
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
1722
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
1723
|
+
*/
|
|
1724
|
+
property?: string;
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
export interface ComparisonGroup {
|
|
1729
|
+
filters: Array<ComparisonGroup.Filter>;
|
|
1730
|
+
|
|
1731
|
+
/**
|
|
1732
|
+
* The series label; unique within the query.
|
|
1733
|
+
*/
|
|
1734
|
+
name: string;
|
|
1735
|
+
|
|
1736
|
+
color?:
|
|
1737
|
+
| 'GREEN'
|
|
1738
|
+
| 'RED'
|
|
1739
|
+
| 'ORANGE'
|
|
1740
|
+
| 'PURPLE'
|
|
1741
|
+
| 'GREY'
|
|
1742
|
+
| 'BLUE'
|
|
1743
|
+
| 'PEACH'
|
|
1744
|
+
| 'TEAL'
|
|
1745
|
+
| 'INDIGO'
|
|
1746
|
+
| 'AMBER'
|
|
1747
|
+
| 'ROSE'
|
|
1748
|
+
| 'CYAN';
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
export namespace ComparisonGroup {
|
|
1752
|
+
export interface Filter {
|
|
1753
|
+
/**
|
|
1754
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
1755
|
+
*/
|
|
1756
|
+
type:
|
|
1757
|
+
| 'METRIC_PROPERTY'
|
|
1758
|
+
| 'CALL_PROPERTY'
|
|
1759
|
+
| 'AGENT_PROPERTY'
|
|
1760
|
+
| 'CALL_ID'
|
|
1761
|
+
| 'MODALITY'
|
|
1762
|
+
| 'DATASET'
|
|
1763
|
+
| 'METRIC_VALUE';
|
|
1764
|
+
|
|
1765
|
+
/**
|
|
1766
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
1767
|
+
*/
|
|
1768
|
+
value: string | number | boolean;
|
|
1769
|
+
|
|
1770
|
+
/**
|
|
1771
|
+
* Defaults to EQUALS.
|
|
1772
|
+
*/
|
|
1773
|
+
operator?:
|
|
1774
|
+
| 'EQUALS'
|
|
1775
|
+
| 'NOT_EQUALS'
|
|
1776
|
+
| 'GREATER_THAN'
|
|
1777
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
1778
|
+
| 'LESS_THAN'
|
|
1779
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
1780
|
+
| 'CONTAINS'
|
|
1781
|
+
| 'STARTS_WITH';
|
|
1782
|
+
|
|
1783
|
+
/**
|
|
1784
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
1785
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
1786
|
+
*/
|
|
1787
|
+
property?: string;
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
export interface Filter {
|
|
1792
|
+
/**
|
|
1793
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
1794
|
+
*/
|
|
1795
|
+
type:
|
|
1796
|
+
| 'METRIC_PROPERTY'
|
|
1797
|
+
| 'CALL_PROPERTY'
|
|
1798
|
+
| 'AGENT_PROPERTY'
|
|
1799
|
+
| 'CALL_ID'
|
|
1800
|
+
| 'MODALITY'
|
|
1801
|
+
| 'DATASET'
|
|
1802
|
+
| 'METRIC_VALUE';
|
|
1803
|
+
|
|
1804
|
+
/**
|
|
1805
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
1806
|
+
*/
|
|
1807
|
+
value: string | number | boolean;
|
|
1808
|
+
|
|
1809
|
+
/**
|
|
1810
|
+
* Defaults to EQUALS.
|
|
1811
|
+
*/
|
|
1812
|
+
operator?:
|
|
1813
|
+
| 'EQUALS'
|
|
1814
|
+
| 'NOT_EQUALS'
|
|
1815
|
+
| 'GREATER_THAN'
|
|
1816
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
1817
|
+
| 'LESS_THAN'
|
|
1818
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
1819
|
+
| 'CONTAINS'
|
|
1820
|
+
| 'STARTS_WITH';
|
|
1821
|
+
|
|
1822
|
+
/**
|
|
1823
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
1824
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
1825
|
+
*/
|
|
1826
|
+
property?: string;
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
export interface DashboardGetDataResponse {
|
|
1833
|
+
/**
|
|
1834
|
+
* Every widget's series over the window, top to bottom. A widget that fails on its
|
|
1835
|
+
* own (say its metric was deleted) carries `error` and no series; the others still
|
|
1836
|
+
* return.
|
|
1837
|
+
*/
|
|
1838
|
+
data: DashboardGetDataResponse.Data;
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
export namespace DashboardGetDataResponse {
|
|
1842
|
+
/**
|
|
1843
|
+
* Every widget's series over the window, top to bottom. A widget that fails on its
|
|
1844
|
+
* own (say its metric was deleted) carries `error` and no series; the others still
|
|
1845
|
+
* return.
|
|
1846
|
+
*/
|
|
1847
|
+
export interface Data {
|
|
1848
|
+
dashboardId: string;
|
|
1849
|
+
|
|
1850
|
+
from: string;
|
|
1851
|
+
|
|
1852
|
+
timezone: string;
|
|
1853
|
+
|
|
1854
|
+
to: string;
|
|
1855
|
+
|
|
1856
|
+
widgets: Array<Data.Widget>;
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1859
|
+
export namespace Data {
|
|
1860
|
+
export interface Widget {
|
|
1861
|
+
blocked: boolean;
|
|
1862
|
+
|
|
1863
|
+
error: string | null;
|
|
1864
|
+
|
|
1865
|
+
interval: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
|
|
1866
|
+
|
|
1867
|
+
name: string;
|
|
1868
|
+
|
|
1869
|
+
omittedSeries: number;
|
|
1870
|
+
|
|
1871
|
+
series: Array<Widget.Sery>;
|
|
1872
|
+
|
|
1873
|
+
widgetId: string;
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
export namespace Widget {
|
|
1877
|
+
export interface Sery {
|
|
1878
|
+
aggregation: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
|
|
1879
|
+
|
|
1880
|
+
breakdownValue: string | null;
|
|
1881
|
+
|
|
1882
|
+
buckets: Array<Sery.Bucket>;
|
|
1883
|
+
|
|
1884
|
+
comparisonGroup: string | null;
|
|
1885
|
+
|
|
1886
|
+
comparisonValue: number | null;
|
|
1887
|
+
|
|
1888
|
+
measureIndex: number;
|
|
1889
|
+
|
|
1890
|
+
metric: string | null;
|
|
1891
|
+
|
|
1892
|
+
percentageOfBaseline: number | null;
|
|
1893
|
+
|
|
1894
|
+
sampleSize: number | null;
|
|
1895
|
+
|
|
1896
|
+
type: 'METRIC' | 'CONVERSATION' | 'UPTIME';
|
|
1897
|
+
|
|
1898
|
+
value: number;
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
export namespace Sery {
|
|
1902
|
+
export interface Bucket {
|
|
1903
|
+
date: string;
|
|
1904
|
+
|
|
1905
|
+
value: number;
|
|
1906
|
+
|
|
1907
|
+
comparisonDate?: string;
|
|
1908
|
+
|
|
1909
|
+
comparisonValue?: number;
|
|
1910
|
+
|
|
1911
|
+
passed?: number;
|
|
1912
|
+
|
|
1913
|
+
percentageOfBaseline?: number;
|
|
1914
|
+
|
|
1915
|
+
sampleSize?: number;
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
}
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
export interface DashboardGetWidgetDataResponse {
|
|
1923
|
+
data: DashboardGetWidgetDataResponse.Data;
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
export namespace DashboardGetWidgetDataResponse {
|
|
1927
|
+
export interface Data {
|
|
1928
|
+
blocked: boolean;
|
|
1929
|
+
|
|
1930
|
+
error: string | null;
|
|
1931
|
+
|
|
1932
|
+
from: string;
|
|
1933
|
+
|
|
1934
|
+
interval: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
|
|
1935
|
+
|
|
1936
|
+
name: string;
|
|
1937
|
+
|
|
1938
|
+
omittedSeries: number;
|
|
1939
|
+
|
|
1940
|
+
series: Array<Data.Sery>;
|
|
1941
|
+
|
|
1942
|
+
timezone: string;
|
|
1943
|
+
|
|
1944
|
+
to: string;
|
|
1945
|
+
|
|
1946
|
+
widgetId: string;
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
export namespace Data {
|
|
1950
|
+
export interface Sery {
|
|
1951
|
+
aggregation: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
|
|
1952
|
+
|
|
1953
|
+
breakdownValue: string | null;
|
|
1954
|
+
|
|
1955
|
+
buckets: Array<Sery.Bucket>;
|
|
1956
|
+
|
|
1957
|
+
comparisonGroup: string | null;
|
|
1958
|
+
|
|
1959
|
+
comparisonValue: number | null;
|
|
1960
|
+
|
|
1961
|
+
measureIndex: number;
|
|
1962
|
+
|
|
1963
|
+
metric: string | null;
|
|
1964
|
+
|
|
1965
|
+
percentageOfBaseline: number | null;
|
|
1966
|
+
|
|
1967
|
+
sampleSize: number | null;
|
|
1968
|
+
|
|
1969
|
+
type: 'METRIC' | 'CONVERSATION' | 'UPTIME';
|
|
1970
|
+
|
|
1971
|
+
value: number;
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
export namespace Sery {
|
|
1975
|
+
export interface Bucket {
|
|
1976
|
+
date: string;
|
|
1977
|
+
|
|
1978
|
+
value: number;
|
|
1979
|
+
|
|
1980
|
+
comparisonDate?: string;
|
|
1981
|
+
|
|
1982
|
+
comparisonValue?: number;
|
|
1983
|
+
|
|
1984
|
+
passed?: number;
|
|
1985
|
+
|
|
1986
|
+
percentageOfBaseline?: number;
|
|
1987
|
+
|
|
1988
|
+
sampleSize?: number;
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
|
|
1994
|
+
export interface DashboardUpdateWidgetResponse {
|
|
1995
|
+
data: DashboardUpdateWidgetResponse.Data;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
export namespace DashboardUpdateWidgetResponse {
|
|
1999
|
+
export interface Data {
|
|
2000
|
+
id: string;
|
|
2001
|
+
|
|
2002
|
+
/**
|
|
2003
|
+
* What to aggregate: 1 to 10 measures.
|
|
2004
|
+
*/
|
|
2005
|
+
measures: Array<Data.Measure>;
|
|
2006
|
+
|
|
2007
|
+
/**
|
|
2008
|
+
* Unique on the dashboard: how the widget is matched on update.
|
|
2009
|
+
*/
|
|
2010
|
+
name: string;
|
|
2011
|
+
|
|
2012
|
+
/**
|
|
2013
|
+
* Run every measure once per named filter set, e.g. one group per agent.
|
|
2014
|
+
*/
|
|
2015
|
+
comparisonGroups?: Array<Data.ComparisonGroup>;
|
|
2016
|
+
|
|
2017
|
+
/**
|
|
2018
|
+
* PREVIOUS_PERIOD adds the preceding window of the same length to every series.
|
|
2019
|
+
*/
|
|
2020
|
+
comparisonMode?: 'NONE' | 'PREVIOUS_PERIOD';
|
|
2021
|
+
|
|
2022
|
+
description?: string;
|
|
2023
|
+
|
|
2024
|
+
/**
|
|
2025
|
+
* Chart type. Defaults to LINE.
|
|
2026
|
+
*/
|
|
2027
|
+
display?: 'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE';
|
|
2028
|
+
|
|
2029
|
+
/**
|
|
2030
|
+
* Applied to every measure, on top of each measure's own filters.
|
|
2031
|
+
*/
|
|
2032
|
+
filters?: Array<Data.Filter>;
|
|
2033
|
+
|
|
2034
|
+
/**
|
|
2035
|
+
* Bucket size. Defaults from the window's length and steps coarser when the window
|
|
2036
|
+
* would exceed 500 buckets.
|
|
2037
|
+
*/
|
|
2038
|
+
interval?: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
|
|
2039
|
+
|
|
2040
|
+
/**
|
|
2041
|
+
* Grid width. Defaults to MEDIUM.
|
|
2042
|
+
*/
|
|
2043
|
+
size?: 'SMALL' | 'MEDIUM' | 'LARGE' | 'EXTRA_LARGE';
|
|
2044
|
+
}
|
|
2045
|
+
|
|
2046
|
+
export namespace Data {
|
|
2047
|
+
export interface Measure {
|
|
2048
|
+
/**
|
|
2049
|
+
* Defaults by output type: AVG for numeric metrics, COUNT (split by value) for
|
|
2050
|
+
* classification and text, PASS_RATE for thresholds and uptime, COUNT for
|
|
2051
|
+
* conversations.
|
|
2052
|
+
*/
|
|
2053
|
+
aggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
|
|
2054
|
+
|
|
2055
|
+
/**
|
|
2056
|
+
* Split the measure into one series per value of this dimension (the largest 50
|
|
2057
|
+
* are returned). Ignored while comparisonGroups are set: each group is then one
|
|
2058
|
+
* series.
|
|
2059
|
+
*/
|
|
2060
|
+
breakdown?: Measure.Breakdown;
|
|
2061
|
+
|
|
2062
|
+
/**
|
|
2063
|
+
* Chart color on a dashboard.
|
|
2064
|
+
*/
|
|
2065
|
+
color?:
|
|
2066
|
+
| 'GREEN'
|
|
2067
|
+
| 'RED'
|
|
2068
|
+
| 'ORANGE'
|
|
2069
|
+
| 'PURPLE'
|
|
2070
|
+
| 'GREY'
|
|
2071
|
+
| 'BLUE'
|
|
2072
|
+
| 'PEACH'
|
|
2073
|
+
| 'TEAL'
|
|
2074
|
+
| 'INDIGO'
|
|
2075
|
+
| 'AMBER'
|
|
2076
|
+
| 'ROSE'
|
|
2077
|
+
| 'CYAN';
|
|
2078
|
+
|
|
2079
|
+
/**
|
|
2080
|
+
* CALL (default for metrics) folds each conversation to one value first, so a long
|
|
2081
|
+
* call does not outweigh a short one. NONE aggregates every value.
|
|
2082
|
+
*/
|
|
2083
|
+
distinctBy?: 'NONE' | 'CALL';
|
|
2084
|
+
|
|
2085
|
+
/**
|
|
2086
|
+
* Filters for this measure only, on top of the query's filters.
|
|
2087
|
+
*/
|
|
2088
|
+
filters?: Array<Measure.Filter>;
|
|
2089
|
+
|
|
2090
|
+
/**
|
|
2091
|
+
* Mark one measure as the baseline: every series also reports its value as a
|
|
2092
|
+
* percentage of it.
|
|
2093
|
+
*/
|
|
2094
|
+
isBaseline?: boolean;
|
|
2095
|
+
|
|
2096
|
+
/**
|
|
2097
|
+
* The metric's slug (e.g. `task_completion`) or id. Required for METRIC.
|
|
2098
|
+
*/
|
|
2099
|
+
metric?: string;
|
|
2100
|
+
|
|
2101
|
+
/**
|
|
2102
|
+
* How each conversation is folded when distinctBy is CALL. Defaults to SUM under
|
|
2103
|
+
* SUM, else AVG.
|
|
2104
|
+
*/
|
|
2105
|
+
nestedAggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
|
|
2106
|
+
|
|
2107
|
+
nestedAggregationPercentile?: number;
|
|
2108
|
+
|
|
2109
|
+
/**
|
|
2110
|
+
* PASS_RATE condition operator. Omit for a threshold metric: its own condition is
|
|
2111
|
+
* used.
|
|
2112
|
+
*/
|
|
2113
|
+
passOperator?:
|
|
2114
|
+
| 'EQUALS'
|
|
2115
|
+
| 'NOT_EQUALS'
|
|
2116
|
+
| 'GREATER_THAN'
|
|
2117
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
2118
|
+
| 'LESS_THAN'
|
|
2119
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
2120
|
+
| 'CONTAINS'
|
|
2121
|
+
| 'STARTS_WITH';
|
|
2122
|
+
|
|
2123
|
+
/**
|
|
2124
|
+
* PASS_RATE condition value, e.g. 4 or "resolved".
|
|
2125
|
+
*/
|
|
2126
|
+
passValue?: string | number | boolean;
|
|
2127
|
+
|
|
2128
|
+
/**
|
|
2129
|
+
* Required with PERCENTILE, e.g. 95.
|
|
2130
|
+
*/
|
|
2131
|
+
percentile?: number;
|
|
2132
|
+
|
|
2133
|
+
/**
|
|
2134
|
+
* METRIC (default): a metric's values. CONVERSATION: conversation counts. UPTIME:
|
|
2135
|
+
* health-check outcomes.
|
|
2136
|
+
*/
|
|
2137
|
+
type?: 'METRIC' | 'CONVERSATION' | 'UPTIME';
|
|
2138
|
+
}
|
|
2139
|
+
|
|
2140
|
+
export namespace Measure {
|
|
2141
|
+
/**
|
|
2142
|
+
* Split the measure into one series per value of this dimension (the largest 50
|
|
2143
|
+
* are returned). Ignored while comparisonGroups are set: each group is then one
|
|
2144
|
+
* series.
|
|
2145
|
+
*/
|
|
2146
|
+
export interface Breakdown {
|
|
2147
|
+
type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'DATASET';
|
|
2148
|
+
|
|
2149
|
+
/**
|
|
2150
|
+
* The property to split by. Required for CALL_PROPERTY and METRIC_PROPERTY.
|
|
2151
|
+
*/
|
|
2152
|
+
property?: string;
|
|
2153
|
+
}
|
|
2154
|
+
|
|
2155
|
+
export interface Filter {
|
|
2156
|
+
/**
|
|
2157
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
2158
|
+
*/
|
|
2159
|
+
type:
|
|
2160
|
+
| 'METRIC_PROPERTY'
|
|
2161
|
+
| 'CALL_PROPERTY'
|
|
2162
|
+
| 'AGENT_PROPERTY'
|
|
2163
|
+
| 'CALL_ID'
|
|
2164
|
+
| 'MODALITY'
|
|
2165
|
+
| 'DATASET'
|
|
2166
|
+
| 'METRIC_VALUE';
|
|
2167
|
+
|
|
2168
|
+
/**
|
|
2169
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
2170
|
+
*/
|
|
2171
|
+
value: string | number | boolean;
|
|
2172
|
+
|
|
2173
|
+
/**
|
|
2174
|
+
* Defaults to EQUALS.
|
|
2175
|
+
*/
|
|
2176
|
+
operator?:
|
|
2177
|
+
| 'EQUALS'
|
|
2178
|
+
| 'NOT_EQUALS'
|
|
2179
|
+
| 'GREATER_THAN'
|
|
2180
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
2181
|
+
| 'LESS_THAN'
|
|
2182
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
2183
|
+
| 'CONTAINS'
|
|
2184
|
+
| 'STARTS_WITH';
|
|
2185
|
+
|
|
2186
|
+
/**
|
|
2187
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
2188
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
2189
|
+
*/
|
|
2190
|
+
property?: string;
|
|
2191
|
+
}
|
|
2192
|
+
}
|
|
2193
|
+
|
|
2194
|
+
export interface ComparisonGroup {
|
|
2195
|
+
filters: Array<ComparisonGroup.Filter>;
|
|
2196
|
+
|
|
2197
|
+
/**
|
|
2198
|
+
* The series label; unique within the query.
|
|
2199
|
+
*/
|
|
2200
|
+
name: string;
|
|
2201
|
+
|
|
2202
|
+
color?:
|
|
2203
|
+
| 'GREEN'
|
|
2204
|
+
| 'RED'
|
|
2205
|
+
| 'ORANGE'
|
|
2206
|
+
| 'PURPLE'
|
|
2207
|
+
| 'GREY'
|
|
2208
|
+
| 'BLUE'
|
|
2209
|
+
| 'PEACH'
|
|
2210
|
+
| 'TEAL'
|
|
2211
|
+
| 'INDIGO'
|
|
2212
|
+
| 'AMBER'
|
|
2213
|
+
| 'ROSE'
|
|
2214
|
+
| 'CYAN';
|
|
2215
|
+
}
|
|
2216
|
+
|
|
2217
|
+
export namespace ComparisonGroup {
|
|
2218
|
+
export interface Filter {
|
|
2219
|
+
/**
|
|
2220
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
2221
|
+
*/
|
|
2222
|
+
type:
|
|
2223
|
+
| 'METRIC_PROPERTY'
|
|
2224
|
+
| 'CALL_PROPERTY'
|
|
2225
|
+
| 'AGENT_PROPERTY'
|
|
2226
|
+
| 'CALL_ID'
|
|
2227
|
+
| 'MODALITY'
|
|
2228
|
+
| 'DATASET'
|
|
2229
|
+
| 'METRIC_VALUE';
|
|
2230
|
+
|
|
2231
|
+
/**
|
|
2232
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
2233
|
+
*/
|
|
2234
|
+
value: string | number | boolean;
|
|
2235
|
+
|
|
2236
|
+
/**
|
|
2237
|
+
* Defaults to EQUALS.
|
|
2238
|
+
*/
|
|
2239
|
+
operator?:
|
|
2240
|
+
| 'EQUALS'
|
|
2241
|
+
| 'NOT_EQUALS'
|
|
2242
|
+
| 'GREATER_THAN'
|
|
2243
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
2244
|
+
| 'LESS_THAN'
|
|
2245
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
2246
|
+
| 'CONTAINS'
|
|
2247
|
+
| 'STARTS_WITH';
|
|
2248
|
+
|
|
2249
|
+
/**
|
|
2250
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
2251
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
2252
|
+
*/
|
|
2253
|
+
property?: string;
|
|
2254
|
+
}
|
|
2255
|
+
}
|
|
2256
|
+
|
|
2257
|
+
export interface Filter {
|
|
2258
|
+
/**
|
|
2259
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
2260
|
+
*/
|
|
2261
|
+
type:
|
|
2262
|
+
| 'METRIC_PROPERTY'
|
|
2263
|
+
| 'CALL_PROPERTY'
|
|
2264
|
+
| 'AGENT_PROPERTY'
|
|
2265
|
+
| 'CALL_ID'
|
|
2266
|
+
| 'MODALITY'
|
|
2267
|
+
| 'DATASET'
|
|
2268
|
+
| 'METRIC_VALUE';
|
|
2269
|
+
|
|
2270
|
+
/**
|
|
2271
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
2272
|
+
*/
|
|
2273
|
+
value: string | number | boolean;
|
|
2274
|
+
|
|
2275
|
+
/**
|
|
2276
|
+
* Defaults to EQUALS.
|
|
2277
|
+
*/
|
|
2278
|
+
operator?:
|
|
2279
|
+
| 'EQUALS'
|
|
2280
|
+
| 'NOT_EQUALS'
|
|
2281
|
+
| 'GREATER_THAN'
|
|
2282
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
2283
|
+
| 'LESS_THAN'
|
|
2284
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
2285
|
+
| 'CONTAINS'
|
|
2286
|
+
| 'STARTS_WITH';
|
|
2287
|
+
|
|
2288
|
+
/**
|
|
2289
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
2290
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
2291
|
+
*/
|
|
2292
|
+
property?: string;
|
|
2293
|
+
}
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
export interface DashboardCreateParams {
|
|
2298
|
+
name: string;
|
|
2299
|
+
|
|
2300
|
+
description?: string;
|
|
2301
|
+
|
|
2302
|
+
filters?: Array<DashboardCreateParams.Filter>;
|
|
2303
|
+
|
|
2304
|
+
isDefault?: boolean;
|
|
2305
|
+
|
|
2306
|
+
/**
|
|
2307
|
+
* The window: LAST n DAYS/WEEKS/MONTHS up to now, a CALENDAR_ALIGNED period
|
|
2308
|
+
* (TODAY, YESTERDAY, THIS_WEEK, LAST_WEEK, THIS_MONTH, LAST_MONTH, THIS_YEAR,
|
|
2309
|
+
* LAST_YEAR), FIXED from/to, or SINCE a date. At most 731 days (two years).
|
|
2310
|
+
*/
|
|
2311
|
+
timeRange?:
|
|
2312
|
+
| DashboardCreateParams.UnionMember0
|
|
2313
|
+
| DashboardCreateParams.UnionMember1
|
|
2314
|
+
| DashboardCreateParams.UnionMember2
|
|
2315
|
+
| DashboardCreateParams.UnionMember3;
|
|
2316
|
+
|
|
2317
|
+
widgets?: Array<DashboardCreateParams.Widget>;
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
export namespace DashboardCreateParams {
|
|
2321
|
+
export interface Filter {
|
|
2322
|
+
/**
|
|
2323
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
2324
|
+
*/
|
|
2325
|
+
type:
|
|
2326
|
+
| 'METRIC_PROPERTY'
|
|
2327
|
+
| 'CALL_PROPERTY'
|
|
2328
|
+
| 'AGENT_PROPERTY'
|
|
2329
|
+
| 'CALL_ID'
|
|
2330
|
+
| 'MODALITY'
|
|
2331
|
+
| 'DATASET'
|
|
2332
|
+
| 'METRIC_VALUE';
|
|
2333
|
+
|
|
2334
|
+
/**
|
|
2335
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
2336
|
+
*/
|
|
2337
|
+
value: string | number | boolean;
|
|
2338
|
+
|
|
2339
|
+
/**
|
|
2340
|
+
* Defaults to EQUALS.
|
|
2341
|
+
*/
|
|
2342
|
+
operator?:
|
|
2343
|
+
| 'EQUALS'
|
|
2344
|
+
| 'NOT_EQUALS'
|
|
2345
|
+
| 'GREATER_THAN'
|
|
2346
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
2347
|
+
| 'LESS_THAN'
|
|
2348
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
2349
|
+
| 'CONTAINS'
|
|
2350
|
+
| 'STARTS_WITH';
|
|
2351
|
+
|
|
2352
|
+
/**
|
|
2353
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
2354
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
2355
|
+
*/
|
|
2356
|
+
property?: string;
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2359
|
+
export interface UnionMember0 {
|
|
2360
|
+
type: 'LAST';
|
|
2361
|
+
|
|
2362
|
+
unit: 'DAYS' | 'WEEKS' | 'MONTHS';
|
|
2363
|
+
|
|
2364
|
+
value: number;
|
|
2365
|
+
}
|
|
2366
|
+
|
|
2367
|
+
export interface UnionMember1 {
|
|
2368
|
+
period:
|
|
2369
|
+
| 'TODAY'
|
|
2370
|
+
| 'YESTERDAY'
|
|
2371
|
+
| 'THIS_WEEK'
|
|
2372
|
+
| 'LAST_WEEK'
|
|
2373
|
+
| 'THIS_MONTH'
|
|
2374
|
+
| 'LAST_MONTH'
|
|
2375
|
+
| 'THIS_YEAR'
|
|
2376
|
+
| 'LAST_YEAR';
|
|
2377
|
+
|
|
2378
|
+
type: 'CALENDAR_ALIGNED';
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2381
|
+
export interface UnionMember2 {
|
|
2382
|
+
from: string;
|
|
2383
|
+
|
|
2384
|
+
to: string;
|
|
2385
|
+
|
|
2386
|
+
type: 'FIXED';
|
|
2387
|
+
}
|
|
2388
|
+
|
|
2389
|
+
export interface UnionMember3 {
|
|
2390
|
+
from: string;
|
|
2391
|
+
|
|
2392
|
+
type: 'SINCE';
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2395
|
+
export interface Widget {
|
|
2396
|
+
/**
|
|
2397
|
+
* What to aggregate: 1 to 10 measures.
|
|
2398
|
+
*/
|
|
2399
|
+
measures: Array<Widget.Measure>;
|
|
2400
|
+
|
|
2401
|
+
/**
|
|
2402
|
+
* Unique on the dashboard: how the widget is matched on update.
|
|
2403
|
+
*/
|
|
2404
|
+
name: string;
|
|
2405
|
+
|
|
2406
|
+
/**
|
|
2407
|
+
* Run every measure once per named filter set, e.g. one group per agent.
|
|
2408
|
+
*/
|
|
2409
|
+
comparisonGroups?: Array<Widget.ComparisonGroup>;
|
|
2410
|
+
|
|
2411
|
+
/**
|
|
2412
|
+
* PREVIOUS_PERIOD adds the preceding window of the same length to every series.
|
|
2413
|
+
*/
|
|
2414
|
+
comparisonMode?: 'NONE' | 'PREVIOUS_PERIOD';
|
|
2415
|
+
|
|
2416
|
+
description?: string;
|
|
2417
|
+
|
|
2418
|
+
/**
|
|
2419
|
+
* Chart type. Defaults to LINE.
|
|
2420
|
+
*/
|
|
2421
|
+
display?: 'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE';
|
|
2422
|
+
|
|
2423
|
+
/**
|
|
2424
|
+
* Applied to every measure, on top of each measure's own filters.
|
|
2425
|
+
*/
|
|
2426
|
+
filters?: Array<Widget.Filter>;
|
|
2427
|
+
|
|
2428
|
+
/**
|
|
2429
|
+
* Bucket size. Defaults from the window's length and steps coarser when the window
|
|
2430
|
+
* would exceed 500 buckets.
|
|
2431
|
+
*/
|
|
2432
|
+
interval?: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
|
|
2433
|
+
|
|
2434
|
+
/**
|
|
2435
|
+
* Grid width. Defaults to MEDIUM.
|
|
2436
|
+
*/
|
|
2437
|
+
size?: 'SMALL' | 'MEDIUM' | 'LARGE' | 'EXTRA_LARGE';
|
|
2438
|
+
}
|
|
2439
|
+
|
|
2440
|
+
export namespace Widget {
|
|
2441
|
+
export interface Measure {
|
|
2442
|
+
/**
|
|
2443
|
+
* Defaults by output type: AVG for numeric metrics, COUNT (split by value) for
|
|
2444
|
+
* classification and text, PASS_RATE for thresholds and uptime, COUNT for
|
|
2445
|
+
* conversations.
|
|
2446
|
+
*/
|
|
2447
|
+
aggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
|
|
2448
|
+
|
|
2449
|
+
/**
|
|
2450
|
+
* Split the measure into one series per value of this dimension (the largest 50
|
|
2451
|
+
* are returned). Ignored while comparisonGroups are set: each group is then one
|
|
2452
|
+
* series.
|
|
2453
|
+
*/
|
|
2454
|
+
breakdown?: Measure.Breakdown;
|
|
2455
|
+
|
|
2456
|
+
/**
|
|
2457
|
+
* Chart color on a dashboard.
|
|
2458
|
+
*/
|
|
2459
|
+
color?:
|
|
2460
|
+
| 'GREEN'
|
|
2461
|
+
| 'RED'
|
|
2462
|
+
| 'ORANGE'
|
|
2463
|
+
| 'PURPLE'
|
|
2464
|
+
| 'GREY'
|
|
2465
|
+
| 'BLUE'
|
|
2466
|
+
| 'PEACH'
|
|
2467
|
+
| 'TEAL'
|
|
2468
|
+
| 'INDIGO'
|
|
2469
|
+
| 'AMBER'
|
|
2470
|
+
| 'ROSE'
|
|
2471
|
+
| 'CYAN';
|
|
2472
|
+
|
|
2473
|
+
/**
|
|
2474
|
+
* CALL (default for metrics) folds each conversation to one value first, so a long
|
|
2475
|
+
* call does not outweigh a short one. NONE aggregates every value.
|
|
2476
|
+
*/
|
|
2477
|
+
distinctBy?: 'NONE' | 'CALL';
|
|
2478
|
+
|
|
2479
|
+
/**
|
|
2480
|
+
* Filters for this measure only, on top of the query's filters.
|
|
2481
|
+
*/
|
|
2482
|
+
filters?: Array<Measure.Filter>;
|
|
2483
|
+
|
|
2484
|
+
/**
|
|
2485
|
+
* Mark one measure as the baseline: every series also reports its value as a
|
|
2486
|
+
* percentage of it.
|
|
2487
|
+
*/
|
|
2488
|
+
isBaseline?: boolean;
|
|
2489
|
+
|
|
2490
|
+
/**
|
|
2491
|
+
* The metric's slug (e.g. `task_completion`) or id. Required for METRIC.
|
|
2492
|
+
*/
|
|
2493
|
+
metric?: string;
|
|
2494
|
+
|
|
2495
|
+
/**
|
|
2496
|
+
* How each conversation is folded when distinctBy is CALL. Defaults to SUM under
|
|
2497
|
+
* SUM, else AVG.
|
|
2498
|
+
*/
|
|
2499
|
+
nestedAggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
|
|
2500
|
+
|
|
2501
|
+
nestedAggregationPercentile?: number;
|
|
2502
|
+
|
|
2503
|
+
/**
|
|
2504
|
+
* PASS_RATE condition operator. Omit for a threshold metric: its own condition is
|
|
2505
|
+
* used.
|
|
2506
|
+
*/
|
|
2507
|
+
passOperator?:
|
|
2508
|
+
| 'EQUALS'
|
|
2509
|
+
| 'NOT_EQUALS'
|
|
2510
|
+
| 'GREATER_THAN'
|
|
2511
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
2512
|
+
| 'LESS_THAN'
|
|
2513
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
2514
|
+
| 'CONTAINS'
|
|
2515
|
+
| 'STARTS_WITH';
|
|
2516
|
+
|
|
2517
|
+
/**
|
|
2518
|
+
* PASS_RATE condition value, e.g. 4 or "resolved".
|
|
2519
|
+
*/
|
|
2520
|
+
passValue?: string | number | boolean;
|
|
2521
|
+
|
|
2522
|
+
/**
|
|
2523
|
+
* Required with PERCENTILE, e.g. 95.
|
|
2524
|
+
*/
|
|
2525
|
+
percentile?: number;
|
|
2526
|
+
|
|
2527
|
+
/**
|
|
2528
|
+
* METRIC (default): a metric's values. CONVERSATION: conversation counts. UPTIME:
|
|
2529
|
+
* health-check outcomes.
|
|
2530
|
+
*/
|
|
2531
|
+
type?: 'METRIC' | 'CONVERSATION' | 'UPTIME';
|
|
2532
|
+
}
|
|
2533
|
+
|
|
2534
|
+
export namespace Measure {
|
|
2535
|
+
/**
|
|
2536
|
+
* Split the measure into one series per value of this dimension (the largest 50
|
|
2537
|
+
* are returned). Ignored while comparisonGroups are set: each group is then one
|
|
2538
|
+
* series.
|
|
2539
|
+
*/
|
|
2540
|
+
export interface Breakdown {
|
|
2541
|
+
type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'DATASET';
|
|
2542
|
+
|
|
2543
|
+
/**
|
|
2544
|
+
* The property to split by. Required for CALL_PROPERTY and METRIC_PROPERTY.
|
|
2545
|
+
*/
|
|
2546
|
+
property?: string;
|
|
2547
|
+
}
|
|
2548
|
+
|
|
2549
|
+
export interface Filter {
|
|
2550
|
+
/**
|
|
2551
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
2552
|
+
*/
|
|
2553
|
+
type:
|
|
2554
|
+
| 'METRIC_PROPERTY'
|
|
2555
|
+
| 'CALL_PROPERTY'
|
|
2556
|
+
| 'AGENT_PROPERTY'
|
|
2557
|
+
| 'CALL_ID'
|
|
2558
|
+
| 'MODALITY'
|
|
2559
|
+
| 'DATASET'
|
|
2560
|
+
| 'METRIC_VALUE';
|
|
2561
|
+
|
|
2562
|
+
/**
|
|
2563
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
2564
|
+
*/
|
|
2565
|
+
value: string | number | boolean;
|
|
2566
|
+
|
|
2567
|
+
/**
|
|
2568
|
+
* Defaults to EQUALS.
|
|
2569
|
+
*/
|
|
2570
|
+
operator?:
|
|
2571
|
+
| 'EQUALS'
|
|
2572
|
+
| 'NOT_EQUALS'
|
|
2573
|
+
| 'GREATER_THAN'
|
|
2574
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
2575
|
+
| 'LESS_THAN'
|
|
2576
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
2577
|
+
| 'CONTAINS'
|
|
2578
|
+
| 'STARTS_WITH';
|
|
2579
|
+
|
|
2580
|
+
/**
|
|
2581
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
2582
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
2583
|
+
*/
|
|
2584
|
+
property?: string;
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2587
|
+
|
|
2588
|
+
export interface ComparisonGroup {
|
|
2589
|
+
filters: Array<ComparisonGroup.Filter>;
|
|
2590
|
+
|
|
2591
|
+
/**
|
|
2592
|
+
* The series label; unique within the query.
|
|
2593
|
+
*/
|
|
2594
|
+
name: string;
|
|
2595
|
+
|
|
2596
|
+
color?:
|
|
2597
|
+
| 'GREEN'
|
|
2598
|
+
| 'RED'
|
|
2599
|
+
| 'ORANGE'
|
|
2600
|
+
| 'PURPLE'
|
|
2601
|
+
| 'GREY'
|
|
2602
|
+
| 'BLUE'
|
|
2603
|
+
| 'PEACH'
|
|
2604
|
+
| 'TEAL'
|
|
2605
|
+
| 'INDIGO'
|
|
2606
|
+
| 'AMBER'
|
|
2607
|
+
| 'ROSE'
|
|
2608
|
+
| 'CYAN';
|
|
2609
|
+
}
|
|
2610
|
+
|
|
2611
|
+
export namespace ComparisonGroup {
|
|
2612
|
+
export interface Filter {
|
|
2613
|
+
/**
|
|
2614
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
2615
|
+
*/
|
|
2616
|
+
type:
|
|
2617
|
+
| 'METRIC_PROPERTY'
|
|
2618
|
+
| 'CALL_PROPERTY'
|
|
2619
|
+
| 'AGENT_PROPERTY'
|
|
2620
|
+
| 'CALL_ID'
|
|
2621
|
+
| 'MODALITY'
|
|
2622
|
+
| 'DATASET'
|
|
2623
|
+
| 'METRIC_VALUE';
|
|
2624
|
+
|
|
2625
|
+
/**
|
|
2626
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
2627
|
+
*/
|
|
2628
|
+
value: string | number | boolean;
|
|
2629
|
+
|
|
2630
|
+
/**
|
|
2631
|
+
* Defaults to EQUALS.
|
|
2632
|
+
*/
|
|
2633
|
+
operator?:
|
|
2634
|
+
| 'EQUALS'
|
|
2635
|
+
| 'NOT_EQUALS'
|
|
2636
|
+
| 'GREATER_THAN'
|
|
2637
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
2638
|
+
| 'LESS_THAN'
|
|
2639
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
2640
|
+
| 'CONTAINS'
|
|
2641
|
+
| 'STARTS_WITH';
|
|
2642
|
+
|
|
2643
|
+
/**
|
|
2644
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
2645
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
2646
|
+
*/
|
|
2647
|
+
property?: string;
|
|
2648
|
+
}
|
|
2649
|
+
}
|
|
2650
|
+
|
|
2651
|
+
export interface Filter {
|
|
2652
|
+
/**
|
|
2653
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
2654
|
+
*/
|
|
2655
|
+
type:
|
|
2656
|
+
| 'METRIC_PROPERTY'
|
|
2657
|
+
| 'CALL_PROPERTY'
|
|
2658
|
+
| 'AGENT_PROPERTY'
|
|
2659
|
+
| 'CALL_ID'
|
|
2660
|
+
| 'MODALITY'
|
|
2661
|
+
| 'DATASET'
|
|
2662
|
+
| 'METRIC_VALUE';
|
|
2663
|
+
|
|
2664
|
+
/**
|
|
2665
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
2666
|
+
*/
|
|
2667
|
+
value: string | number | boolean;
|
|
2668
|
+
|
|
2669
|
+
/**
|
|
2670
|
+
* Defaults to EQUALS.
|
|
2671
|
+
*/
|
|
2672
|
+
operator?:
|
|
2673
|
+
| 'EQUALS'
|
|
2674
|
+
| 'NOT_EQUALS'
|
|
2675
|
+
| 'GREATER_THAN'
|
|
2676
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
2677
|
+
| 'LESS_THAN'
|
|
2678
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
2679
|
+
| 'CONTAINS'
|
|
2680
|
+
| 'STARTS_WITH';
|
|
2681
|
+
|
|
2682
|
+
/**
|
|
2683
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
2684
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
2685
|
+
*/
|
|
2686
|
+
property?: string;
|
|
2687
|
+
}
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
|
|
2691
|
+
export interface DashboardUpdateParams {
|
|
2692
|
+
description?: string;
|
|
2693
|
+
|
|
2694
|
+
filters?: Array<DashboardUpdateParams.Filter>;
|
|
2695
|
+
|
|
2696
|
+
isDefault?: boolean;
|
|
2697
|
+
|
|
2698
|
+
name?: string;
|
|
2699
|
+
|
|
2700
|
+
/**
|
|
2701
|
+
* The window: LAST n DAYS/WEEKS/MONTHS up to now, a CALENDAR_ALIGNED period
|
|
2702
|
+
* (TODAY, YESTERDAY, THIS_WEEK, LAST_WEEK, THIS_MONTH, LAST_MONTH, THIS_YEAR,
|
|
2703
|
+
* LAST_YEAR), FIXED from/to, or SINCE a date. At most 731 days (two years).
|
|
2704
|
+
*/
|
|
2705
|
+
timeRange?:
|
|
2706
|
+
| DashboardUpdateParams.UnionMember0
|
|
2707
|
+
| DashboardUpdateParams.UnionMember1
|
|
2708
|
+
| DashboardUpdateParams.UnionMember2
|
|
2709
|
+
| DashboardUpdateParams.UnionMember3;
|
|
2710
|
+
|
|
2711
|
+
widgets?: Array<DashboardUpdateParams.Widget>;
|
|
2712
|
+
}
|
|
2713
|
+
|
|
2714
|
+
export namespace DashboardUpdateParams {
|
|
2715
|
+
export interface Filter {
|
|
2716
|
+
/**
|
|
2717
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
2718
|
+
*/
|
|
2719
|
+
type:
|
|
2720
|
+
| 'METRIC_PROPERTY'
|
|
2721
|
+
| 'CALL_PROPERTY'
|
|
2722
|
+
| 'AGENT_PROPERTY'
|
|
2723
|
+
| 'CALL_ID'
|
|
2724
|
+
| 'MODALITY'
|
|
2725
|
+
| 'DATASET'
|
|
2726
|
+
| 'METRIC_VALUE';
|
|
2727
|
+
|
|
2728
|
+
/**
|
|
2729
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
2730
|
+
*/
|
|
2731
|
+
value: string | number | boolean;
|
|
2732
|
+
|
|
2733
|
+
/**
|
|
2734
|
+
* Defaults to EQUALS.
|
|
2735
|
+
*/
|
|
2736
|
+
operator?:
|
|
2737
|
+
| 'EQUALS'
|
|
2738
|
+
| 'NOT_EQUALS'
|
|
2739
|
+
| 'GREATER_THAN'
|
|
2740
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
2741
|
+
| 'LESS_THAN'
|
|
2742
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
2743
|
+
| 'CONTAINS'
|
|
2744
|
+
| 'STARTS_WITH';
|
|
2745
|
+
|
|
2746
|
+
/**
|
|
2747
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
2748
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
2749
|
+
*/
|
|
2750
|
+
property?: string;
|
|
2751
|
+
}
|
|
2752
|
+
|
|
2753
|
+
export interface UnionMember0 {
|
|
2754
|
+
type: 'LAST';
|
|
2755
|
+
|
|
2756
|
+
unit: 'DAYS' | 'WEEKS' | 'MONTHS';
|
|
2757
|
+
|
|
2758
|
+
value: number;
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2761
|
+
export interface UnionMember1 {
|
|
2762
|
+
period:
|
|
2763
|
+
| 'TODAY'
|
|
2764
|
+
| 'YESTERDAY'
|
|
2765
|
+
| 'THIS_WEEK'
|
|
2766
|
+
| 'LAST_WEEK'
|
|
2767
|
+
| 'THIS_MONTH'
|
|
2768
|
+
| 'LAST_MONTH'
|
|
2769
|
+
| 'THIS_YEAR'
|
|
2770
|
+
| 'LAST_YEAR';
|
|
2771
|
+
|
|
2772
|
+
type: 'CALENDAR_ALIGNED';
|
|
2773
|
+
}
|
|
2774
|
+
|
|
2775
|
+
export interface UnionMember2 {
|
|
2776
|
+
from: string;
|
|
2777
|
+
|
|
2778
|
+
to: string;
|
|
2779
|
+
|
|
2780
|
+
type: 'FIXED';
|
|
2781
|
+
}
|
|
2782
|
+
|
|
2783
|
+
export interface UnionMember3 {
|
|
2784
|
+
from: string;
|
|
2785
|
+
|
|
2786
|
+
type: 'SINCE';
|
|
2787
|
+
}
|
|
2788
|
+
|
|
2789
|
+
export interface Widget {
|
|
2790
|
+
/**
|
|
2791
|
+
* What to aggregate: 1 to 10 measures.
|
|
2792
|
+
*/
|
|
2793
|
+
measures: Array<Widget.Measure>;
|
|
2794
|
+
|
|
2795
|
+
/**
|
|
2796
|
+
* Unique on the dashboard: how the widget is matched on update.
|
|
2797
|
+
*/
|
|
2798
|
+
name: string;
|
|
2799
|
+
|
|
2800
|
+
/**
|
|
2801
|
+
* Run every measure once per named filter set, e.g. one group per agent.
|
|
2802
|
+
*/
|
|
2803
|
+
comparisonGroups?: Array<Widget.ComparisonGroup>;
|
|
2804
|
+
|
|
2805
|
+
/**
|
|
2806
|
+
* PREVIOUS_PERIOD adds the preceding window of the same length to every series.
|
|
2807
|
+
*/
|
|
2808
|
+
comparisonMode?: 'NONE' | 'PREVIOUS_PERIOD';
|
|
2809
|
+
|
|
2810
|
+
description?: string;
|
|
2811
|
+
|
|
2812
|
+
/**
|
|
2813
|
+
* Chart type. Defaults to LINE.
|
|
2814
|
+
*/
|
|
2815
|
+
display?: 'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE';
|
|
2816
|
+
|
|
2817
|
+
/**
|
|
2818
|
+
* Applied to every measure, on top of each measure's own filters.
|
|
2819
|
+
*/
|
|
2820
|
+
filters?: Array<Widget.Filter>;
|
|
2821
|
+
|
|
2822
|
+
/**
|
|
2823
|
+
* Bucket size. Defaults from the window's length and steps coarser when the window
|
|
2824
|
+
* would exceed 500 buckets.
|
|
2825
|
+
*/
|
|
2826
|
+
interval?: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
|
|
2827
|
+
|
|
2828
|
+
/**
|
|
2829
|
+
* Grid width. Defaults to MEDIUM.
|
|
2830
|
+
*/
|
|
2831
|
+
size?: 'SMALL' | 'MEDIUM' | 'LARGE' | 'EXTRA_LARGE';
|
|
2832
|
+
}
|
|
2833
|
+
|
|
2834
|
+
export namespace Widget {
|
|
2835
|
+
export interface Measure {
|
|
2836
|
+
/**
|
|
2837
|
+
* Defaults by output type: AVG for numeric metrics, COUNT (split by value) for
|
|
2838
|
+
* classification and text, PASS_RATE for thresholds and uptime, COUNT for
|
|
2839
|
+
* conversations.
|
|
2840
|
+
*/
|
|
2841
|
+
aggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
|
|
2842
|
+
|
|
2843
|
+
/**
|
|
2844
|
+
* Split the measure into one series per value of this dimension (the largest 50
|
|
2845
|
+
* are returned). Ignored while comparisonGroups are set: each group is then one
|
|
2846
|
+
* series.
|
|
2847
|
+
*/
|
|
2848
|
+
breakdown?: Measure.Breakdown;
|
|
2849
|
+
|
|
2850
|
+
/**
|
|
2851
|
+
* Chart color on a dashboard.
|
|
2852
|
+
*/
|
|
2853
|
+
color?:
|
|
2854
|
+
| 'GREEN'
|
|
2855
|
+
| 'RED'
|
|
2856
|
+
| 'ORANGE'
|
|
2857
|
+
| 'PURPLE'
|
|
2858
|
+
| 'GREY'
|
|
2859
|
+
| 'BLUE'
|
|
2860
|
+
| 'PEACH'
|
|
2861
|
+
| 'TEAL'
|
|
2862
|
+
| 'INDIGO'
|
|
2863
|
+
| 'AMBER'
|
|
2864
|
+
| 'ROSE'
|
|
2865
|
+
| 'CYAN';
|
|
2866
|
+
|
|
2867
|
+
/**
|
|
2868
|
+
* CALL (default for metrics) folds each conversation to one value first, so a long
|
|
2869
|
+
* call does not outweigh a short one. NONE aggregates every value.
|
|
2870
|
+
*/
|
|
2871
|
+
distinctBy?: 'NONE' | 'CALL';
|
|
2872
|
+
|
|
2873
|
+
/**
|
|
2874
|
+
* Filters for this measure only, on top of the query's filters.
|
|
2875
|
+
*/
|
|
2876
|
+
filters?: Array<Measure.Filter>;
|
|
2877
|
+
|
|
2878
|
+
/**
|
|
2879
|
+
* Mark one measure as the baseline: every series also reports its value as a
|
|
2880
|
+
* percentage of it.
|
|
2881
|
+
*/
|
|
2882
|
+
isBaseline?: boolean;
|
|
2883
|
+
|
|
2884
|
+
/**
|
|
2885
|
+
* The metric's slug (e.g. `task_completion`) or id. Required for METRIC.
|
|
2886
|
+
*/
|
|
2887
|
+
metric?: string;
|
|
2888
|
+
|
|
2889
|
+
/**
|
|
2890
|
+
* How each conversation is folded when distinctBy is CALL. Defaults to SUM under
|
|
2891
|
+
* SUM, else AVG.
|
|
2892
|
+
*/
|
|
2893
|
+
nestedAggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
|
|
2894
|
+
|
|
2895
|
+
nestedAggregationPercentile?: number;
|
|
2896
|
+
|
|
2897
|
+
/**
|
|
2898
|
+
* PASS_RATE condition operator. Omit for a threshold metric: its own condition is
|
|
2899
|
+
* used.
|
|
2900
|
+
*/
|
|
2901
|
+
passOperator?:
|
|
2902
|
+
| 'EQUALS'
|
|
2903
|
+
| 'NOT_EQUALS'
|
|
2904
|
+
| 'GREATER_THAN'
|
|
2905
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
2906
|
+
| 'LESS_THAN'
|
|
2907
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
2908
|
+
| 'CONTAINS'
|
|
2909
|
+
| 'STARTS_WITH';
|
|
2910
|
+
|
|
2911
|
+
/**
|
|
2912
|
+
* PASS_RATE condition value, e.g. 4 or "resolved".
|
|
2913
|
+
*/
|
|
2914
|
+
passValue?: string | number | boolean;
|
|
2915
|
+
|
|
2916
|
+
/**
|
|
2917
|
+
* Required with PERCENTILE, e.g. 95.
|
|
2918
|
+
*/
|
|
2919
|
+
percentile?: number;
|
|
2920
|
+
|
|
2921
|
+
/**
|
|
2922
|
+
* METRIC (default): a metric's values. CONVERSATION: conversation counts. UPTIME:
|
|
2923
|
+
* health-check outcomes.
|
|
2924
|
+
*/
|
|
2925
|
+
type?: 'METRIC' | 'CONVERSATION' | 'UPTIME';
|
|
2926
|
+
}
|
|
2927
|
+
|
|
2928
|
+
export namespace Measure {
|
|
2929
|
+
/**
|
|
2930
|
+
* Split the measure into one series per value of this dimension (the largest 50
|
|
2931
|
+
* are returned). Ignored while comparisonGroups are set: each group is then one
|
|
2932
|
+
* series.
|
|
2933
|
+
*/
|
|
2934
|
+
export interface Breakdown {
|
|
2935
|
+
type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'DATASET';
|
|
2936
|
+
|
|
2937
|
+
/**
|
|
2938
|
+
* The property to split by. Required for CALL_PROPERTY and METRIC_PROPERTY.
|
|
2939
|
+
*/
|
|
2940
|
+
property?: string;
|
|
2941
|
+
}
|
|
2942
|
+
|
|
2943
|
+
export interface Filter {
|
|
2944
|
+
/**
|
|
2945
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
2946
|
+
*/
|
|
2947
|
+
type:
|
|
2948
|
+
| 'METRIC_PROPERTY'
|
|
2949
|
+
| 'CALL_PROPERTY'
|
|
2950
|
+
| 'AGENT_PROPERTY'
|
|
2951
|
+
| 'CALL_ID'
|
|
2952
|
+
| 'MODALITY'
|
|
2953
|
+
| 'DATASET'
|
|
2954
|
+
| 'METRIC_VALUE';
|
|
2955
|
+
|
|
2956
|
+
/**
|
|
2957
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
2958
|
+
*/
|
|
2959
|
+
value: string | number | boolean;
|
|
2960
|
+
|
|
2961
|
+
/**
|
|
2962
|
+
* Defaults to EQUALS.
|
|
2963
|
+
*/
|
|
2964
|
+
operator?:
|
|
2965
|
+
| 'EQUALS'
|
|
2966
|
+
| 'NOT_EQUALS'
|
|
2967
|
+
| 'GREATER_THAN'
|
|
2968
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
2969
|
+
| 'LESS_THAN'
|
|
2970
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
2971
|
+
| 'CONTAINS'
|
|
2972
|
+
| 'STARTS_WITH';
|
|
2973
|
+
|
|
2974
|
+
/**
|
|
2975
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
2976
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
2977
|
+
*/
|
|
2978
|
+
property?: string;
|
|
2979
|
+
}
|
|
2980
|
+
}
|
|
2981
|
+
|
|
2982
|
+
export interface ComparisonGroup {
|
|
2983
|
+
filters: Array<ComparisonGroup.Filter>;
|
|
2984
|
+
|
|
2985
|
+
/**
|
|
2986
|
+
* The series label; unique within the query.
|
|
2987
|
+
*/
|
|
2988
|
+
name: string;
|
|
2989
|
+
|
|
2990
|
+
color?:
|
|
2991
|
+
| 'GREEN'
|
|
2992
|
+
| 'RED'
|
|
2993
|
+
| 'ORANGE'
|
|
2994
|
+
| 'PURPLE'
|
|
2995
|
+
| 'GREY'
|
|
2996
|
+
| 'BLUE'
|
|
2997
|
+
| 'PEACH'
|
|
2998
|
+
| 'TEAL'
|
|
2999
|
+
| 'INDIGO'
|
|
3000
|
+
| 'AMBER'
|
|
3001
|
+
| 'ROSE'
|
|
3002
|
+
| 'CYAN';
|
|
3003
|
+
}
|
|
3004
|
+
|
|
3005
|
+
export namespace ComparisonGroup {
|
|
3006
|
+
export interface Filter {
|
|
3007
|
+
/**
|
|
3008
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
3009
|
+
*/
|
|
3010
|
+
type:
|
|
3011
|
+
| 'METRIC_PROPERTY'
|
|
3012
|
+
| 'CALL_PROPERTY'
|
|
3013
|
+
| 'AGENT_PROPERTY'
|
|
3014
|
+
| 'CALL_ID'
|
|
3015
|
+
| 'MODALITY'
|
|
3016
|
+
| 'DATASET'
|
|
3017
|
+
| 'METRIC_VALUE';
|
|
3018
|
+
|
|
3019
|
+
/**
|
|
3020
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
3021
|
+
*/
|
|
3022
|
+
value: string | number | boolean;
|
|
3023
|
+
|
|
3024
|
+
/**
|
|
3025
|
+
* Defaults to EQUALS.
|
|
3026
|
+
*/
|
|
3027
|
+
operator?:
|
|
3028
|
+
| 'EQUALS'
|
|
3029
|
+
| 'NOT_EQUALS'
|
|
3030
|
+
| 'GREATER_THAN'
|
|
3031
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
3032
|
+
| 'LESS_THAN'
|
|
3033
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
3034
|
+
| 'CONTAINS'
|
|
3035
|
+
| 'STARTS_WITH';
|
|
3036
|
+
|
|
3037
|
+
/**
|
|
3038
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
3039
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
3040
|
+
*/
|
|
3041
|
+
property?: string;
|
|
3042
|
+
}
|
|
3043
|
+
}
|
|
3044
|
+
|
|
3045
|
+
export interface Filter {
|
|
3046
|
+
/**
|
|
3047
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
3048
|
+
*/
|
|
3049
|
+
type:
|
|
3050
|
+
| 'METRIC_PROPERTY'
|
|
3051
|
+
| 'CALL_PROPERTY'
|
|
3052
|
+
| 'AGENT_PROPERTY'
|
|
3053
|
+
| 'CALL_ID'
|
|
3054
|
+
| 'MODALITY'
|
|
3055
|
+
| 'DATASET'
|
|
3056
|
+
| 'METRIC_VALUE';
|
|
3057
|
+
|
|
3058
|
+
/**
|
|
3059
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
3060
|
+
*/
|
|
3061
|
+
value: string | number | boolean;
|
|
3062
|
+
|
|
3063
|
+
/**
|
|
3064
|
+
* Defaults to EQUALS.
|
|
3065
|
+
*/
|
|
3066
|
+
operator?:
|
|
3067
|
+
| 'EQUALS'
|
|
3068
|
+
| 'NOT_EQUALS'
|
|
3069
|
+
| 'GREATER_THAN'
|
|
3070
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
3071
|
+
| 'LESS_THAN'
|
|
3072
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
3073
|
+
| 'CONTAINS'
|
|
3074
|
+
| 'STARTS_WITH';
|
|
3075
|
+
|
|
3076
|
+
/**
|
|
3077
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
3078
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
3079
|
+
*/
|
|
3080
|
+
property?: string;
|
|
3081
|
+
}
|
|
3082
|
+
}
|
|
3083
|
+
}
|
|
3084
|
+
|
|
3085
|
+
export interface DashboardCreateWidgetParams {
|
|
3086
|
+
/**
|
|
3087
|
+
* What to aggregate: 1 to 10 measures.
|
|
3088
|
+
*/
|
|
3089
|
+
measures: Array<DashboardCreateWidgetParams.Measure>;
|
|
3090
|
+
|
|
3091
|
+
/**
|
|
3092
|
+
* Unique on the dashboard: how the widget is matched on update.
|
|
3093
|
+
*/
|
|
3094
|
+
name: string;
|
|
3095
|
+
|
|
3096
|
+
/**
|
|
3097
|
+
* Run every measure once per named filter set, e.g. one group per agent.
|
|
3098
|
+
*/
|
|
3099
|
+
comparisonGroups?: Array<DashboardCreateWidgetParams.ComparisonGroup>;
|
|
3100
|
+
|
|
3101
|
+
/**
|
|
3102
|
+
* PREVIOUS_PERIOD adds the preceding window of the same length to every series.
|
|
3103
|
+
*/
|
|
3104
|
+
comparisonMode?: 'NONE' | 'PREVIOUS_PERIOD';
|
|
3105
|
+
|
|
3106
|
+
description?: string;
|
|
3107
|
+
|
|
3108
|
+
/**
|
|
3109
|
+
* Chart type. Defaults to LINE.
|
|
3110
|
+
*/
|
|
3111
|
+
display?: 'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE';
|
|
3112
|
+
|
|
3113
|
+
/**
|
|
3114
|
+
* Applied to every measure, on top of each measure's own filters.
|
|
3115
|
+
*/
|
|
3116
|
+
filters?: Array<DashboardCreateWidgetParams.Filter>;
|
|
3117
|
+
|
|
3118
|
+
/**
|
|
3119
|
+
* Bucket size. Defaults from the window's length and steps coarser when the window
|
|
3120
|
+
* would exceed 500 buckets.
|
|
3121
|
+
*/
|
|
3122
|
+
interval?: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
|
|
3123
|
+
|
|
3124
|
+
/**
|
|
3125
|
+
* Grid width. Defaults to MEDIUM.
|
|
3126
|
+
*/
|
|
3127
|
+
size?: 'SMALL' | 'MEDIUM' | 'LARGE' | 'EXTRA_LARGE';
|
|
3128
|
+
}
|
|
3129
|
+
|
|
3130
|
+
export namespace DashboardCreateWidgetParams {
|
|
3131
|
+
export interface Measure {
|
|
3132
|
+
/**
|
|
3133
|
+
* Defaults by output type: AVG for numeric metrics, COUNT (split by value) for
|
|
3134
|
+
* classification and text, PASS_RATE for thresholds and uptime, COUNT for
|
|
3135
|
+
* conversations.
|
|
3136
|
+
*/
|
|
3137
|
+
aggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
|
|
3138
|
+
|
|
3139
|
+
/**
|
|
3140
|
+
* Split the measure into one series per value of this dimension (the largest 50
|
|
3141
|
+
* are returned). Ignored while comparisonGroups are set: each group is then one
|
|
3142
|
+
* series.
|
|
3143
|
+
*/
|
|
3144
|
+
breakdown?: Measure.Breakdown;
|
|
3145
|
+
|
|
3146
|
+
/**
|
|
3147
|
+
* Chart color on a dashboard.
|
|
3148
|
+
*/
|
|
3149
|
+
color?:
|
|
3150
|
+
| 'GREEN'
|
|
3151
|
+
| 'RED'
|
|
3152
|
+
| 'ORANGE'
|
|
3153
|
+
| 'PURPLE'
|
|
3154
|
+
| 'GREY'
|
|
3155
|
+
| 'BLUE'
|
|
3156
|
+
| 'PEACH'
|
|
3157
|
+
| 'TEAL'
|
|
3158
|
+
| 'INDIGO'
|
|
3159
|
+
| 'AMBER'
|
|
3160
|
+
| 'ROSE'
|
|
3161
|
+
| 'CYAN';
|
|
3162
|
+
|
|
3163
|
+
/**
|
|
3164
|
+
* CALL (default for metrics) folds each conversation to one value first, so a long
|
|
3165
|
+
* call does not outweigh a short one. NONE aggregates every value.
|
|
3166
|
+
*/
|
|
3167
|
+
distinctBy?: 'NONE' | 'CALL';
|
|
3168
|
+
|
|
3169
|
+
/**
|
|
3170
|
+
* Filters for this measure only, on top of the query's filters.
|
|
3171
|
+
*/
|
|
3172
|
+
filters?: Array<Measure.Filter>;
|
|
3173
|
+
|
|
3174
|
+
/**
|
|
3175
|
+
* Mark one measure as the baseline: every series also reports its value as a
|
|
3176
|
+
* percentage of it.
|
|
3177
|
+
*/
|
|
3178
|
+
isBaseline?: boolean;
|
|
3179
|
+
|
|
3180
|
+
/**
|
|
3181
|
+
* The metric's slug (e.g. `task_completion`) or id. Required for METRIC.
|
|
3182
|
+
*/
|
|
3183
|
+
metric?: string;
|
|
3184
|
+
|
|
3185
|
+
/**
|
|
3186
|
+
* How each conversation is folded when distinctBy is CALL. Defaults to SUM under
|
|
3187
|
+
* SUM, else AVG.
|
|
3188
|
+
*/
|
|
3189
|
+
nestedAggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
|
|
3190
|
+
|
|
3191
|
+
nestedAggregationPercentile?: number;
|
|
3192
|
+
|
|
3193
|
+
/**
|
|
3194
|
+
* PASS_RATE condition operator. Omit for a threshold metric: its own condition is
|
|
3195
|
+
* used.
|
|
3196
|
+
*/
|
|
3197
|
+
passOperator?:
|
|
3198
|
+
| 'EQUALS'
|
|
3199
|
+
| 'NOT_EQUALS'
|
|
3200
|
+
| 'GREATER_THAN'
|
|
3201
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
3202
|
+
| 'LESS_THAN'
|
|
3203
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
3204
|
+
| 'CONTAINS'
|
|
3205
|
+
| 'STARTS_WITH';
|
|
3206
|
+
|
|
3207
|
+
/**
|
|
3208
|
+
* PASS_RATE condition value, e.g. 4 or "resolved".
|
|
3209
|
+
*/
|
|
3210
|
+
passValue?: string | number | boolean;
|
|
3211
|
+
|
|
3212
|
+
/**
|
|
3213
|
+
* Required with PERCENTILE, e.g. 95.
|
|
3214
|
+
*/
|
|
3215
|
+
percentile?: number;
|
|
3216
|
+
|
|
3217
|
+
/**
|
|
3218
|
+
* METRIC (default): a metric's values. CONVERSATION: conversation counts. UPTIME:
|
|
3219
|
+
* health-check outcomes.
|
|
3220
|
+
*/
|
|
3221
|
+
type?: 'METRIC' | 'CONVERSATION' | 'UPTIME';
|
|
3222
|
+
}
|
|
3223
|
+
|
|
3224
|
+
export namespace Measure {
|
|
3225
|
+
/**
|
|
3226
|
+
* Split the measure into one series per value of this dimension (the largest 50
|
|
3227
|
+
* are returned). Ignored while comparisonGroups are set: each group is then one
|
|
3228
|
+
* series.
|
|
3229
|
+
*/
|
|
3230
|
+
export interface Breakdown {
|
|
3231
|
+
type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'DATASET';
|
|
3232
|
+
|
|
3233
|
+
/**
|
|
3234
|
+
* The property to split by. Required for CALL_PROPERTY and METRIC_PROPERTY.
|
|
3235
|
+
*/
|
|
3236
|
+
property?: string;
|
|
3237
|
+
}
|
|
3238
|
+
|
|
3239
|
+
export interface Filter {
|
|
3240
|
+
/**
|
|
3241
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
3242
|
+
*/
|
|
3243
|
+
type:
|
|
3244
|
+
| 'METRIC_PROPERTY'
|
|
3245
|
+
| 'CALL_PROPERTY'
|
|
3246
|
+
| 'AGENT_PROPERTY'
|
|
3247
|
+
| 'CALL_ID'
|
|
3248
|
+
| 'MODALITY'
|
|
3249
|
+
| 'DATASET'
|
|
3250
|
+
| 'METRIC_VALUE';
|
|
3251
|
+
|
|
3252
|
+
/**
|
|
3253
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
3254
|
+
*/
|
|
3255
|
+
value: string | number | boolean;
|
|
3256
|
+
|
|
3257
|
+
/**
|
|
3258
|
+
* Defaults to EQUALS.
|
|
3259
|
+
*/
|
|
3260
|
+
operator?:
|
|
3261
|
+
| 'EQUALS'
|
|
3262
|
+
| 'NOT_EQUALS'
|
|
3263
|
+
| 'GREATER_THAN'
|
|
3264
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
3265
|
+
| 'LESS_THAN'
|
|
3266
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
3267
|
+
| 'CONTAINS'
|
|
3268
|
+
| 'STARTS_WITH';
|
|
3269
|
+
|
|
3270
|
+
/**
|
|
3271
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
3272
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
3273
|
+
*/
|
|
3274
|
+
property?: string;
|
|
3275
|
+
}
|
|
3276
|
+
}
|
|
3277
|
+
|
|
3278
|
+
export interface ComparisonGroup {
|
|
3279
|
+
filters: Array<ComparisonGroup.Filter>;
|
|
3280
|
+
|
|
3281
|
+
/**
|
|
3282
|
+
* The series label; unique within the query.
|
|
3283
|
+
*/
|
|
3284
|
+
name: string;
|
|
3285
|
+
|
|
3286
|
+
color?:
|
|
3287
|
+
| 'GREEN'
|
|
3288
|
+
| 'RED'
|
|
3289
|
+
| 'ORANGE'
|
|
3290
|
+
| 'PURPLE'
|
|
3291
|
+
| 'GREY'
|
|
3292
|
+
| 'BLUE'
|
|
3293
|
+
| 'PEACH'
|
|
3294
|
+
| 'TEAL'
|
|
3295
|
+
| 'INDIGO'
|
|
3296
|
+
| 'AMBER'
|
|
3297
|
+
| 'ROSE'
|
|
3298
|
+
| 'CYAN';
|
|
3299
|
+
}
|
|
3300
|
+
|
|
3301
|
+
export namespace ComparisonGroup {
|
|
3302
|
+
export interface Filter {
|
|
3303
|
+
/**
|
|
3304
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
3305
|
+
*/
|
|
3306
|
+
type:
|
|
3307
|
+
| 'METRIC_PROPERTY'
|
|
3308
|
+
| 'CALL_PROPERTY'
|
|
3309
|
+
| 'AGENT_PROPERTY'
|
|
3310
|
+
| 'CALL_ID'
|
|
3311
|
+
| 'MODALITY'
|
|
3312
|
+
| 'DATASET'
|
|
3313
|
+
| 'METRIC_VALUE';
|
|
3314
|
+
|
|
3315
|
+
/**
|
|
3316
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
3317
|
+
*/
|
|
3318
|
+
value: string | number | boolean;
|
|
3319
|
+
|
|
3320
|
+
/**
|
|
3321
|
+
* Defaults to EQUALS.
|
|
3322
|
+
*/
|
|
3323
|
+
operator?:
|
|
3324
|
+
| 'EQUALS'
|
|
3325
|
+
| 'NOT_EQUALS'
|
|
3326
|
+
| 'GREATER_THAN'
|
|
3327
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
3328
|
+
| 'LESS_THAN'
|
|
3329
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
3330
|
+
| 'CONTAINS'
|
|
3331
|
+
| 'STARTS_WITH';
|
|
3332
|
+
|
|
3333
|
+
/**
|
|
3334
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
3335
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
3336
|
+
*/
|
|
3337
|
+
property?: string;
|
|
3338
|
+
}
|
|
3339
|
+
}
|
|
3340
|
+
|
|
3341
|
+
export interface Filter {
|
|
3342
|
+
/**
|
|
3343
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
3344
|
+
*/
|
|
3345
|
+
type:
|
|
3346
|
+
| 'METRIC_PROPERTY'
|
|
3347
|
+
| 'CALL_PROPERTY'
|
|
3348
|
+
| 'AGENT_PROPERTY'
|
|
3349
|
+
| 'CALL_ID'
|
|
3350
|
+
| 'MODALITY'
|
|
3351
|
+
| 'DATASET'
|
|
3352
|
+
| 'METRIC_VALUE';
|
|
3353
|
+
|
|
3354
|
+
/**
|
|
3355
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
3356
|
+
*/
|
|
3357
|
+
value: string | number | boolean;
|
|
3358
|
+
|
|
3359
|
+
/**
|
|
3360
|
+
* Defaults to EQUALS.
|
|
3361
|
+
*/
|
|
3362
|
+
operator?:
|
|
3363
|
+
| 'EQUALS'
|
|
3364
|
+
| 'NOT_EQUALS'
|
|
3365
|
+
| 'GREATER_THAN'
|
|
3366
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
3367
|
+
| 'LESS_THAN'
|
|
3368
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
3369
|
+
| 'CONTAINS'
|
|
3370
|
+
| 'STARTS_WITH';
|
|
3371
|
+
|
|
3372
|
+
/**
|
|
3373
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
3374
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
3375
|
+
*/
|
|
3376
|
+
property?: string;
|
|
3377
|
+
}
|
|
3378
|
+
}
|
|
3379
|
+
|
|
3380
|
+
export interface DashboardDeleteWidgetParams {
|
|
3381
|
+
/**
|
|
3382
|
+
* The dashboard ID
|
|
3383
|
+
*/
|
|
3384
|
+
dashboardId: string;
|
|
3385
|
+
}
|
|
3386
|
+
|
|
3387
|
+
export interface DashboardGetDataParams {
|
|
3388
|
+
/**
|
|
3389
|
+
* ISO 8601 start. Overrides the saved window; without `to`, runs until now.
|
|
3390
|
+
*/
|
|
3391
|
+
from?: string;
|
|
3392
|
+
|
|
3393
|
+
/**
|
|
3394
|
+
* IANA zone buckets and calendar periods align to. Default UTC.
|
|
3395
|
+
*/
|
|
3396
|
+
timezone?: string;
|
|
3397
|
+
|
|
3398
|
+
/**
|
|
3399
|
+
* ISO 8601 end. Requires `from`.
|
|
3400
|
+
*/
|
|
3401
|
+
to?: string;
|
|
3402
|
+
}
|
|
3403
|
+
|
|
3404
|
+
export interface DashboardGetWidgetDataParams {
|
|
3405
|
+
/**
|
|
3406
|
+
* Path param
|
|
3407
|
+
*/
|
|
3408
|
+
dashboardId: string;
|
|
3409
|
+
|
|
3410
|
+
/**
|
|
3411
|
+
* Query param: ISO 8601 start. Overrides the saved window; without `to`, runs
|
|
3412
|
+
* until now.
|
|
3413
|
+
*/
|
|
3414
|
+
from?: string;
|
|
3415
|
+
|
|
3416
|
+
/**
|
|
3417
|
+
* Query param: IANA zone buckets and calendar periods align to. Default UTC.
|
|
3418
|
+
*/
|
|
3419
|
+
timezone?: string;
|
|
3420
|
+
|
|
3421
|
+
/**
|
|
3422
|
+
* Query param: ISO 8601 end. Requires `from`.
|
|
3423
|
+
*/
|
|
3424
|
+
to?: string;
|
|
3425
|
+
}
|
|
3426
|
+
|
|
3427
|
+
export interface DashboardUpdateWidgetParams {
|
|
3428
|
+
/**
|
|
3429
|
+
* Path param: The dashboard ID
|
|
3430
|
+
*/
|
|
3431
|
+
dashboardId: string;
|
|
3432
|
+
|
|
3433
|
+
/**
|
|
3434
|
+
* Body param: What to aggregate: 1 to 10 measures.
|
|
3435
|
+
*/
|
|
3436
|
+
measures: Array<DashboardUpdateWidgetParams.Measure>;
|
|
3437
|
+
|
|
3438
|
+
/**
|
|
3439
|
+
* Body param: Unique on the dashboard: how the widget is matched on update.
|
|
3440
|
+
*/
|
|
3441
|
+
name: string;
|
|
3442
|
+
|
|
3443
|
+
/**
|
|
3444
|
+
* Body param: Run every measure once per named filter set, e.g. one group per
|
|
3445
|
+
* agent.
|
|
3446
|
+
*/
|
|
3447
|
+
comparisonGroups?: Array<DashboardUpdateWidgetParams.ComparisonGroup>;
|
|
3448
|
+
|
|
3449
|
+
/**
|
|
3450
|
+
* Body param: PREVIOUS_PERIOD adds the preceding window of the same length to
|
|
3451
|
+
* every series.
|
|
3452
|
+
*/
|
|
3453
|
+
comparisonMode?: 'NONE' | 'PREVIOUS_PERIOD';
|
|
3454
|
+
|
|
3455
|
+
/**
|
|
3456
|
+
* Body param
|
|
3457
|
+
*/
|
|
3458
|
+
description?: string;
|
|
3459
|
+
|
|
3460
|
+
/**
|
|
3461
|
+
* Body param: Chart type. Defaults to LINE.
|
|
3462
|
+
*/
|
|
3463
|
+
display?: 'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE';
|
|
3464
|
+
|
|
3465
|
+
/**
|
|
3466
|
+
* Body param: Applied to every measure, on top of each measure's own filters.
|
|
3467
|
+
*/
|
|
3468
|
+
filters?: Array<DashboardUpdateWidgetParams.Filter>;
|
|
3469
|
+
|
|
3470
|
+
/**
|
|
3471
|
+
* Body param: Bucket size. Defaults from the window's length and steps coarser
|
|
3472
|
+
* when the window would exceed 500 buckets.
|
|
3473
|
+
*/
|
|
3474
|
+
interval?: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
|
|
3475
|
+
|
|
3476
|
+
/**
|
|
3477
|
+
* Body param: Grid width. Defaults to MEDIUM.
|
|
3478
|
+
*/
|
|
3479
|
+
size?: 'SMALL' | 'MEDIUM' | 'LARGE' | 'EXTRA_LARGE';
|
|
3480
|
+
}
|
|
3481
|
+
|
|
3482
|
+
export namespace DashboardUpdateWidgetParams {
|
|
3483
|
+
export interface Measure {
|
|
3484
|
+
/**
|
|
3485
|
+
* Defaults by output type: AVG for numeric metrics, COUNT (split by value) for
|
|
3486
|
+
* classification and text, PASS_RATE for thresholds and uptime, COUNT for
|
|
3487
|
+
* conversations.
|
|
3488
|
+
*/
|
|
3489
|
+
aggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
|
|
3490
|
+
|
|
3491
|
+
/**
|
|
3492
|
+
* Split the measure into one series per value of this dimension (the largest 50
|
|
3493
|
+
* are returned). Ignored while comparisonGroups are set: each group is then one
|
|
3494
|
+
* series.
|
|
3495
|
+
*/
|
|
3496
|
+
breakdown?: Measure.Breakdown;
|
|
3497
|
+
|
|
3498
|
+
/**
|
|
3499
|
+
* Chart color on a dashboard.
|
|
3500
|
+
*/
|
|
3501
|
+
color?:
|
|
3502
|
+
| 'GREEN'
|
|
3503
|
+
| 'RED'
|
|
3504
|
+
| 'ORANGE'
|
|
3505
|
+
| 'PURPLE'
|
|
3506
|
+
| 'GREY'
|
|
3507
|
+
| 'BLUE'
|
|
3508
|
+
| 'PEACH'
|
|
3509
|
+
| 'TEAL'
|
|
3510
|
+
| 'INDIGO'
|
|
3511
|
+
| 'AMBER'
|
|
3512
|
+
| 'ROSE'
|
|
3513
|
+
| 'CYAN';
|
|
3514
|
+
|
|
3515
|
+
/**
|
|
3516
|
+
* CALL (default for metrics) folds each conversation to one value first, so a long
|
|
3517
|
+
* call does not outweigh a short one. NONE aggregates every value.
|
|
3518
|
+
*/
|
|
3519
|
+
distinctBy?: 'NONE' | 'CALL';
|
|
3520
|
+
|
|
3521
|
+
/**
|
|
3522
|
+
* Filters for this measure only, on top of the query's filters.
|
|
3523
|
+
*/
|
|
3524
|
+
filters?: Array<Measure.Filter>;
|
|
3525
|
+
|
|
3526
|
+
/**
|
|
3527
|
+
* Mark one measure as the baseline: every series also reports its value as a
|
|
3528
|
+
* percentage of it.
|
|
3529
|
+
*/
|
|
3530
|
+
isBaseline?: boolean;
|
|
3531
|
+
|
|
3532
|
+
/**
|
|
3533
|
+
* The metric's slug (e.g. `task_completion`) or id. Required for METRIC.
|
|
3534
|
+
*/
|
|
3535
|
+
metric?: string;
|
|
3536
|
+
|
|
3537
|
+
/**
|
|
3538
|
+
* How each conversation is folded when distinctBy is CALL. Defaults to SUM under
|
|
3539
|
+
* SUM, else AVG.
|
|
3540
|
+
*/
|
|
3541
|
+
nestedAggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
|
|
3542
|
+
|
|
3543
|
+
nestedAggregationPercentile?: number;
|
|
3544
|
+
|
|
3545
|
+
/**
|
|
3546
|
+
* PASS_RATE condition operator. Omit for a threshold metric: its own condition is
|
|
3547
|
+
* used.
|
|
3548
|
+
*/
|
|
3549
|
+
passOperator?:
|
|
3550
|
+
| 'EQUALS'
|
|
3551
|
+
| 'NOT_EQUALS'
|
|
3552
|
+
| 'GREATER_THAN'
|
|
3553
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
3554
|
+
| 'LESS_THAN'
|
|
3555
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
3556
|
+
| 'CONTAINS'
|
|
3557
|
+
| 'STARTS_WITH';
|
|
3558
|
+
|
|
3559
|
+
/**
|
|
3560
|
+
* PASS_RATE condition value, e.g. 4 or "resolved".
|
|
3561
|
+
*/
|
|
3562
|
+
passValue?: string | number | boolean;
|
|
3563
|
+
|
|
3564
|
+
/**
|
|
3565
|
+
* Required with PERCENTILE, e.g. 95.
|
|
3566
|
+
*/
|
|
3567
|
+
percentile?: number;
|
|
3568
|
+
|
|
3569
|
+
/**
|
|
3570
|
+
* METRIC (default): a metric's values. CONVERSATION: conversation counts. UPTIME:
|
|
3571
|
+
* health-check outcomes.
|
|
3572
|
+
*/
|
|
3573
|
+
type?: 'METRIC' | 'CONVERSATION' | 'UPTIME';
|
|
3574
|
+
}
|
|
3575
|
+
|
|
3576
|
+
export namespace Measure {
|
|
3577
|
+
/**
|
|
3578
|
+
* Split the measure into one series per value of this dimension (the largest 50
|
|
3579
|
+
* are returned). Ignored while comparisonGroups are set: each group is then one
|
|
3580
|
+
* series.
|
|
3581
|
+
*/
|
|
3582
|
+
export interface Breakdown {
|
|
3583
|
+
type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'DATASET';
|
|
3584
|
+
|
|
3585
|
+
/**
|
|
3586
|
+
* The property to split by. Required for CALL_PROPERTY and METRIC_PROPERTY.
|
|
3587
|
+
*/
|
|
3588
|
+
property?: string;
|
|
3589
|
+
}
|
|
3590
|
+
|
|
3591
|
+
export interface Filter {
|
|
3592
|
+
/**
|
|
3593
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
3594
|
+
*/
|
|
3595
|
+
type:
|
|
3596
|
+
| 'METRIC_PROPERTY'
|
|
3597
|
+
| 'CALL_PROPERTY'
|
|
3598
|
+
| 'AGENT_PROPERTY'
|
|
3599
|
+
| 'CALL_ID'
|
|
3600
|
+
| 'MODALITY'
|
|
3601
|
+
| 'DATASET'
|
|
3602
|
+
| 'METRIC_VALUE';
|
|
3603
|
+
|
|
3604
|
+
/**
|
|
3605
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
3606
|
+
*/
|
|
3607
|
+
value: string | number | boolean;
|
|
3608
|
+
|
|
3609
|
+
/**
|
|
3610
|
+
* Defaults to EQUALS.
|
|
3611
|
+
*/
|
|
3612
|
+
operator?:
|
|
3613
|
+
| 'EQUALS'
|
|
3614
|
+
| 'NOT_EQUALS'
|
|
3615
|
+
| 'GREATER_THAN'
|
|
3616
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
3617
|
+
| 'LESS_THAN'
|
|
3618
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
3619
|
+
| 'CONTAINS'
|
|
3620
|
+
| 'STARTS_WITH';
|
|
3621
|
+
|
|
3622
|
+
/**
|
|
3623
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
3624
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
3625
|
+
*/
|
|
3626
|
+
property?: string;
|
|
3627
|
+
}
|
|
3628
|
+
}
|
|
3629
|
+
|
|
3630
|
+
export interface ComparisonGroup {
|
|
3631
|
+
filters: Array<ComparisonGroup.Filter>;
|
|
3632
|
+
|
|
3633
|
+
/**
|
|
3634
|
+
* The series label; unique within the query.
|
|
3635
|
+
*/
|
|
3636
|
+
name: string;
|
|
3637
|
+
|
|
3638
|
+
color?:
|
|
3639
|
+
| 'GREEN'
|
|
3640
|
+
| 'RED'
|
|
3641
|
+
| 'ORANGE'
|
|
3642
|
+
| 'PURPLE'
|
|
3643
|
+
| 'GREY'
|
|
3644
|
+
| 'BLUE'
|
|
3645
|
+
| 'PEACH'
|
|
3646
|
+
| 'TEAL'
|
|
3647
|
+
| 'INDIGO'
|
|
3648
|
+
| 'AMBER'
|
|
3649
|
+
| 'ROSE'
|
|
3650
|
+
| 'CYAN';
|
|
3651
|
+
}
|
|
3652
|
+
|
|
3653
|
+
export namespace ComparisonGroup {
|
|
3654
|
+
export interface Filter {
|
|
3655
|
+
/**
|
|
3656
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
3657
|
+
*/
|
|
3658
|
+
type:
|
|
3659
|
+
| 'METRIC_PROPERTY'
|
|
3660
|
+
| 'CALL_PROPERTY'
|
|
3661
|
+
| 'AGENT_PROPERTY'
|
|
3662
|
+
| 'CALL_ID'
|
|
3663
|
+
| 'MODALITY'
|
|
3664
|
+
| 'DATASET'
|
|
3665
|
+
| 'METRIC_VALUE';
|
|
3666
|
+
|
|
3667
|
+
/**
|
|
3668
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
3669
|
+
*/
|
|
3670
|
+
value: string | number | boolean;
|
|
3671
|
+
|
|
3672
|
+
/**
|
|
3673
|
+
* Defaults to EQUALS.
|
|
3674
|
+
*/
|
|
3675
|
+
operator?:
|
|
3676
|
+
| 'EQUALS'
|
|
3677
|
+
| 'NOT_EQUALS'
|
|
3678
|
+
| 'GREATER_THAN'
|
|
3679
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
3680
|
+
| 'LESS_THAN'
|
|
3681
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
3682
|
+
| 'CONTAINS'
|
|
3683
|
+
| 'STARTS_WITH';
|
|
3684
|
+
|
|
3685
|
+
/**
|
|
3686
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
3687
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
3688
|
+
*/
|
|
3689
|
+
property?: string;
|
|
3690
|
+
}
|
|
3691
|
+
}
|
|
3692
|
+
|
|
3693
|
+
export interface Filter {
|
|
3694
|
+
/**
|
|
3695
|
+
* What the filter narrows on. GET /v1/analytics/schema lists each type.
|
|
3696
|
+
*/
|
|
3697
|
+
type:
|
|
3698
|
+
| 'METRIC_PROPERTY'
|
|
3699
|
+
| 'CALL_PROPERTY'
|
|
3700
|
+
| 'AGENT_PROPERTY'
|
|
3701
|
+
| 'CALL_ID'
|
|
3702
|
+
| 'MODALITY'
|
|
3703
|
+
| 'DATASET'
|
|
3704
|
+
| 'METRIC_VALUE';
|
|
3705
|
+
|
|
3706
|
+
/**
|
|
3707
|
+
* The value to compare against (an agent id, "call" / "chat", a property value).
|
|
3708
|
+
*/
|
|
3709
|
+
value: string | number | boolean;
|
|
3710
|
+
|
|
3711
|
+
/**
|
|
3712
|
+
* Defaults to EQUALS.
|
|
3713
|
+
*/
|
|
3714
|
+
operator?:
|
|
3715
|
+
| 'EQUALS'
|
|
3716
|
+
| 'NOT_EQUALS'
|
|
3717
|
+
| 'GREATER_THAN'
|
|
3718
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
3719
|
+
| 'LESS_THAN'
|
|
3720
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
3721
|
+
| 'CONTAINS'
|
|
3722
|
+
| 'STARTS_WITH';
|
|
3723
|
+
|
|
3724
|
+
/**
|
|
3725
|
+
* The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
|
|
3726
|
+
* omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
|
|
3727
|
+
*/
|
|
3728
|
+
property?: string;
|
|
3729
|
+
}
|
|
3730
|
+
}
|
|
3731
|
+
|
|
3732
|
+
export declare namespace Dashboard {
|
|
3733
|
+
export {
|
|
3734
|
+
type DashboardCreateResponse as DashboardCreateResponse,
|
|
3735
|
+
type DashboardUpdateResponse as DashboardUpdateResponse,
|
|
3736
|
+
type DashboardListResponse as DashboardListResponse,
|
|
3737
|
+
type DashboardDeleteResponse as DashboardDeleteResponse,
|
|
3738
|
+
type DashboardCreateWidgetResponse as DashboardCreateWidgetResponse,
|
|
3739
|
+
type DashboardDeleteWidgetResponse as DashboardDeleteWidgetResponse,
|
|
3740
|
+
type DashboardGetByIDResponse as DashboardGetByIDResponse,
|
|
3741
|
+
type DashboardGetDataResponse as DashboardGetDataResponse,
|
|
3742
|
+
type DashboardGetWidgetDataResponse as DashboardGetWidgetDataResponse,
|
|
3743
|
+
type DashboardUpdateWidgetResponse as DashboardUpdateWidgetResponse,
|
|
3744
|
+
type DashboardCreateParams as DashboardCreateParams,
|
|
3745
|
+
type DashboardUpdateParams as DashboardUpdateParams,
|
|
3746
|
+
type DashboardCreateWidgetParams as DashboardCreateWidgetParams,
|
|
3747
|
+
type DashboardDeleteWidgetParams as DashboardDeleteWidgetParams,
|
|
3748
|
+
type DashboardGetDataParams as DashboardGetDataParams,
|
|
3749
|
+
type DashboardGetWidgetDataParams as DashboardGetWidgetDataParams,
|
|
3750
|
+
type DashboardUpdateWidgetParams as DashboardUpdateWidgetParams,
|
|
3751
|
+
};
|
|
3752
|
+
}
|