@roarkanalytics/sdk 5.8.0 → 5.9.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/client.d.mts +9 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +9 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +9 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +9 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/analytics.d.mts +354 -0
  12. package/resources/analytics.d.mts.map +1 -0
  13. package/resources/analytics.d.ts +354 -0
  14. package/resources/analytics.d.ts.map +1 -0
  15. package/resources/analytics.js +55 -0
  16. package/resources/analytics.js.map +1 -0
  17. package/resources/analytics.mjs +51 -0
  18. package/resources/analytics.mjs.map +1 -0
  19. package/resources/config.d.mts +578 -8
  20. package/resources/config.d.mts.map +1 -1
  21. package/resources/config.d.ts +578 -8
  22. package/resources/config.d.ts.map +1 -1
  23. package/resources/dashboard.d.mts +2280 -0
  24. package/resources/dashboard.d.mts.map +1 -0
  25. package/resources/dashboard.d.ts +2280 -0
  26. package/resources/dashboard.d.ts.map +1 -0
  27. package/resources/dashboard.js +170 -0
  28. package/resources/dashboard.js.map +1 -0
  29. package/resources/dashboard.mjs +166 -0
  30. package/resources/dashboard.mjs.map +1 -0
  31. package/resources/index.d.mts +3 -0
  32. package/resources/index.d.mts.map +1 -1
  33. package/resources/index.d.ts +3 -0
  34. package/resources/index.d.ts.map +1 -1
  35. package/resources/index.js +7 -1
  36. package/resources/index.js.map +1 -1
  37. package/resources/index.mjs +3 -0
  38. package/resources/index.mjs.map +1 -1
  39. package/resources/usage.d.mts +114 -0
  40. package/resources/usage.d.mts.map +1 -0
  41. package/resources/usage.d.ts +114 -0
  42. package/resources/usage.d.ts.map +1 -0
  43. package/resources/usage.js +27 -0
  44. package/resources/usage.js.map +1 -0
  45. package/resources/usage.mjs +23 -0
  46. package/resources/usage.mjs.map +1 -0
  47. package/src/client.ts +63 -0
  48. package/src/resources/analytics.ts +573 -0
  49. package/src/resources/config.ts +1441 -41
  50. package/src/resources/dashboard.ts +3752 -0
  51. package/src/resources/index.ts +27 -0
  52. package/src/resources/usage.ts +147 -0
  53. package/src/version.ts +1 -1
  54. package/version.d.mts +1 -1
  55. package/version.d.ts +1 -1
  56. package/version.js +1 -1
  57. package/version.mjs +1 -1
@@ -0,0 +1,2280 @@
1
+ import { APIResource } from "../core/resource.js";
2
+ import { APIPromise } from "../core/api-promise.js";
3
+ import { RequestOptions } from "../internal/request-options.js";
4
+ export declare class Dashboard extends APIResource {
5
+ /**
6
+ * Creates a dashboard with its widgets. Each widget is an analytics query (see
7
+ * POST /v1/analytics/query) with a name unique on the dashboard, a `display`
8
+ * (LINE, NUMBER, RADAR, STACKED_BAR, TABLE) and a `size` (SMALL, MEDIUM, LARGE,
9
+ * EXTRA_LARGE). Widgets render top to bottom in the order given.
10
+ *
11
+ * Dashboard `filters` apply over every widget and must be conversation-level:
12
+ * AGENT_PROPERTY, CALL_PROPERTY, MODALITY, DATASET or METRIC_VALUE. On a field a
13
+ * widget already filters, the dashboard's wins.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const dashboard = await client.dashboard.create({
18
+ * name: 'x',
19
+ * });
20
+ * ```
21
+ */
22
+ create(body: DashboardCreateParams, options?: RequestOptions): APIPromise<DashboardCreateResponse>;
23
+ /**
24
+ * Edits a dashboard. Omitted fields keep their current value. `widgets`, when
25
+ * sent, replaces the list: widgets are matched by name, so a widget that keeps its
26
+ * name keeps its id; a new name adds a widget and a name no longer listed removes
27
+ * it. To change one widget, PUT /v1/dashboard/{dashboardId}/widget/{widgetId}.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const dashboard = await client.dashboard.update(
32
+ * '6f1d2c3b-4a5e-4f60-8b71-9c0d1e2f3a4b',
33
+ * );
34
+ * ```
35
+ */
36
+ update(dashboardID: string, body?: DashboardUpdateParams | null | undefined, options?: RequestOptions): APIPromise<DashboardUpdateResponse>;
37
+ /**
38
+ * Lists the project's dashboards, the default first. GET
39
+ * /v1/dashboard/{dashboardId} returns the widgets.
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * const dashboards = await client.dashboard.list();
44
+ * ```
45
+ */
46
+ list(options?: RequestOptions): APIPromise<DashboardListResponse>;
47
+ /**
48
+ * Deletes a dashboard and its widgets. If it was the default, another dashboard
49
+ * becomes the default. A dashboard managed by config as code returns 409.
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * const dashboard = await client.dashboard.delete(
54
+ * '6f1d2c3b-4a5e-4f60-8b71-9c0d1e2f3a4b',
55
+ * );
56
+ * ```
57
+ */
58
+ delete(dashboardID: string, options?: RequestOptions): APIPromise<DashboardDeleteResponse>;
59
+ /**
60
+ * Adds a widget to the top of a dashboard. Its name must be unique on the
61
+ * dashboard.
62
+ *
63
+ * @example
64
+ * ```ts
65
+ * const response = await client.dashboard.createWidget(
66
+ * '6f1d2c3b-4a5e-4f60-8b71-9c0d1e2f3a4b',
67
+ * { measures: [{}], name: 'x' },
68
+ * );
69
+ * ```
70
+ */
71
+ createWidget(dashboardID: string, body: DashboardCreateWidgetParams, options?: RequestOptions): APIPromise<DashboardCreateWidgetResponse>;
72
+ /**
73
+ * Removes a widget from a dashboard.
74
+ *
75
+ * @example
76
+ * ```ts
77
+ * const response = await client.dashboard.deleteWidget(
78
+ * '7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d',
79
+ * { dashboardId: '6f1d2c3b-4a5e-4f60-8b71-9c0d1e2f3a4b' },
80
+ * );
81
+ * ```
82
+ */
83
+ deleteWidget(widgetID: string, params: DashboardDeleteWidgetParams, options?: RequestOptions): APIPromise<DashboardDeleteWidgetResponse>;
84
+ /**
85
+ * Returns a dashboard with its widgets top to bottom, each in the shape POST
86
+ * /v1/dashboard accepts, so a dashboard can be read, edited and written back.
87
+ *
88
+ * @example
89
+ * ```ts
90
+ * const response = await client.dashboard.getByID(
91
+ * '6f1d2c3b-4a5e-4f60-8b71-9c0d1e2f3a4b',
92
+ * );
93
+ * ```
94
+ */
95
+ getByID(dashboardID: string, options?: RequestOptions): APIPromise<DashboardGetByIDResponse>;
96
+ /**
97
+ * Runs every widget on the dashboard and returns each one's series, exactly as the
98
+ * dashboard shows them: over the dashboard's saved window and with its filters
99
+ * applied. Pass `from` (and optionally `to`) to read a different window, and
100
+ * `timezone` to align buckets to a zone.
101
+ *
102
+ * @example
103
+ * ```ts
104
+ * const response =
105
+ * await client.dashboard.getData('dashboardId');
106
+ * ```
107
+ */
108
+ getData(dashboardID: string, query?: DashboardGetDataParams | null | undefined, options?: RequestOptions): APIPromise<DashboardGetDataResponse>;
109
+ /**
110
+ * Runs one widget and returns its series, as it reads on its dashboard (the
111
+ * dashboard's window and filters). Accepts the same `from` / `to` / `timezone`
112
+ * overrides as GET /v1/dashboard/{dashboardId}/data.
113
+ *
114
+ * @example
115
+ * ```ts
116
+ * const response = await client.dashboard.getWidgetData(
117
+ * 'widgetId',
118
+ * { dashboardId: 'dashboardId' },
119
+ * );
120
+ * ```
121
+ */
122
+ getWidgetData(widgetID: string, params: DashboardGetWidgetDataParams, options?: RequestOptions): APIPromise<DashboardGetWidgetDataResponse>;
123
+ /**
124
+ * Replaces a widget's definition. It keeps its id and its place on the dashboard.
125
+ *
126
+ * @example
127
+ * ```ts
128
+ * const response = await client.dashboard.updateWidget(
129
+ * '7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d',
130
+ * {
131
+ * dashboardId: '6f1d2c3b-4a5e-4f60-8b71-9c0d1e2f3a4b',
132
+ * measures: [{}],
133
+ * name: 'x',
134
+ * },
135
+ * );
136
+ * ```
137
+ */
138
+ updateWidget(widgetID: string, params: DashboardUpdateWidgetParams, options?: RequestOptions): APIPromise<DashboardUpdateWidgetResponse>;
139
+ }
140
+ export interface DashboardCreateResponse {
141
+ data: DashboardCreateResponse.Data;
142
+ }
143
+ export declare namespace DashboardCreateResponse {
144
+ interface Data {
145
+ id: string;
146
+ /**
147
+ * Managed by config as code (`kind: dashboard`). A managed dashboard is read-only
148
+ * here: edits return 409; change it in the config file.
149
+ */
150
+ configManaged: boolean;
151
+ createdAt: string;
152
+ description: string | null;
153
+ filters: Array<Data.Filter>;
154
+ isDefault: boolean;
155
+ name: string;
156
+ /**
157
+ * The window: LAST n DAYS/WEEKS/MONTHS up to now, a CALENDAR_ALIGNED period
158
+ * (TODAY, YESTERDAY, THIS_WEEK, LAST_WEEK, THIS_MONTH, LAST_MONTH, THIS_YEAR,
159
+ * LAST_YEAR), FIXED from/to, or SINCE a date. At most 731 days (two years).
160
+ */
161
+ timeRange: Data.UnionMember0 | Data.UnionMember1 | Data.UnionMember2 | Data.UnionMember3 | null;
162
+ updatedAt: string;
163
+ widgets: Array<Data.Widget>;
164
+ }
165
+ namespace Data {
166
+ interface Filter {
167
+ /**
168
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
169
+ */
170
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
171
+ /**
172
+ * The value to compare against (an agent id, "call" / "chat", a property value).
173
+ */
174
+ value: string | number | boolean;
175
+ /**
176
+ * Defaults to EQUALS.
177
+ */
178
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
179
+ /**
180
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
181
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
182
+ */
183
+ property?: string;
184
+ }
185
+ interface UnionMember0 {
186
+ type: 'LAST';
187
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS';
188
+ value: number;
189
+ }
190
+ interface UnionMember1 {
191
+ period: 'TODAY' | 'YESTERDAY' | 'THIS_WEEK' | 'LAST_WEEK' | 'THIS_MONTH' | 'LAST_MONTH' | 'THIS_YEAR' | 'LAST_YEAR';
192
+ type: 'CALENDAR_ALIGNED';
193
+ }
194
+ interface UnionMember2 {
195
+ from: string;
196
+ to: string;
197
+ type: 'FIXED';
198
+ }
199
+ interface UnionMember3 {
200
+ from: string;
201
+ type: 'SINCE';
202
+ }
203
+ interface Widget {
204
+ id: string;
205
+ /**
206
+ * What to aggregate: 1 to 10 measures.
207
+ */
208
+ measures: Array<Widget.Measure>;
209
+ /**
210
+ * Unique on the dashboard: how the widget is matched on update.
211
+ */
212
+ name: string;
213
+ /**
214
+ * Run every measure once per named filter set, e.g. one group per agent.
215
+ */
216
+ comparisonGroups?: Array<Widget.ComparisonGroup>;
217
+ /**
218
+ * PREVIOUS_PERIOD adds the preceding window of the same length to every series.
219
+ */
220
+ comparisonMode?: 'NONE' | 'PREVIOUS_PERIOD';
221
+ description?: string;
222
+ /**
223
+ * Chart type. Defaults to LINE.
224
+ */
225
+ display?: 'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE';
226
+ /**
227
+ * Applied to every measure, on top of each measure's own filters.
228
+ */
229
+ filters?: Array<Widget.Filter>;
230
+ /**
231
+ * Bucket size. Defaults from the window's length and steps coarser when the window
232
+ * would exceed 500 buckets.
233
+ */
234
+ interval?: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
235
+ /**
236
+ * Grid width. Defaults to MEDIUM.
237
+ */
238
+ size?: 'SMALL' | 'MEDIUM' | 'LARGE' | 'EXTRA_LARGE';
239
+ }
240
+ namespace Widget {
241
+ interface Measure {
242
+ /**
243
+ * Defaults by output type: AVG for numeric metrics, COUNT (split by value) for
244
+ * classification and text, PASS_RATE for thresholds and uptime, COUNT for
245
+ * conversations.
246
+ */
247
+ aggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
248
+ /**
249
+ * Split the measure into one series per value of this dimension (the largest 50
250
+ * are returned). Ignored while comparisonGroups are set: each group is then one
251
+ * series.
252
+ */
253
+ breakdown?: Measure.Breakdown;
254
+ /**
255
+ * Chart color on a dashboard.
256
+ */
257
+ color?: 'GREEN' | 'RED' | 'ORANGE' | 'PURPLE' | 'GREY' | 'BLUE' | 'PEACH' | 'TEAL' | 'INDIGO' | 'AMBER' | 'ROSE' | 'CYAN';
258
+ /**
259
+ * CALL (default for metrics) folds each conversation to one value first, so a long
260
+ * call does not outweigh a short one. NONE aggregates every value.
261
+ */
262
+ distinctBy?: 'NONE' | 'CALL';
263
+ /**
264
+ * Filters for this measure only, on top of the query's filters.
265
+ */
266
+ filters?: Array<Measure.Filter>;
267
+ /**
268
+ * Mark one measure as the baseline: every series also reports its value as a
269
+ * percentage of it.
270
+ */
271
+ isBaseline?: boolean;
272
+ /**
273
+ * The metric's slug (e.g. `task_completion`) or id. Required for METRIC.
274
+ */
275
+ metric?: string;
276
+ /**
277
+ * How each conversation is folded when distinctBy is CALL. Defaults to SUM under
278
+ * SUM, else AVG.
279
+ */
280
+ nestedAggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
281
+ nestedAggregationPercentile?: number;
282
+ /**
283
+ * PASS_RATE condition operator. Omit for a threshold metric: its own condition is
284
+ * used.
285
+ */
286
+ passOperator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
287
+ /**
288
+ * PASS_RATE condition value, e.g. 4 or "resolved".
289
+ */
290
+ passValue?: string | number | boolean;
291
+ /**
292
+ * Required with PERCENTILE, e.g. 95.
293
+ */
294
+ percentile?: number;
295
+ /**
296
+ * METRIC (default): a metric's values. CONVERSATION: conversation counts. UPTIME:
297
+ * health-check outcomes.
298
+ */
299
+ type?: 'METRIC' | 'CONVERSATION' | 'UPTIME';
300
+ }
301
+ namespace Measure {
302
+ /**
303
+ * Split the measure into one series per value of this dimension (the largest 50
304
+ * are returned). Ignored while comparisonGroups are set: each group is then one
305
+ * series.
306
+ */
307
+ interface Breakdown {
308
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'DATASET';
309
+ /**
310
+ * The property to split by. Required for CALL_PROPERTY and METRIC_PROPERTY.
311
+ */
312
+ property?: string;
313
+ }
314
+ interface Filter {
315
+ /**
316
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
317
+ */
318
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
319
+ /**
320
+ * The value to compare against (an agent id, "call" / "chat", a property value).
321
+ */
322
+ value: string | number | boolean;
323
+ /**
324
+ * Defaults to EQUALS.
325
+ */
326
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
327
+ /**
328
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
329
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
330
+ */
331
+ property?: string;
332
+ }
333
+ }
334
+ interface ComparisonGroup {
335
+ filters: Array<ComparisonGroup.Filter>;
336
+ /**
337
+ * The series label; unique within the query.
338
+ */
339
+ name: string;
340
+ color?: 'GREEN' | 'RED' | 'ORANGE' | 'PURPLE' | 'GREY' | 'BLUE' | 'PEACH' | 'TEAL' | 'INDIGO' | 'AMBER' | 'ROSE' | 'CYAN';
341
+ }
342
+ namespace ComparisonGroup {
343
+ interface Filter {
344
+ /**
345
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
346
+ */
347
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
348
+ /**
349
+ * The value to compare against (an agent id, "call" / "chat", a property value).
350
+ */
351
+ value: string | number | boolean;
352
+ /**
353
+ * Defaults to EQUALS.
354
+ */
355
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
356
+ /**
357
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
358
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
359
+ */
360
+ property?: string;
361
+ }
362
+ }
363
+ interface Filter {
364
+ /**
365
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
366
+ */
367
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
368
+ /**
369
+ * The value to compare against (an agent id, "call" / "chat", a property value).
370
+ */
371
+ value: string | number | boolean;
372
+ /**
373
+ * Defaults to EQUALS.
374
+ */
375
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
376
+ /**
377
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
378
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
379
+ */
380
+ property?: string;
381
+ }
382
+ }
383
+ }
384
+ }
385
+ export interface DashboardUpdateResponse {
386
+ data: DashboardUpdateResponse.Data;
387
+ }
388
+ export declare namespace DashboardUpdateResponse {
389
+ interface Data {
390
+ id: string;
391
+ /**
392
+ * Managed by config as code (`kind: dashboard`). A managed dashboard is read-only
393
+ * here: edits return 409; change it in the config file.
394
+ */
395
+ configManaged: boolean;
396
+ createdAt: string;
397
+ description: string | null;
398
+ filters: Array<Data.Filter>;
399
+ isDefault: boolean;
400
+ name: string;
401
+ /**
402
+ * The window: LAST n DAYS/WEEKS/MONTHS up to now, a CALENDAR_ALIGNED period
403
+ * (TODAY, YESTERDAY, THIS_WEEK, LAST_WEEK, THIS_MONTH, LAST_MONTH, THIS_YEAR,
404
+ * LAST_YEAR), FIXED from/to, or SINCE a date. At most 731 days (two years).
405
+ */
406
+ timeRange: Data.UnionMember0 | Data.UnionMember1 | Data.UnionMember2 | Data.UnionMember3 | null;
407
+ updatedAt: string;
408
+ widgets: Array<Data.Widget>;
409
+ }
410
+ namespace Data {
411
+ interface Filter {
412
+ /**
413
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
414
+ */
415
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
416
+ /**
417
+ * The value to compare against (an agent id, "call" / "chat", a property value).
418
+ */
419
+ value: string | number | boolean;
420
+ /**
421
+ * Defaults to EQUALS.
422
+ */
423
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
424
+ /**
425
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
426
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
427
+ */
428
+ property?: string;
429
+ }
430
+ interface UnionMember0 {
431
+ type: 'LAST';
432
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS';
433
+ value: number;
434
+ }
435
+ interface UnionMember1 {
436
+ period: 'TODAY' | 'YESTERDAY' | 'THIS_WEEK' | 'LAST_WEEK' | 'THIS_MONTH' | 'LAST_MONTH' | 'THIS_YEAR' | 'LAST_YEAR';
437
+ type: 'CALENDAR_ALIGNED';
438
+ }
439
+ interface UnionMember2 {
440
+ from: string;
441
+ to: string;
442
+ type: 'FIXED';
443
+ }
444
+ interface UnionMember3 {
445
+ from: string;
446
+ type: 'SINCE';
447
+ }
448
+ interface Widget {
449
+ id: string;
450
+ /**
451
+ * What to aggregate: 1 to 10 measures.
452
+ */
453
+ measures: Array<Widget.Measure>;
454
+ /**
455
+ * Unique on the dashboard: how the widget is matched on update.
456
+ */
457
+ name: string;
458
+ /**
459
+ * Run every measure once per named filter set, e.g. one group per agent.
460
+ */
461
+ comparisonGroups?: Array<Widget.ComparisonGroup>;
462
+ /**
463
+ * PREVIOUS_PERIOD adds the preceding window of the same length to every series.
464
+ */
465
+ comparisonMode?: 'NONE' | 'PREVIOUS_PERIOD';
466
+ description?: string;
467
+ /**
468
+ * Chart type. Defaults to LINE.
469
+ */
470
+ display?: 'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE';
471
+ /**
472
+ * Applied to every measure, on top of each measure's own filters.
473
+ */
474
+ filters?: Array<Widget.Filter>;
475
+ /**
476
+ * Bucket size. Defaults from the window's length and steps coarser when the window
477
+ * would exceed 500 buckets.
478
+ */
479
+ interval?: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
480
+ /**
481
+ * Grid width. Defaults to MEDIUM.
482
+ */
483
+ size?: 'SMALL' | 'MEDIUM' | 'LARGE' | 'EXTRA_LARGE';
484
+ }
485
+ namespace Widget {
486
+ interface Measure {
487
+ /**
488
+ * Defaults by output type: AVG for numeric metrics, COUNT (split by value) for
489
+ * classification and text, PASS_RATE for thresholds and uptime, COUNT for
490
+ * conversations.
491
+ */
492
+ aggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
493
+ /**
494
+ * Split the measure into one series per value of this dimension (the largest 50
495
+ * are returned). Ignored while comparisonGroups are set: each group is then one
496
+ * series.
497
+ */
498
+ breakdown?: Measure.Breakdown;
499
+ /**
500
+ * Chart color on a dashboard.
501
+ */
502
+ color?: 'GREEN' | 'RED' | 'ORANGE' | 'PURPLE' | 'GREY' | 'BLUE' | 'PEACH' | 'TEAL' | 'INDIGO' | 'AMBER' | 'ROSE' | 'CYAN';
503
+ /**
504
+ * CALL (default for metrics) folds each conversation to one value first, so a long
505
+ * call does not outweigh a short one. NONE aggregates every value.
506
+ */
507
+ distinctBy?: 'NONE' | 'CALL';
508
+ /**
509
+ * Filters for this measure only, on top of the query's filters.
510
+ */
511
+ filters?: Array<Measure.Filter>;
512
+ /**
513
+ * Mark one measure as the baseline: every series also reports its value as a
514
+ * percentage of it.
515
+ */
516
+ isBaseline?: boolean;
517
+ /**
518
+ * The metric's slug (e.g. `task_completion`) or id. Required for METRIC.
519
+ */
520
+ metric?: string;
521
+ /**
522
+ * How each conversation is folded when distinctBy is CALL. Defaults to SUM under
523
+ * SUM, else AVG.
524
+ */
525
+ nestedAggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
526
+ nestedAggregationPercentile?: number;
527
+ /**
528
+ * PASS_RATE condition operator. Omit for a threshold metric: its own condition is
529
+ * used.
530
+ */
531
+ passOperator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
532
+ /**
533
+ * PASS_RATE condition value, e.g. 4 or "resolved".
534
+ */
535
+ passValue?: string | number | boolean;
536
+ /**
537
+ * Required with PERCENTILE, e.g. 95.
538
+ */
539
+ percentile?: number;
540
+ /**
541
+ * METRIC (default): a metric's values. CONVERSATION: conversation counts. UPTIME:
542
+ * health-check outcomes.
543
+ */
544
+ type?: 'METRIC' | 'CONVERSATION' | 'UPTIME';
545
+ }
546
+ namespace Measure {
547
+ /**
548
+ * Split the measure into one series per value of this dimension (the largest 50
549
+ * are returned). Ignored while comparisonGroups are set: each group is then one
550
+ * series.
551
+ */
552
+ interface Breakdown {
553
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'DATASET';
554
+ /**
555
+ * The property to split by. Required for CALL_PROPERTY and METRIC_PROPERTY.
556
+ */
557
+ property?: string;
558
+ }
559
+ interface Filter {
560
+ /**
561
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
562
+ */
563
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
564
+ /**
565
+ * The value to compare against (an agent id, "call" / "chat", a property value).
566
+ */
567
+ value: string | number | boolean;
568
+ /**
569
+ * Defaults to EQUALS.
570
+ */
571
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
572
+ /**
573
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
574
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
575
+ */
576
+ property?: string;
577
+ }
578
+ }
579
+ interface ComparisonGroup {
580
+ filters: Array<ComparisonGroup.Filter>;
581
+ /**
582
+ * The series label; unique within the query.
583
+ */
584
+ name: string;
585
+ color?: 'GREEN' | 'RED' | 'ORANGE' | 'PURPLE' | 'GREY' | 'BLUE' | 'PEACH' | 'TEAL' | 'INDIGO' | 'AMBER' | 'ROSE' | 'CYAN';
586
+ }
587
+ namespace ComparisonGroup {
588
+ interface Filter {
589
+ /**
590
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
591
+ */
592
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
593
+ /**
594
+ * The value to compare against (an agent id, "call" / "chat", a property value).
595
+ */
596
+ value: string | number | boolean;
597
+ /**
598
+ * Defaults to EQUALS.
599
+ */
600
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
601
+ /**
602
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
603
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
604
+ */
605
+ property?: string;
606
+ }
607
+ }
608
+ interface Filter {
609
+ /**
610
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
611
+ */
612
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
613
+ /**
614
+ * The value to compare against (an agent id, "call" / "chat", a property value).
615
+ */
616
+ value: string | number | boolean;
617
+ /**
618
+ * Defaults to EQUALS.
619
+ */
620
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
621
+ /**
622
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
623
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
624
+ */
625
+ property?: string;
626
+ }
627
+ }
628
+ }
629
+ }
630
+ export interface DashboardListResponse {
631
+ data: Array<DashboardListResponse.Data>;
632
+ }
633
+ export declare namespace DashboardListResponse {
634
+ interface Data {
635
+ id: string;
636
+ /**
637
+ * Managed by config as code (`kind: dashboard`). A managed dashboard is read-only
638
+ * here: edits return 409; change it in the config file.
639
+ */
640
+ configManaged: boolean;
641
+ createdAt: string;
642
+ description: string | null;
643
+ isDefault: boolean;
644
+ name: string;
645
+ /**
646
+ * The window: LAST n DAYS/WEEKS/MONTHS up to now, a CALENDAR_ALIGNED period
647
+ * (TODAY, YESTERDAY, THIS_WEEK, LAST_WEEK, THIS_MONTH, LAST_MONTH, THIS_YEAR,
648
+ * LAST_YEAR), FIXED from/to, or SINCE a date. At most 731 days (two years).
649
+ */
650
+ timeRange: Data.UnionMember0 | Data.UnionMember1 | Data.UnionMember2 | Data.UnionMember3 | null;
651
+ updatedAt: string;
652
+ }
653
+ namespace Data {
654
+ interface UnionMember0 {
655
+ type: 'LAST';
656
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS';
657
+ value: number;
658
+ }
659
+ interface UnionMember1 {
660
+ period: 'TODAY' | 'YESTERDAY' | 'THIS_WEEK' | 'LAST_WEEK' | 'THIS_MONTH' | 'LAST_MONTH' | 'THIS_YEAR' | 'LAST_YEAR';
661
+ type: 'CALENDAR_ALIGNED';
662
+ }
663
+ interface UnionMember2 {
664
+ from: string;
665
+ to: string;
666
+ type: 'FIXED';
667
+ }
668
+ interface UnionMember3 {
669
+ from: string;
670
+ type: 'SINCE';
671
+ }
672
+ }
673
+ }
674
+ export interface DashboardDeleteResponse {
675
+ data: DashboardDeleteResponse.Data;
676
+ }
677
+ export declare namespace DashboardDeleteResponse {
678
+ interface Data {
679
+ id: string;
680
+ deleted: true;
681
+ }
682
+ }
683
+ export interface DashboardCreateWidgetResponse {
684
+ data: DashboardCreateWidgetResponse.Data;
685
+ }
686
+ export declare namespace DashboardCreateWidgetResponse {
687
+ interface Data {
688
+ id: string;
689
+ /**
690
+ * What to aggregate: 1 to 10 measures.
691
+ */
692
+ measures: Array<Data.Measure>;
693
+ /**
694
+ * Unique on the dashboard: how the widget is matched on update.
695
+ */
696
+ name: string;
697
+ /**
698
+ * Run every measure once per named filter set, e.g. one group per agent.
699
+ */
700
+ comparisonGroups?: Array<Data.ComparisonGroup>;
701
+ /**
702
+ * PREVIOUS_PERIOD adds the preceding window of the same length to every series.
703
+ */
704
+ comparisonMode?: 'NONE' | 'PREVIOUS_PERIOD';
705
+ description?: string;
706
+ /**
707
+ * Chart type. Defaults to LINE.
708
+ */
709
+ display?: 'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE';
710
+ /**
711
+ * Applied to every measure, on top of each measure's own filters.
712
+ */
713
+ filters?: Array<Data.Filter>;
714
+ /**
715
+ * Bucket size. Defaults from the window's length and steps coarser when the window
716
+ * would exceed 500 buckets.
717
+ */
718
+ interval?: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
719
+ /**
720
+ * Grid width. Defaults to MEDIUM.
721
+ */
722
+ size?: 'SMALL' | 'MEDIUM' | 'LARGE' | 'EXTRA_LARGE';
723
+ }
724
+ namespace Data {
725
+ interface Measure {
726
+ /**
727
+ * Defaults by output type: AVG for numeric metrics, COUNT (split by value) for
728
+ * classification and text, PASS_RATE for thresholds and uptime, COUNT for
729
+ * conversations.
730
+ */
731
+ aggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
732
+ /**
733
+ * Split the measure into one series per value of this dimension (the largest 50
734
+ * are returned). Ignored while comparisonGroups are set: each group is then one
735
+ * series.
736
+ */
737
+ breakdown?: Measure.Breakdown;
738
+ /**
739
+ * Chart color on a dashboard.
740
+ */
741
+ color?: 'GREEN' | 'RED' | 'ORANGE' | 'PURPLE' | 'GREY' | 'BLUE' | 'PEACH' | 'TEAL' | 'INDIGO' | 'AMBER' | 'ROSE' | 'CYAN';
742
+ /**
743
+ * CALL (default for metrics) folds each conversation to one value first, so a long
744
+ * call does not outweigh a short one. NONE aggregates every value.
745
+ */
746
+ distinctBy?: 'NONE' | 'CALL';
747
+ /**
748
+ * Filters for this measure only, on top of the query's filters.
749
+ */
750
+ filters?: Array<Measure.Filter>;
751
+ /**
752
+ * Mark one measure as the baseline: every series also reports its value as a
753
+ * percentage of it.
754
+ */
755
+ isBaseline?: boolean;
756
+ /**
757
+ * The metric's slug (e.g. `task_completion`) or id. Required for METRIC.
758
+ */
759
+ metric?: string;
760
+ /**
761
+ * How each conversation is folded when distinctBy is CALL. Defaults to SUM under
762
+ * SUM, else AVG.
763
+ */
764
+ nestedAggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
765
+ nestedAggregationPercentile?: number;
766
+ /**
767
+ * PASS_RATE condition operator. Omit for a threshold metric: its own condition is
768
+ * used.
769
+ */
770
+ passOperator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
771
+ /**
772
+ * PASS_RATE condition value, e.g. 4 or "resolved".
773
+ */
774
+ passValue?: string | number | boolean;
775
+ /**
776
+ * Required with PERCENTILE, e.g. 95.
777
+ */
778
+ percentile?: number;
779
+ /**
780
+ * METRIC (default): a metric's values. CONVERSATION: conversation counts. UPTIME:
781
+ * health-check outcomes.
782
+ */
783
+ type?: 'METRIC' | 'CONVERSATION' | 'UPTIME';
784
+ }
785
+ namespace Measure {
786
+ /**
787
+ * Split the measure into one series per value of this dimension (the largest 50
788
+ * are returned). Ignored while comparisonGroups are set: each group is then one
789
+ * series.
790
+ */
791
+ interface Breakdown {
792
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'DATASET';
793
+ /**
794
+ * The property to split by. Required for CALL_PROPERTY and METRIC_PROPERTY.
795
+ */
796
+ property?: string;
797
+ }
798
+ interface Filter {
799
+ /**
800
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
801
+ */
802
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
803
+ /**
804
+ * The value to compare against (an agent id, "call" / "chat", a property value).
805
+ */
806
+ value: string | number | boolean;
807
+ /**
808
+ * Defaults to EQUALS.
809
+ */
810
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
811
+ /**
812
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
813
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
814
+ */
815
+ property?: string;
816
+ }
817
+ }
818
+ interface ComparisonGroup {
819
+ filters: Array<ComparisonGroup.Filter>;
820
+ /**
821
+ * The series label; unique within the query.
822
+ */
823
+ name: string;
824
+ color?: 'GREEN' | 'RED' | 'ORANGE' | 'PURPLE' | 'GREY' | 'BLUE' | 'PEACH' | 'TEAL' | 'INDIGO' | 'AMBER' | 'ROSE' | 'CYAN';
825
+ }
826
+ namespace ComparisonGroup {
827
+ interface Filter {
828
+ /**
829
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
830
+ */
831
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
832
+ /**
833
+ * The value to compare against (an agent id, "call" / "chat", a property value).
834
+ */
835
+ value: string | number | boolean;
836
+ /**
837
+ * Defaults to EQUALS.
838
+ */
839
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
840
+ /**
841
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
842
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
843
+ */
844
+ property?: string;
845
+ }
846
+ }
847
+ interface Filter {
848
+ /**
849
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
850
+ */
851
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
852
+ /**
853
+ * The value to compare against (an agent id, "call" / "chat", a property value).
854
+ */
855
+ value: string | number | boolean;
856
+ /**
857
+ * Defaults to EQUALS.
858
+ */
859
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
860
+ /**
861
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
862
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
863
+ */
864
+ property?: string;
865
+ }
866
+ }
867
+ }
868
+ export interface DashboardDeleteWidgetResponse {
869
+ data: DashboardDeleteWidgetResponse.Data;
870
+ }
871
+ export declare namespace DashboardDeleteWidgetResponse {
872
+ interface Data {
873
+ id: string;
874
+ deleted: true;
875
+ }
876
+ }
877
+ export interface DashboardGetByIDResponse {
878
+ data: DashboardGetByIDResponse.Data;
879
+ }
880
+ export declare namespace DashboardGetByIDResponse {
881
+ interface Data {
882
+ id: string;
883
+ /**
884
+ * Managed by config as code (`kind: dashboard`). A managed dashboard is read-only
885
+ * here: edits return 409; change it in the config file.
886
+ */
887
+ configManaged: boolean;
888
+ createdAt: string;
889
+ description: string | null;
890
+ filters: Array<Data.Filter>;
891
+ isDefault: boolean;
892
+ name: string;
893
+ /**
894
+ * The window: LAST n DAYS/WEEKS/MONTHS up to now, a CALENDAR_ALIGNED period
895
+ * (TODAY, YESTERDAY, THIS_WEEK, LAST_WEEK, THIS_MONTH, LAST_MONTH, THIS_YEAR,
896
+ * LAST_YEAR), FIXED from/to, or SINCE a date. At most 731 days (two years).
897
+ */
898
+ timeRange: Data.UnionMember0 | Data.UnionMember1 | Data.UnionMember2 | Data.UnionMember3 | null;
899
+ updatedAt: string;
900
+ widgets: Array<Data.Widget>;
901
+ }
902
+ namespace Data {
903
+ interface Filter {
904
+ /**
905
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
906
+ */
907
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
908
+ /**
909
+ * The value to compare against (an agent id, "call" / "chat", a property value).
910
+ */
911
+ value: string | number | boolean;
912
+ /**
913
+ * Defaults to EQUALS.
914
+ */
915
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
916
+ /**
917
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
918
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
919
+ */
920
+ property?: string;
921
+ }
922
+ interface UnionMember0 {
923
+ type: 'LAST';
924
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS';
925
+ value: number;
926
+ }
927
+ interface UnionMember1 {
928
+ period: 'TODAY' | 'YESTERDAY' | 'THIS_WEEK' | 'LAST_WEEK' | 'THIS_MONTH' | 'LAST_MONTH' | 'THIS_YEAR' | 'LAST_YEAR';
929
+ type: 'CALENDAR_ALIGNED';
930
+ }
931
+ interface UnionMember2 {
932
+ from: string;
933
+ to: string;
934
+ type: 'FIXED';
935
+ }
936
+ interface UnionMember3 {
937
+ from: string;
938
+ type: 'SINCE';
939
+ }
940
+ interface Widget {
941
+ id: string;
942
+ /**
943
+ * What to aggregate: 1 to 10 measures.
944
+ */
945
+ measures: Array<Widget.Measure>;
946
+ /**
947
+ * Unique on the dashboard: how the widget is matched on update.
948
+ */
949
+ name: string;
950
+ /**
951
+ * Run every measure once per named filter set, e.g. one group per agent.
952
+ */
953
+ comparisonGroups?: Array<Widget.ComparisonGroup>;
954
+ /**
955
+ * PREVIOUS_PERIOD adds the preceding window of the same length to every series.
956
+ */
957
+ comparisonMode?: 'NONE' | 'PREVIOUS_PERIOD';
958
+ description?: string;
959
+ /**
960
+ * Chart type. Defaults to LINE.
961
+ */
962
+ display?: 'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE';
963
+ /**
964
+ * Applied to every measure, on top of each measure's own filters.
965
+ */
966
+ filters?: Array<Widget.Filter>;
967
+ /**
968
+ * Bucket size. Defaults from the window's length and steps coarser when the window
969
+ * would exceed 500 buckets.
970
+ */
971
+ interval?: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
972
+ /**
973
+ * Grid width. Defaults to MEDIUM.
974
+ */
975
+ size?: 'SMALL' | 'MEDIUM' | 'LARGE' | 'EXTRA_LARGE';
976
+ }
977
+ namespace Widget {
978
+ interface Measure {
979
+ /**
980
+ * Defaults by output type: AVG for numeric metrics, COUNT (split by value) for
981
+ * classification and text, PASS_RATE for thresholds and uptime, COUNT for
982
+ * conversations.
983
+ */
984
+ aggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
985
+ /**
986
+ * Split the measure into one series per value of this dimension (the largest 50
987
+ * are returned). Ignored while comparisonGroups are set: each group is then one
988
+ * series.
989
+ */
990
+ breakdown?: Measure.Breakdown;
991
+ /**
992
+ * Chart color on a dashboard.
993
+ */
994
+ color?: 'GREEN' | 'RED' | 'ORANGE' | 'PURPLE' | 'GREY' | 'BLUE' | 'PEACH' | 'TEAL' | 'INDIGO' | 'AMBER' | 'ROSE' | 'CYAN';
995
+ /**
996
+ * CALL (default for metrics) folds each conversation to one value first, so a long
997
+ * call does not outweigh a short one. NONE aggregates every value.
998
+ */
999
+ distinctBy?: 'NONE' | 'CALL';
1000
+ /**
1001
+ * Filters for this measure only, on top of the query's filters.
1002
+ */
1003
+ filters?: Array<Measure.Filter>;
1004
+ /**
1005
+ * Mark one measure as the baseline: every series also reports its value as a
1006
+ * percentage of it.
1007
+ */
1008
+ isBaseline?: boolean;
1009
+ /**
1010
+ * The metric's slug (e.g. `task_completion`) or id. Required for METRIC.
1011
+ */
1012
+ metric?: string;
1013
+ /**
1014
+ * How each conversation is folded when distinctBy is CALL. Defaults to SUM under
1015
+ * SUM, else AVG.
1016
+ */
1017
+ nestedAggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
1018
+ nestedAggregationPercentile?: number;
1019
+ /**
1020
+ * PASS_RATE condition operator. Omit for a threshold metric: its own condition is
1021
+ * used.
1022
+ */
1023
+ passOperator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
1024
+ /**
1025
+ * PASS_RATE condition value, e.g. 4 or "resolved".
1026
+ */
1027
+ passValue?: string | number | boolean;
1028
+ /**
1029
+ * Required with PERCENTILE, e.g. 95.
1030
+ */
1031
+ percentile?: number;
1032
+ /**
1033
+ * METRIC (default): a metric's values. CONVERSATION: conversation counts. UPTIME:
1034
+ * health-check outcomes.
1035
+ */
1036
+ type?: 'METRIC' | 'CONVERSATION' | 'UPTIME';
1037
+ }
1038
+ namespace Measure {
1039
+ /**
1040
+ * Split the measure into one series per value of this dimension (the largest 50
1041
+ * are returned). Ignored while comparisonGroups are set: each group is then one
1042
+ * series.
1043
+ */
1044
+ interface Breakdown {
1045
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'DATASET';
1046
+ /**
1047
+ * The property to split by. Required for CALL_PROPERTY and METRIC_PROPERTY.
1048
+ */
1049
+ property?: string;
1050
+ }
1051
+ interface Filter {
1052
+ /**
1053
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
1054
+ */
1055
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
1056
+ /**
1057
+ * The value to compare against (an agent id, "call" / "chat", a property value).
1058
+ */
1059
+ value: string | number | boolean;
1060
+ /**
1061
+ * Defaults to EQUALS.
1062
+ */
1063
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
1064
+ /**
1065
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
1066
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
1067
+ */
1068
+ property?: string;
1069
+ }
1070
+ }
1071
+ interface ComparisonGroup {
1072
+ filters: Array<ComparisonGroup.Filter>;
1073
+ /**
1074
+ * The series label; unique within the query.
1075
+ */
1076
+ name: string;
1077
+ color?: 'GREEN' | 'RED' | 'ORANGE' | 'PURPLE' | 'GREY' | 'BLUE' | 'PEACH' | 'TEAL' | 'INDIGO' | 'AMBER' | 'ROSE' | 'CYAN';
1078
+ }
1079
+ namespace ComparisonGroup {
1080
+ interface Filter {
1081
+ /**
1082
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
1083
+ */
1084
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
1085
+ /**
1086
+ * The value to compare against (an agent id, "call" / "chat", a property value).
1087
+ */
1088
+ value: string | number | boolean;
1089
+ /**
1090
+ * Defaults to EQUALS.
1091
+ */
1092
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
1093
+ /**
1094
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
1095
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
1096
+ */
1097
+ property?: string;
1098
+ }
1099
+ }
1100
+ interface Filter {
1101
+ /**
1102
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
1103
+ */
1104
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
1105
+ /**
1106
+ * The value to compare against (an agent id, "call" / "chat", a property value).
1107
+ */
1108
+ value: string | number | boolean;
1109
+ /**
1110
+ * Defaults to EQUALS.
1111
+ */
1112
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
1113
+ /**
1114
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
1115
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
1116
+ */
1117
+ property?: string;
1118
+ }
1119
+ }
1120
+ }
1121
+ }
1122
+ export interface DashboardGetDataResponse {
1123
+ /**
1124
+ * Every widget's series over the window, top to bottom. A widget that fails on its
1125
+ * own (say its metric was deleted) carries `error` and no series; the others still
1126
+ * return.
1127
+ */
1128
+ data: DashboardGetDataResponse.Data;
1129
+ }
1130
+ export declare namespace DashboardGetDataResponse {
1131
+ /**
1132
+ * Every widget's series over the window, top to bottom. A widget that fails on its
1133
+ * own (say its metric was deleted) carries `error` and no series; the others still
1134
+ * return.
1135
+ */
1136
+ interface Data {
1137
+ dashboardId: string;
1138
+ from: string;
1139
+ timezone: string;
1140
+ to: string;
1141
+ widgets: Array<Data.Widget>;
1142
+ }
1143
+ namespace Data {
1144
+ interface Widget {
1145
+ blocked: boolean;
1146
+ error: string | null;
1147
+ interval: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
1148
+ name: string;
1149
+ omittedSeries: number;
1150
+ series: Array<Widget.Sery>;
1151
+ widgetId: string;
1152
+ }
1153
+ namespace Widget {
1154
+ interface Sery {
1155
+ aggregation: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
1156
+ breakdownValue: string | null;
1157
+ buckets: Array<Sery.Bucket>;
1158
+ comparisonGroup: string | null;
1159
+ comparisonValue: number | null;
1160
+ measureIndex: number;
1161
+ metric: string | null;
1162
+ percentageOfBaseline: number | null;
1163
+ sampleSize: number | null;
1164
+ type: 'METRIC' | 'CONVERSATION' | 'UPTIME';
1165
+ value: number;
1166
+ }
1167
+ namespace Sery {
1168
+ interface Bucket {
1169
+ date: string;
1170
+ value: number;
1171
+ comparisonDate?: string;
1172
+ comparisonValue?: number;
1173
+ passed?: number;
1174
+ percentageOfBaseline?: number;
1175
+ sampleSize?: number;
1176
+ }
1177
+ }
1178
+ }
1179
+ }
1180
+ }
1181
+ export interface DashboardGetWidgetDataResponse {
1182
+ data: DashboardGetWidgetDataResponse.Data;
1183
+ }
1184
+ export declare namespace DashboardGetWidgetDataResponse {
1185
+ interface Data {
1186
+ blocked: boolean;
1187
+ error: string | null;
1188
+ from: string;
1189
+ interval: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
1190
+ name: string;
1191
+ omittedSeries: number;
1192
+ series: Array<Data.Sery>;
1193
+ timezone: string;
1194
+ to: string;
1195
+ widgetId: string;
1196
+ }
1197
+ namespace Data {
1198
+ interface Sery {
1199
+ aggregation: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
1200
+ breakdownValue: string | null;
1201
+ buckets: Array<Sery.Bucket>;
1202
+ comparisonGroup: string | null;
1203
+ comparisonValue: number | null;
1204
+ measureIndex: number;
1205
+ metric: string | null;
1206
+ percentageOfBaseline: number | null;
1207
+ sampleSize: number | null;
1208
+ type: 'METRIC' | 'CONVERSATION' | 'UPTIME';
1209
+ value: number;
1210
+ }
1211
+ namespace Sery {
1212
+ interface Bucket {
1213
+ date: string;
1214
+ value: number;
1215
+ comparisonDate?: string;
1216
+ comparisonValue?: number;
1217
+ passed?: number;
1218
+ percentageOfBaseline?: number;
1219
+ sampleSize?: number;
1220
+ }
1221
+ }
1222
+ }
1223
+ }
1224
+ export interface DashboardUpdateWidgetResponse {
1225
+ data: DashboardUpdateWidgetResponse.Data;
1226
+ }
1227
+ export declare namespace DashboardUpdateWidgetResponse {
1228
+ interface Data {
1229
+ id: string;
1230
+ /**
1231
+ * What to aggregate: 1 to 10 measures.
1232
+ */
1233
+ measures: Array<Data.Measure>;
1234
+ /**
1235
+ * Unique on the dashboard: how the widget is matched on update.
1236
+ */
1237
+ name: string;
1238
+ /**
1239
+ * Run every measure once per named filter set, e.g. one group per agent.
1240
+ */
1241
+ comparisonGroups?: Array<Data.ComparisonGroup>;
1242
+ /**
1243
+ * PREVIOUS_PERIOD adds the preceding window of the same length to every series.
1244
+ */
1245
+ comparisonMode?: 'NONE' | 'PREVIOUS_PERIOD';
1246
+ description?: string;
1247
+ /**
1248
+ * Chart type. Defaults to LINE.
1249
+ */
1250
+ display?: 'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE';
1251
+ /**
1252
+ * Applied to every measure, on top of each measure's own filters.
1253
+ */
1254
+ filters?: Array<Data.Filter>;
1255
+ /**
1256
+ * Bucket size. Defaults from the window's length and steps coarser when the window
1257
+ * would exceed 500 buckets.
1258
+ */
1259
+ interval?: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
1260
+ /**
1261
+ * Grid width. Defaults to MEDIUM.
1262
+ */
1263
+ size?: 'SMALL' | 'MEDIUM' | 'LARGE' | 'EXTRA_LARGE';
1264
+ }
1265
+ namespace Data {
1266
+ interface Measure {
1267
+ /**
1268
+ * Defaults by output type: AVG for numeric metrics, COUNT (split by value) for
1269
+ * classification and text, PASS_RATE for thresholds and uptime, COUNT for
1270
+ * conversations.
1271
+ */
1272
+ aggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
1273
+ /**
1274
+ * Split the measure into one series per value of this dimension (the largest 50
1275
+ * are returned). Ignored while comparisonGroups are set: each group is then one
1276
+ * series.
1277
+ */
1278
+ breakdown?: Measure.Breakdown;
1279
+ /**
1280
+ * Chart color on a dashboard.
1281
+ */
1282
+ color?: 'GREEN' | 'RED' | 'ORANGE' | 'PURPLE' | 'GREY' | 'BLUE' | 'PEACH' | 'TEAL' | 'INDIGO' | 'AMBER' | 'ROSE' | 'CYAN';
1283
+ /**
1284
+ * CALL (default for metrics) folds each conversation to one value first, so a long
1285
+ * call does not outweigh a short one. NONE aggregates every value.
1286
+ */
1287
+ distinctBy?: 'NONE' | 'CALL';
1288
+ /**
1289
+ * Filters for this measure only, on top of the query's filters.
1290
+ */
1291
+ filters?: Array<Measure.Filter>;
1292
+ /**
1293
+ * Mark one measure as the baseline: every series also reports its value as a
1294
+ * percentage of it.
1295
+ */
1296
+ isBaseline?: boolean;
1297
+ /**
1298
+ * The metric's slug (e.g. `task_completion`) or id. Required for METRIC.
1299
+ */
1300
+ metric?: string;
1301
+ /**
1302
+ * How each conversation is folded when distinctBy is CALL. Defaults to SUM under
1303
+ * SUM, else AVG.
1304
+ */
1305
+ nestedAggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
1306
+ nestedAggregationPercentile?: number;
1307
+ /**
1308
+ * PASS_RATE condition operator. Omit for a threshold metric: its own condition is
1309
+ * used.
1310
+ */
1311
+ passOperator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
1312
+ /**
1313
+ * PASS_RATE condition value, e.g. 4 or "resolved".
1314
+ */
1315
+ passValue?: string | number | boolean;
1316
+ /**
1317
+ * Required with PERCENTILE, e.g. 95.
1318
+ */
1319
+ percentile?: number;
1320
+ /**
1321
+ * METRIC (default): a metric's values. CONVERSATION: conversation counts. UPTIME:
1322
+ * health-check outcomes.
1323
+ */
1324
+ type?: 'METRIC' | 'CONVERSATION' | 'UPTIME';
1325
+ }
1326
+ namespace Measure {
1327
+ /**
1328
+ * Split the measure into one series per value of this dimension (the largest 50
1329
+ * are returned). Ignored while comparisonGroups are set: each group is then one
1330
+ * series.
1331
+ */
1332
+ interface Breakdown {
1333
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'DATASET';
1334
+ /**
1335
+ * The property to split by. Required for CALL_PROPERTY and METRIC_PROPERTY.
1336
+ */
1337
+ property?: string;
1338
+ }
1339
+ interface Filter {
1340
+ /**
1341
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
1342
+ */
1343
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
1344
+ /**
1345
+ * The value to compare against (an agent id, "call" / "chat", a property value).
1346
+ */
1347
+ value: string | number | boolean;
1348
+ /**
1349
+ * Defaults to EQUALS.
1350
+ */
1351
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
1352
+ /**
1353
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
1354
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
1355
+ */
1356
+ property?: string;
1357
+ }
1358
+ }
1359
+ interface ComparisonGroup {
1360
+ filters: Array<ComparisonGroup.Filter>;
1361
+ /**
1362
+ * The series label; unique within the query.
1363
+ */
1364
+ name: string;
1365
+ color?: 'GREEN' | 'RED' | 'ORANGE' | 'PURPLE' | 'GREY' | 'BLUE' | 'PEACH' | 'TEAL' | 'INDIGO' | 'AMBER' | 'ROSE' | 'CYAN';
1366
+ }
1367
+ namespace ComparisonGroup {
1368
+ interface Filter {
1369
+ /**
1370
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
1371
+ */
1372
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
1373
+ /**
1374
+ * The value to compare against (an agent id, "call" / "chat", a property value).
1375
+ */
1376
+ value: string | number | boolean;
1377
+ /**
1378
+ * Defaults to EQUALS.
1379
+ */
1380
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
1381
+ /**
1382
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
1383
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
1384
+ */
1385
+ property?: string;
1386
+ }
1387
+ }
1388
+ interface Filter {
1389
+ /**
1390
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
1391
+ */
1392
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
1393
+ /**
1394
+ * The value to compare against (an agent id, "call" / "chat", a property value).
1395
+ */
1396
+ value: string | number | boolean;
1397
+ /**
1398
+ * Defaults to EQUALS.
1399
+ */
1400
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
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
+ export interface DashboardCreateParams {
1410
+ name: string;
1411
+ description?: string;
1412
+ filters?: Array<DashboardCreateParams.Filter>;
1413
+ isDefault?: boolean;
1414
+ /**
1415
+ * The window: LAST n DAYS/WEEKS/MONTHS up to now, a CALENDAR_ALIGNED period
1416
+ * (TODAY, YESTERDAY, THIS_WEEK, LAST_WEEK, THIS_MONTH, LAST_MONTH, THIS_YEAR,
1417
+ * LAST_YEAR), FIXED from/to, or SINCE a date. At most 731 days (two years).
1418
+ */
1419
+ timeRange?: DashboardCreateParams.UnionMember0 | DashboardCreateParams.UnionMember1 | DashboardCreateParams.UnionMember2 | DashboardCreateParams.UnionMember3;
1420
+ widgets?: Array<DashboardCreateParams.Widget>;
1421
+ }
1422
+ export declare namespace DashboardCreateParams {
1423
+ interface Filter {
1424
+ /**
1425
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
1426
+ */
1427
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
1428
+ /**
1429
+ * The value to compare against (an agent id, "call" / "chat", a property value).
1430
+ */
1431
+ value: string | number | boolean;
1432
+ /**
1433
+ * Defaults to EQUALS.
1434
+ */
1435
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
1436
+ /**
1437
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
1438
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
1439
+ */
1440
+ property?: string;
1441
+ }
1442
+ interface UnionMember0 {
1443
+ type: 'LAST';
1444
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS';
1445
+ value: number;
1446
+ }
1447
+ interface UnionMember1 {
1448
+ period: 'TODAY' | 'YESTERDAY' | 'THIS_WEEK' | 'LAST_WEEK' | 'THIS_MONTH' | 'LAST_MONTH' | 'THIS_YEAR' | 'LAST_YEAR';
1449
+ type: 'CALENDAR_ALIGNED';
1450
+ }
1451
+ interface UnionMember2 {
1452
+ from: string;
1453
+ to: string;
1454
+ type: 'FIXED';
1455
+ }
1456
+ interface UnionMember3 {
1457
+ from: string;
1458
+ type: 'SINCE';
1459
+ }
1460
+ interface Widget {
1461
+ /**
1462
+ * What to aggregate: 1 to 10 measures.
1463
+ */
1464
+ measures: Array<Widget.Measure>;
1465
+ /**
1466
+ * Unique on the dashboard: how the widget is matched on update.
1467
+ */
1468
+ name: string;
1469
+ /**
1470
+ * Run every measure once per named filter set, e.g. one group per agent.
1471
+ */
1472
+ comparisonGroups?: Array<Widget.ComparisonGroup>;
1473
+ /**
1474
+ * PREVIOUS_PERIOD adds the preceding window of the same length to every series.
1475
+ */
1476
+ comparisonMode?: 'NONE' | 'PREVIOUS_PERIOD';
1477
+ description?: string;
1478
+ /**
1479
+ * Chart type. Defaults to LINE.
1480
+ */
1481
+ display?: 'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE';
1482
+ /**
1483
+ * Applied to every measure, on top of each measure's own filters.
1484
+ */
1485
+ filters?: Array<Widget.Filter>;
1486
+ /**
1487
+ * Bucket size. Defaults from the window's length and steps coarser when the window
1488
+ * would exceed 500 buckets.
1489
+ */
1490
+ interval?: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
1491
+ /**
1492
+ * Grid width. Defaults to MEDIUM.
1493
+ */
1494
+ size?: 'SMALL' | 'MEDIUM' | 'LARGE' | 'EXTRA_LARGE';
1495
+ }
1496
+ namespace Widget {
1497
+ interface Measure {
1498
+ /**
1499
+ * Defaults by output type: AVG for numeric metrics, COUNT (split by value) for
1500
+ * classification and text, PASS_RATE for thresholds and uptime, COUNT for
1501
+ * conversations.
1502
+ */
1503
+ aggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
1504
+ /**
1505
+ * Split the measure into one series per value of this dimension (the largest 50
1506
+ * are returned). Ignored while comparisonGroups are set: each group is then one
1507
+ * series.
1508
+ */
1509
+ breakdown?: Measure.Breakdown;
1510
+ /**
1511
+ * Chart color on a dashboard.
1512
+ */
1513
+ color?: 'GREEN' | 'RED' | 'ORANGE' | 'PURPLE' | 'GREY' | 'BLUE' | 'PEACH' | 'TEAL' | 'INDIGO' | 'AMBER' | 'ROSE' | 'CYAN';
1514
+ /**
1515
+ * CALL (default for metrics) folds each conversation to one value first, so a long
1516
+ * call does not outweigh a short one. NONE aggregates every value.
1517
+ */
1518
+ distinctBy?: 'NONE' | 'CALL';
1519
+ /**
1520
+ * Filters for this measure only, on top of the query's filters.
1521
+ */
1522
+ filters?: Array<Measure.Filter>;
1523
+ /**
1524
+ * Mark one measure as the baseline: every series also reports its value as a
1525
+ * percentage of it.
1526
+ */
1527
+ isBaseline?: boolean;
1528
+ /**
1529
+ * The metric's slug (e.g. `task_completion`) or id. Required for METRIC.
1530
+ */
1531
+ metric?: string;
1532
+ /**
1533
+ * How each conversation is folded when distinctBy is CALL. Defaults to SUM under
1534
+ * SUM, else AVG.
1535
+ */
1536
+ nestedAggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
1537
+ nestedAggregationPercentile?: number;
1538
+ /**
1539
+ * PASS_RATE condition operator. Omit for a threshold metric: its own condition is
1540
+ * used.
1541
+ */
1542
+ passOperator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
1543
+ /**
1544
+ * PASS_RATE condition value, e.g. 4 or "resolved".
1545
+ */
1546
+ passValue?: string | number | boolean;
1547
+ /**
1548
+ * Required with PERCENTILE, e.g. 95.
1549
+ */
1550
+ percentile?: number;
1551
+ /**
1552
+ * METRIC (default): a metric's values. CONVERSATION: conversation counts. UPTIME:
1553
+ * health-check outcomes.
1554
+ */
1555
+ type?: 'METRIC' | 'CONVERSATION' | 'UPTIME';
1556
+ }
1557
+ namespace Measure {
1558
+ /**
1559
+ * Split the measure into one series per value of this dimension (the largest 50
1560
+ * are returned). Ignored while comparisonGroups are set: each group is then one
1561
+ * series.
1562
+ */
1563
+ interface Breakdown {
1564
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'DATASET';
1565
+ /**
1566
+ * The property to split by. Required for CALL_PROPERTY and METRIC_PROPERTY.
1567
+ */
1568
+ property?: string;
1569
+ }
1570
+ interface Filter {
1571
+ /**
1572
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
1573
+ */
1574
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
1575
+ /**
1576
+ * The value to compare against (an agent id, "call" / "chat", a property value).
1577
+ */
1578
+ value: string | number | boolean;
1579
+ /**
1580
+ * Defaults to EQUALS.
1581
+ */
1582
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
1583
+ /**
1584
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
1585
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
1586
+ */
1587
+ property?: string;
1588
+ }
1589
+ }
1590
+ interface ComparisonGroup {
1591
+ filters: Array<ComparisonGroup.Filter>;
1592
+ /**
1593
+ * The series label; unique within the query.
1594
+ */
1595
+ name: string;
1596
+ color?: 'GREEN' | 'RED' | 'ORANGE' | 'PURPLE' | 'GREY' | 'BLUE' | 'PEACH' | 'TEAL' | 'INDIGO' | 'AMBER' | 'ROSE' | 'CYAN';
1597
+ }
1598
+ namespace ComparisonGroup {
1599
+ interface Filter {
1600
+ /**
1601
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
1602
+ */
1603
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
1604
+ /**
1605
+ * The value to compare against (an agent id, "call" / "chat", a property value).
1606
+ */
1607
+ value: string | number | boolean;
1608
+ /**
1609
+ * Defaults to EQUALS.
1610
+ */
1611
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
1612
+ /**
1613
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
1614
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
1615
+ */
1616
+ property?: string;
1617
+ }
1618
+ }
1619
+ interface Filter {
1620
+ /**
1621
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
1622
+ */
1623
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
1624
+ /**
1625
+ * The value to compare against (an agent id, "call" / "chat", a property value).
1626
+ */
1627
+ value: string | number | boolean;
1628
+ /**
1629
+ * Defaults to EQUALS.
1630
+ */
1631
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
1632
+ /**
1633
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
1634
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
1635
+ */
1636
+ property?: string;
1637
+ }
1638
+ }
1639
+ }
1640
+ export interface DashboardUpdateParams {
1641
+ description?: string;
1642
+ filters?: Array<DashboardUpdateParams.Filter>;
1643
+ isDefault?: boolean;
1644
+ name?: string;
1645
+ /**
1646
+ * The window: LAST n DAYS/WEEKS/MONTHS up to now, a CALENDAR_ALIGNED period
1647
+ * (TODAY, YESTERDAY, THIS_WEEK, LAST_WEEK, THIS_MONTH, LAST_MONTH, THIS_YEAR,
1648
+ * LAST_YEAR), FIXED from/to, or SINCE a date. At most 731 days (two years).
1649
+ */
1650
+ timeRange?: DashboardUpdateParams.UnionMember0 | DashboardUpdateParams.UnionMember1 | DashboardUpdateParams.UnionMember2 | DashboardUpdateParams.UnionMember3;
1651
+ widgets?: Array<DashboardUpdateParams.Widget>;
1652
+ }
1653
+ export declare namespace DashboardUpdateParams {
1654
+ interface Filter {
1655
+ /**
1656
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
1657
+ */
1658
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
1659
+ /**
1660
+ * The value to compare against (an agent id, "call" / "chat", a property value).
1661
+ */
1662
+ value: string | number | boolean;
1663
+ /**
1664
+ * Defaults to EQUALS.
1665
+ */
1666
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
1667
+ /**
1668
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
1669
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
1670
+ */
1671
+ property?: string;
1672
+ }
1673
+ interface UnionMember0 {
1674
+ type: 'LAST';
1675
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS';
1676
+ value: number;
1677
+ }
1678
+ interface UnionMember1 {
1679
+ period: 'TODAY' | 'YESTERDAY' | 'THIS_WEEK' | 'LAST_WEEK' | 'THIS_MONTH' | 'LAST_MONTH' | 'THIS_YEAR' | 'LAST_YEAR';
1680
+ type: 'CALENDAR_ALIGNED';
1681
+ }
1682
+ interface UnionMember2 {
1683
+ from: string;
1684
+ to: string;
1685
+ type: 'FIXED';
1686
+ }
1687
+ interface UnionMember3 {
1688
+ from: string;
1689
+ type: 'SINCE';
1690
+ }
1691
+ interface Widget {
1692
+ /**
1693
+ * What to aggregate: 1 to 10 measures.
1694
+ */
1695
+ measures: Array<Widget.Measure>;
1696
+ /**
1697
+ * Unique on the dashboard: how the widget is matched on update.
1698
+ */
1699
+ name: string;
1700
+ /**
1701
+ * Run every measure once per named filter set, e.g. one group per agent.
1702
+ */
1703
+ comparisonGroups?: Array<Widget.ComparisonGroup>;
1704
+ /**
1705
+ * PREVIOUS_PERIOD adds the preceding window of the same length to every series.
1706
+ */
1707
+ comparisonMode?: 'NONE' | 'PREVIOUS_PERIOD';
1708
+ description?: string;
1709
+ /**
1710
+ * Chart type. Defaults to LINE.
1711
+ */
1712
+ display?: 'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE';
1713
+ /**
1714
+ * Applied to every measure, on top of each measure's own filters.
1715
+ */
1716
+ filters?: Array<Widget.Filter>;
1717
+ /**
1718
+ * Bucket size. Defaults from the window's length and steps coarser when the window
1719
+ * would exceed 500 buckets.
1720
+ */
1721
+ interval?: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
1722
+ /**
1723
+ * Grid width. Defaults to MEDIUM.
1724
+ */
1725
+ size?: 'SMALL' | 'MEDIUM' | 'LARGE' | 'EXTRA_LARGE';
1726
+ }
1727
+ namespace Widget {
1728
+ interface Measure {
1729
+ /**
1730
+ * Defaults by output type: AVG for numeric metrics, COUNT (split by value) for
1731
+ * classification and text, PASS_RATE for thresholds and uptime, COUNT for
1732
+ * conversations.
1733
+ */
1734
+ aggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
1735
+ /**
1736
+ * Split the measure into one series per value of this dimension (the largest 50
1737
+ * are returned). Ignored while comparisonGroups are set: each group is then one
1738
+ * series.
1739
+ */
1740
+ breakdown?: Measure.Breakdown;
1741
+ /**
1742
+ * Chart color on a dashboard.
1743
+ */
1744
+ color?: 'GREEN' | 'RED' | 'ORANGE' | 'PURPLE' | 'GREY' | 'BLUE' | 'PEACH' | 'TEAL' | 'INDIGO' | 'AMBER' | 'ROSE' | 'CYAN';
1745
+ /**
1746
+ * CALL (default for metrics) folds each conversation to one value first, so a long
1747
+ * call does not outweigh a short one. NONE aggregates every value.
1748
+ */
1749
+ distinctBy?: 'NONE' | 'CALL';
1750
+ /**
1751
+ * Filters for this measure only, on top of the query's filters.
1752
+ */
1753
+ filters?: Array<Measure.Filter>;
1754
+ /**
1755
+ * Mark one measure as the baseline: every series also reports its value as a
1756
+ * percentage of it.
1757
+ */
1758
+ isBaseline?: boolean;
1759
+ /**
1760
+ * The metric's slug (e.g. `task_completion`) or id. Required for METRIC.
1761
+ */
1762
+ metric?: string;
1763
+ /**
1764
+ * How each conversation is folded when distinctBy is CALL. Defaults to SUM under
1765
+ * SUM, else AVG.
1766
+ */
1767
+ nestedAggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
1768
+ nestedAggregationPercentile?: number;
1769
+ /**
1770
+ * PASS_RATE condition operator. Omit for a threshold metric: its own condition is
1771
+ * used.
1772
+ */
1773
+ passOperator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
1774
+ /**
1775
+ * PASS_RATE condition value, e.g. 4 or "resolved".
1776
+ */
1777
+ passValue?: string | number | boolean;
1778
+ /**
1779
+ * Required with PERCENTILE, e.g. 95.
1780
+ */
1781
+ percentile?: number;
1782
+ /**
1783
+ * METRIC (default): a metric's values. CONVERSATION: conversation counts. UPTIME:
1784
+ * health-check outcomes.
1785
+ */
1786
+ type?: 'METRIC' | 'CONVERSATION' | 'UPTIME';
1787
+ }
1788
+ namespace Measure {
1789
+ /**
1790
+ * Split the measure into one series per value of this dimension (the largest 50
1791
+ * are returned). Ignored while comparisonGroups are set: each group is then one
1792
+ * series.
1793
+ */
1794
+ interface Breakdown {
1795
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'DATASET';
1796
+ /**
1797
+ * The property to split by. Required for CALL_PROPERTY and METRIC_PROPERTY.
1798
+ */
1799
+ property?: string;
1800
+ }
1801
+ interface Filter {
1802
+ /**
1803
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
1804
+ */
1805
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
1806
+ /**
1807
+ * The value to compare against (an agent id, "call" / "chat", a property value).
1808
+ */
1809
+ value: string | number | boolean;
1810
+ /**
1811
+ * Defaults to EQUALS.
1812
+ */
1813
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
1814
+ /**
1815
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
1816
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
1817
+ */
1818
+ property?: string;
1819
+ }
1820
+ }
1821
+ interface ComparisonGroup {
1822
+ filters: Array<ComparisonGroup.Filter>;
1823
+ /**
1824
+ * The series label; unique within the query.
1825
+ */
1826
+ name: string;
1827
+ color?: 'GREEN' | 'RED' | 'ORANGE' | 'PURPLE' | 'GREY' | 'BLUE' | 'PEACH' | 'TEAL' | 'INDIGO' | 'AMBER' | 'ROSE' | 'CYAN';
1828
+ }
1829
+ namespace ComparisonGroup {
1830
+ interface Filter {
1831
+ /**
1832
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
1833
+ */
1834
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
1835
+ /**
1836
+ * The value to compare against (an agent id, "call" / "chat", a property value).
1837
+ */
1838
+ value: string | number | boolean;
1839
+ /**
1840
+ * Defaults to EQUALS.
1841
+ */
1842
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
1843
+ /**
1844
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
1845
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
1846
+ */
1847
+ property?: string;
1848
+ }
1849
+ }
1850
+ interface Filter {
1851
+ /**
1852
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
1853
+ */
1854
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
1855
+ /**
1856
+ * The value to compare against (an agent id, "call" / "chat", a property value).
1857
+ */
1858
+ value: string | number | boolean;
1859
+ /**
1860
+ * Defaults to EQUALS.
1861
+ */
1862
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
1863
+ /**
1864
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
1865
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
1866
+ */
1867
+ property?: string;
1868
+ }
1869
+ }
1870
+ }
1871
+ export interface DashboardCreateWidgetParams {
1872
+ /**
1873
+ * What to aggregate: 1 to 10 measures.
1874
+ */
1875
+ measures: Array<DashboardCreateWidgetParams.Measure>;
1876
+ /**
1877
+ * Unique on the dashboard: how the widget is matched on update.
1878
+ */
1879
+ name: string;
1880
+ /**
1881
+ * Run every measure once per named filter set, e.g. one group per agent.
1882
+ */
1883
+ comparisonGroups?: Array<DashboardCreateWidgetParams.ComparisonGroup>;
1884
+ /**
1885
+ * PREVIOUS_PERIOD adds the preceding window of the same length to every series.
1886
+ */
1887
+ comparisonMode?: 'NONE' | 'PREVIOUS_PERIOD';
1888
+ description?: string;
1889
+ /**
1890
+ * Chart type. Defaults to LINE.
1891
+ */
1892
+ display?: 'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE';
1893
+ /**
1894
+ * Applied to every measure, on top of each measure's own filters.
1895
+ */
1896
+ filters?: Array<DashboardCreateWidgetParams.Filter>;
1897
+ /**
1898
+ * Bucket size. Defaults from the window's length and steps coarser when the window
1899
+ * would exceed 500 buckets.
1900
+ */
1901
+ interval?: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
1902
+ /**
1903
+ * Grid width. Defaults to MEDIUM.
1904
+ */
1905
+ size?: 'SMALL' | 'MEDIUM' | 'LARGE' | 'EXTRA_LARGE';
1906
+ }
1907
+ export declare namespace DashboardCreateWidgetParams {
1908
+ interface Measure {
1909
+ /**
1910
+ * Defaults by output type: AVG for numeric metrics, COUNT (split by value) for
1911
+ * classification and text, PASS_RATE for thresholds and uptime, COUNT for
1912
+ * conversations.
1913
+ */
1914
+ aggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
1915
+ /**
1916
+ * Split the measure into one series per value of this dimension (the largest 50
1917
+ * are returned). Ignored while comparisonGroups are set: each group is then one
1918
+ * series.
1919
+ */
1920
+ breakdown?: Measure.Breakdown;
1921
+ /**
1922
+ * Chart color on a dashboard.
1923
+ */
1924
+ color?: 'GREEN' | 'RED' | 'ORANGE' | 'PURPLE' | 'GREY' | 'BLUE' | 'PEACH' | 'TEAL' | 'INDIGO' | 'AMBER' | 'ROSE' | 'CYAN';
1925
+ /**
1926
+ * CALL (default for metrics) folds each conversation to one value first, so a long
1927
+ * call does not outweigh a short one. NONE aggregates every value.
1928
+ */
1929
+ distinctBy?: 'NONE' | 'CALL';
1930
+ /**
1931
+ * Filters for this measure only, on top of the query's filters.
1932
+ */
1933
+ filters?: Array<Measure.Filter>;
1934
+ /**
1935
+ * Mark one measure as the baseline: every series also reports its value as a
1936
+ * percentage of it.
1937
+ */
1938
+ isBaseline?: boolean;
1939
+ /**
1940
+ * The metric's slug (e.g. `task_completion`) or id. Required for METRIC.
1941
+ */
1942
+ metric?: string;
1943
+ /**
1944
+ * How each conversation is folded when distinctBy is CALL. Defaults to SUM under
1945
+ * SUM, else AVG.
1946
+ */
1947
+ nestedAggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
1948
+ nestedAggregationPercentile?: number;
1949
+ /**
1950
+ * PASS_RATE condition operator. Omit for a threshold metric: its own condition is
1951
+ * used.
1952
+ */
1953
+ passOperator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
1954
+ /**
1955
+ * PASS_RATE condition value, e.g. 4 or "resolved".
1956
+ */
1957
+ passValue?: string | number | boolean;
1958
+ /**
1959
+ * Required with PERCENTILE, e.g. 95.
1960
+ */
1961
+ percentile?: number;
1962
+ /**
1963
+ * METRIC (default): a metric's values. CONVERSATION: conversation counts. UPTIME:
1964
+ * health-check outcomes.
1965
+ */
1966
+ type?: 'METRIC' | 'CONVERSATION' | 'UPTIME';
1967
+ }
1968
+ namespace Measure {
1969
+ /**
1970
+ * Split the measure into one series per value of this dimension (the largest 50
1971
+ * are returned). Ignored while comparisonGroups are set: each group is then one
1972
+ * series.
1973
+ */
1974
+ interface Breakdown {
1975
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'DATASET';
1976
+ /**
1977
+ * The property to split by. Required for CALL_PROPERTY and METRIC_PROPERTY.
1978
+ */
1979
+ property?: string;
1980
+ }
1981
+ interface Filter {
1982
+ /**
1983
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
1984
+ */
1985
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
1986
+ /**
1987
+ * The value to compare against (an agent id, "call" / "chat", a property value).
1988
+ */
1989
+ value: string | number | boolean;
1990
+ /**
1991
+ * Defaults to EQUALS.
1992
+ */
1993
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
1994
+ /**
1995
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
1996
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
1997
+ */
1998
+ property?: string;
1999
+ }
2000
+ }
2001
+ interface ComparisonGroup {
2002
+ filters: Array<ComparisonGroup.Filter>;
2003
+ /**
2004
+ * The series label; unique within the query.
2005
+ */
2006
+ name: string;
2007
+ color?: 'GREEN' | 'RED' | 'ORANGE' | 'PURPLE' | 'GREY' | 'BLUE' | 'PEACH' | 'TEAL' | 'INDIGO' | 'AMBER' | 'ROSE' | 'CYAN';
2008
+ }
2009
+ namespace ComparisonGroup {
2010
+ interface Filter {
2011
+ /**
2012
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
2013
+ */
2014
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
2015
+ /**
2016
+ * The value to compare against (an agent id, "call" / "chat", a property value).
2017
+ */
2018
+ value: string | number | boolean;
2019
+ /**
2020
+ * Defaults to EQUALS.
2021
+ */
2022
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
2023
+ /**
2024
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
2025
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
2026
+ */
2027
+ property?: string;
2028
+ }
2029
+ }
2030
+ interface Filter {
2031
+ /**
2032
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
2033
+ */
2034
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
2035
+ /**
2036
+ * The value to compare against (an agent id, "call" / "chat", a property value).
2037
+ */
2038
+ value: string | number | boolean;
2039
+ /**
2040
+ * Defaults to EQUALS.
2041
+ */
2042
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
2043
+ /**
2044
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
2045
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
2046
+ */
2047
+ property?: string;
2048
+ }
2049
+ }
2050
+ export interface DashboardDeleteWidgetParams {
2051
+ /**
2052
+ * The dashboard ID
2053
+ */
2054
+ dashboardId: string;
2055
+ }
2056
+ export interface DashboardGetDataParams {
2057
+ /**
2058
+ * ISO 8601 start. Overrides the saved window; without `to`, runs until now.
2059
+ */
2060
+ from?: string;
2061
+ /**
2062
+ * IANA zone buckets and calendar periods align to. Default UTC.
2063
+ */
2064
+ timezone?: string;
2065
+ /**
2066
+ * ISO 8601 end. Requires `from`.
2067
+ */
2068
+ to?: string;
2069
+ }
2070
+ export interface DashboardGetWidgetDataParams {
2071
+ /**
2072
+ * Path param
2073
+ */
2074
+ dashboardId: string;
2075
+ /**
2076
+ * Query param: ISO 8601 start. Overrides the saved window; without `to`, runs
2077
+ * until now.
2078
+ */
2079
+ from?: string;
2080
+ /**
2081
+ * Query param: IANA zone buckets and calendar periods align to. Default UTC.
2082
+ */
2083
+ timezone?: string;
2084
+ /**
2085
+ * Query param: ISO 8601 end. Requires `from`.
2086
+ */
2087
+ to?: string;
2088
+ }
2089
+ export interface DashboardUpdateWidgetParams {
2090
+ /**
2091
+ * Path param: The dashboard ID
2092
+ */
2093
+ dashboardId: string;
2094
+ /**
2095
+ * Body param: What to aggregate: 1 to 10 measures.
2096
+ */
2097
+ measures: Array<DashboardUpdateWidgetParams.Measure>;
2098
+ /**
2099
+ * Body param: Unique on the dashboard: how the widget is matched on update.
2100
+ */
2101
+ name: string;
2102
+ /**
2103
+ * Body param: Run every measure once per named filter set, e.g. one group per
2104
+ * agent.
2105
+ */
2106
+ comparisonGroups?: Array<DashboardUpdateWidgetParams.ComparisonGroup>;
2107
+ /**
2108
+ * Body param: PREVIOUS_PERIOD adds the preceding window of the same length to
2109
+ * every series.
2110
+ */
2111
+ comparisonMode?: 'NONE' | 'PREVIOUS_PERIOD';
2112
+ /**
2113
+ * Body param
2114
+ */
2115
+ description?: string;
2116
+ /**
2117
+ * Body param: Chart type. Defaults to LINE.
2118
+ */
2119
+ display?: 'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE';
2120
+ /**
2121
+ * Body param: Applied to every measure, on top of each measure's own filters.
2122
+ */
2123
+ filters?: Array<DashboardUpdateWidgetParams.Filter>;
2124
+ /**
2125
+ * Body param: Bucket size. Defaults from the window's length and steps coarser
2126
+ * when the window would exceed 500 buckets.
2127
+ */
2128
+ interval?: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
2129
+ /**
2130
+ * Body param: Grid width. Defaults to MEDIUM.
2131
+ */
2132
+ size?: 'SMALL' | 'MEDIUM' | 'LARGE' | 'EXTRA_LARGE';
2133
+ }
2134
+ export declare namespace DashboardUpdateWidgetParams {
2135
+ interface Measure {
2136
+ /**
2137
+ * Defaults by output type: AVG for numeric metrics, COUNT (split by value) for
2138
+ * classification and text, PASS_RATE for thresholds and uptime, COUNT for
2139
+ * conversations.
2140
+ */
2141
+ aggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
2142
+ /**
2143
+ * Split the measure into one series per value of this dimension (the largest 50
2144
+ * are returned). Ignored while comparisonGroups are set: each group is then one
2145
+ * series.
2146
+ */
2147
+ breakdown?: Measure.Breakdown;
2148
+ /**
2149
+ * Chart color on a dashboard.
2150
+ */
2151
+ color?: 'GREEN' | 'RED' | 'ORANGE' | 'PURPLE' | 'GREY' | 'BLUE' | 'PEACH' | 'TEAL' | 'INDIGO' | 'AMBER' | 'ROSE' | 'CYAN';
2152
+ /**
2153
+ * CALL (default for metrics) folds each conversation to one value first, so a long
2154
+ * call does not outweigh a short one. NONE aggregates every value.
2155
+ */
2156
+ distinctBy?: 'NONE' | 'CALL';
2157
+ /**
2158
+ * Filters for this measure only, on top of the query's filters.
2159
+ */
2160
+ filters?: Array<Measure.Filter>;
2161
+ /**
2162
+ * Mark one measure as the baseline: every series also reports its value as a
2163
+ * percentage of it.
2164
+ */
2165
+ isBaseline?: boolean;
2166
+ /**
2167
+ * The metric's slug (e.g. `task_completion`) or id. Required for METRIC.
2168
+ */
2169
+ metric?: string;
2170
+ /**
2171
+ * How each conversation is folded when distinctBy is CALL. Defaults to SUM under
2172
+ * SUM, else AVG.
2173
+ */
2174
+ nestedAggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
2175
+ nestedAggregationPercentile?: number;
2176
+ /**
2177
+ * PASS_RATE condition operator. Omit for a threshold metric: its own condition is
2178
+ * used.
2179
+ */
2180
+ passOperator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
2181
+ /**
2182
+ * PASS_RATE condition value, e.g. 4 or "resolved".
2183
+ */
2184
+ passValue?: string | number | boolean;
2185
+ /**
2186
+ * Required with PERCENTILE, e.g. 95.
2187
+ */
2188
+ percentile?: number;
2189
+ /**
2190
+ * METRIC (default): a metric's values. CONVERSATION: conversation counts. UPTIME:
2191
+ * health-check outcomes.
2192
+ */
2193
+ type?: 'METRIC' | 'CONVERSATION' | 'UPTIME';
2194
+ }
2195
+ namespace Measure {
2196
+ /**
2197
+ * Split the measure into one series per value of this dimension (the largest 50
2198
+ * are returned). Ignored while comparisonGroups are set: each group is then one
2199
+ * series.
2200
+ */
2201
+ interface Breakdown {
2202
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'DATASET';
2203
+ /**
2204
+ * The property to split by. Required for CALL_PROPERTY and METRIC_PROPERTY.
2205
+ */
2206
+ property?: string;
2207
+ }
2208
+ interface Filter {
2209
+ /**
2210
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
2211
+ */
2212
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
2213
+ /**
2214
+ * The value to compare against (an agent id, "call" / "chat", a property value).
2215
+ */
2216
+ value: string | number | boolean;
2217
+ /**
2218
+ * Defaults to EQUALS.
2219
+ */
2220
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
2221
+ /**
2222
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
2223
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
2224
+ */
2225
+ property?: string;
2226
+ }
2227
+ }
2228
+ interface ComparisonGroup {
2229
+ filters: Array<ComparisonGroup.Filter>;
2230
+ /**
2231
+ * The series label; unique within the query.
2232
+ */
2233
+ name: string;
2234
+ color?: 'GREEN' | 'RED' | 'ORANGE' | 'PURPLE' | 'GREY' | 'BLUE' | 'PEACH' | 'TEAL' | 'INDIGO' | 'AMBER' | 'ROSE' | 'CYAN';
2235
+ }
2236
+ namespace ComparisonGroup {
2237
+ interface Filter {
2238
+ /**
2239
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
2240
+ */
2241
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
2242
+ /**
2243
+ * The value to compare against (an agent id, "call" / "chat", a property value).
2244
+ */
2245
+ value: string | number | boolean;
2246
+ /**
2247
+ * Defaults to EQUALS.
2248
+ */
2249
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
2250
+ /**
2251
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
2252
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
2253
+ */
2254
+ property?: string;
2255
+ }
2256
+ }
2257
+ interface Filter {
2258
+ /**
2259
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
2260
+ */
2261
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'CALL_ID' | 'MODALITY' | 'DATASET' | 'METRIC_VALUE';
2262
+ /**
2263
+ * The value to compare against (an agent id, "call" / "chat", a property value).
2264
+ */
2265
+ value: string | number | boolean;
2266
+ /**
2267
+ * Defaults to EQUALS.
2268
+ */
2269
+ operator?: 'EQUALS' | 'NOT_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'CONTAINS' | 'STARTS_WITH';
2270
+ /**
2271
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
2272
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
2273
+ */
2274
+ property?: string;
2275
+ }
2276
+ }
2277
+ export declare namespace Dashboard {
2278
+ export { type DashboardCreateResponse as DashboardCreateResponse, type DashboardUpdateResponse as DashboardUpdateResponse, type DashboardListResponse as DashboardListResponse, type DashboardDeleteResponse as DashboardDeleteResponse, type DashboardCreateWidgetResponse as DashboardCreateWidgetResponse, type DashboardDeleteWidgetResponse as DashboardDeleteWidgetResponse, type DashboardGetByIDResponse as DashboardGetByIDResponse, type DashboardGetDataResponse as DashboardGetDataResponse, type DashboardGetWidgetDataResponse as DashboardGetWidgetDataResponse, type DashboardUpdateWidgetResponse as DashboardUpdateWidgetResponse, type DashboardCreateParams as DashboardCreateParams, type DashboardUpdateParams as DashboardUpdateParams, type DashboardCreateWidgetParams as DashboardCreateWidgetParams, type DashboardDeleteWidgetParams as DashboardDeleteWidgetParams, type DashboardGetDataParams as DashboardGetDataParams, type DashboardGetWidgetDataParams as DashboardGetWidgetDataParams, type DashboardUpdateWidgetParams as DashboardUpdateWidgetParams, };
2279
+ }
2280
+ //# sourceMappingURL=dashboard.d.ts.map