@roarkanalytics/sdk 5.7.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 (62) hide show
  1. package/CHANGELOG.md +26 -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 +626 -14
  20. package/resources/config.d.mts.map +1 -1
  21. package/resources/config.d.ts +626 -14
  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/metric-policy.d.mts +311 -2
  40. package/resources/metric-policy.d.mts.map +1 -1
  41. package/resources/metric-policy.d.ts +311 -2
  42. package/resources/metric-policy.d.ts.map +1 -1
  43. package/resources/usage.d.mts +114 -0
  44. package/resources/usage.d.mts.map +1 -0
  45. package/resources/usage.d.ts +114 -0
  46. package/resources/usage.d.ts.map +1 -0
  47. package/resources/usage.js +27 -0
  48. package/resources/usage.js.map +1 -0
  49. package/resources/usage.mjs +23 -0
  50. package/resources/usage.mjs.map +1 -0
  51. package/src/client.ts +63 -0
  52. package/src/resources/analytics.ts +573 -0
  53. package/src/resources/config.ts +1498 -26
  54. package/src/resources/dashboard.ts +3752 -0
  55. package/src/resources/index.ts +27 -0
  56. package/src/resources/metric-policy.ts +353 -2
  57. package/src/resources/usage.ts +147 -0
  58. package/src/version.ts +1 -1
  59. package/version.d.mts +1 -1
  60. package/version.d.ts +1 -1
  61. package/version.js +1 -1
  62. package/version.mjs +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.js","sourceRoot":"","sources":["../src/resources/usage.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;;;;;OAcG;IACH,GAAG,CAAC,KAAqB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;CACF;AAnBD,sBAmBC"}
@@ -0,0 +1,23 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../core/resource.mjs";
3
+ export class Usage extends APIResource {
4
+ /**
5
+ * Report billable usage and cost for the organization over a time window, broken
6
+ * down by project (highest spend first). Pass `from`/`to` as ISO 8601 timestamps;
7
+ * optionally pass `projectId` to scope the report to one project. Amounts are
8
+ * billable spend only (what we absorb is never included). Authenticated by an
9
+ * organization API key with the `usage:read` permission.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const usage = await client.usage.get({
14
+ * from: '2026-09-01T00:00:00Z',
15
+ * to: '2026-10-01T00:00:00Z',
16
+ * });
17
+ * ```
18
+ */
19
+ get(query, options) {
20
+ return this._client.get('/v1/usage', { query, ...options });
21
+ }
22
+ }
23
+ //# sourceMappingURL=usage.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.mjs","sourceRoot":"","sources":["../src/resources/usage.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAI/C,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;OAcG;IACH,GAAG,CAAC,KAAqB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;CACF"}
package/src/client.ts CHANGED
@@ -59,6 +59,12 @@ import {
59
59
  AgentPromptUpdateParams,
60
60
  AgentPromptUpdateResponse,
61
61
  } from './resources/agent-prompt';
62
+ import {
63
+ Analytics,
64
+ AnalyticsGetSchemaResponse,
65
+ AnalyticsQueryParams,
66
+ AnalyticsQueryResponse,
67
+ } from './resources/analytics';
62
68
  import {
63
69
  AutoimproveJob,
64
70
  AutoimproveJobAnswerQuestionParams,
@@ -143,6 +149,26 @@ import {
143
149
  CustomerFlowEdgeCaseUpdateParams,
144
150
  CustomerFlowEdgeCaseUpdateResponse,
145
151
  } from './resources/customer-flow-edge-case';
152
+ import {
153
+ Dashboard,
154
+ DashboardCreateParams,
155
+ DashboardCreateResponse,
156
+ DashboardCreateWidgetParams,
157
+ DashboardCreateWidgetResponse,
158
+ DashboardDeleteResponse,
159
+ DashboardDeleteWidgetParams,
160
+ DashboardDeleteWidgetResponse,
161
+ DashboardGetByIDResponse,
162
+ DashboardGetDataParams,
163
+ DashboardGetDataResponse,
164
+ DashboardGetWidgetDataParams,
165
+ DashboardGetWidgetDataResponse,
166
+ DashboardListResponse,
167
+ DashboardUpdateParams,
168
+ DashboardUpdateResponse,
169
+ DashboardUpdateWidgetParams,
170
+ DashboardUpdateWidgetResponse,
171
+ } from './resources/dashboard';
146
172
  import { Health, HealthGetResponse } from './resources/health';
147
173
  import {
148
174
  HTTPRequestDefinition,
@@ -299,6 +325,7 @@ import {
299
325
  SimulationToolFixtureUpdateParams,
300
326
  SimulationToolFixtureUpdateResponse,
301
327
  } from './resources/simulation-tool-fixture';
328
+ import { Usage, UsageGetParams, UsageGetResponse } from './resources/usage';
302
329
  import {
303
330
  Webhook,
304
331
  WebhookCreateParams,
@@ -1057,7 +1084,10 @@ export class Roark {
1057
1084
  health: API.Health = new API.Health(this);
1058
1085
  me: API.Me = new API.Me(this);
1059
1086
  project: API.Project = new API.Project(this);
1087
+ usage: API.Usage = new API.Usage(this);
1060
1088
  call: API.Call = new API.Call(this);
1089
+ analytics: API.Analytics = new API.Analytics(this);
1090
+ dashboard: API.Dashboard = new API.Dashboard(this);
1061
1091
  metric: API.Metric = new API.Metric(this);
1062
1092
  metricPolicy: API.MetricPolicy = new API.MetricPolicy(this);
1063
1093
  metricCollectionJob: API.MetricCollectionJob = new API.MetricCollectionJob(this);
@@ -1089,7 +1119,10 @@ export class Roark {
1089
1119
  Roark.Health = Health;
1090
1120
  Roark.Me = Me;
1091
1121
  Roark.Project = Project;
1122
+ Roark.Usage = Usage;
1092
1123
  Roark.Call = Call;
1124
+ Roark.Analytics = Analytics;
1125
+ Roark.Dashboard = Dashboard;
1093
1126
  Roark.Metric = Metric;
1094
1127
  Roark.MetricPolicy = MetricPolicy;
1095
1128
  Roark.MetricCollectionJob = MetricCollectionJob;
@@ -1134,6 +1167,8 @@ export declare namespace Roark {
1134
1167
 
1135
1168
  export { Project as Project, type ProjectListResponse as ProjectListResponse };
1136
1169
 
1170
+ export { Usage as Usage, type UsageGetResponse as UsageGetResponse, type UsageGetParams as UsageGetParams };
1171
+
1137
1172
  export {
1138
1173
  Call as Call,
1139
1174
  type CallCreateResponse as CallCreateResponse,
@@ -1152,6 +1187,34 @@ export declare namespace Roark {
1152
1187
  type CallUpdatePropertiesParams as CallUpdatePropertiesParams,
1153
1188
  };
1154
1189
 
1190
+ export {
1191
+ Analytics as Analytics,
1192
+ type AnalyticsGetSchemaResponse as AnalyticsGetSchemaResponse,
1193
+ type AnalyticsQueryResponse as AnalyticsQueryResponse,
1194
+ type AnalyticsQueryParams as AnalyticsQueryParams,
1195
+ };
1196
+
1197
+ export {
1198
+ Dashboard as Dashboard,
1199
+ type DashboardCreateResponse as DashboardCreateResponse,
1200
+ type DashboardUpdateResponse as DashboardUpdateResponse,
1201
+ type DashboardListResponse as DashboardListResponse,
1202
+ type DashboardDeleteResponse as DashboardDeleteResponse,
1203
+ type DashboardCreateWidgetResponse as DashboardCreateWidgetResponse,
1204
+ type DashboardDeleteWidgetResponse as DashboardDeleteWidgetResponse,
1205
+ type DashboardGetByIDResponse as DashboardGetByIDResponse,
1206
+ type DashboardGetDataResponse as DashboardGetDataResponse,
1207
+ type DashboardGetWidgetDataResponse as DashboardGetWidgetDataResponse,
1208
+ type DashboardUpdateWidgetResponse as DashboardUpdateWidgetResponse,
1209
+ type DashboardCreateParams as DashboardCreateParams,
1210
+ type DashboardUpdateParams as DashboardUpdateParams,
1211
+ type DashboardCreateWidgetParams as DashboardCreateWidgetParams,
1212
+ type DashboardDeleteWidgetParams as DashboardDeleteWidgetParams,
1213
+ type DashboardGetDataParams as DashboardGetDataParams,
1214
+ type DashboardGetWidgetDataParams as DashboardGetWidgetDataParams,
1215
+ type DashboardUpdateWidgetParams as DashboardUpdateWidgetParams,
1216
+ };
1217
+
1155
1218
  export {
1156
1219
  Metric as Metric,
1157
1220
  type MetricCreateDefinitionResponse as MetricCreateDefinitionResponse,
@@ -0,0 +1,573 @@
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
+
7
+ export class Analytics extends APIResource {
8
+ /**
9
+ * Lists what can go into an analytics query for this project: every metric by slug
10
+ * with its output type, default aggregation and the aggregations it supports; the
11
+ * measure types; the filter and breakdown types with the properties each accepts;
12
+ * and the custom call properties seen in the project. Read this first when
13
+ * building a query.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const response = await client.analytics.getSchema();
18
+ * ```
19
+ */
20
+ getSchema(options?: RequestOptions): APIPromise<AnalyticsGetSchemaResponse> {
21
+ return this._client.get('/v1/analytics/schema', options);
22
+ }
23
+
24
+ /**
25
+ * Aggregates metric values and conversation counts over a time window and returns
26
+ * one series per measure, with a total for the window and per-interval buckets.
27
+ * The same query a dashboard widget runs, without saving anything.
28
+ *
29
+ * - `measures`: what to aggregate. A METRIC measure names its metric by slug;
30
+ * CONVERSATION counts conversations; UPTIME reads health checks. The aggregation
31
+ * defaults by the metric's output type.
32
+ * - `timeRange`: LAST n DAYS/WEEKS/MONTHS, a CALENDAR_ALIGNED period (TODAY,
33
+ * THIS_MONTH, ...), FIXED from/to, or SINCE. Defaults to the last 30 days; at
34
+ * most 731 days. Calendar periods and buckets align to `timezone` (IANA, default
35
+ * UTC).
36
+ * - `filters` apply to every measure; a measure's own `filters` add to them.
37
+ * - `breakdown` on a measure returns one series per value (largest 50 kept).
38
+ * - `comparisonGroups` (2 to 5) run every measure once per named filter set;
39
+ * `comparisonMode: PREVIOUS_PERIOD` adds the preceding window's values.
40
+ *
41
+ * Values are in the metric's display units. A PASS_RATE is a 0 to 1 share;
42
+ * `sampleSize` 0 means no data. A query the analytics store cannot answer returns
43
+ * 400 naming the unsupported part.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const response = await client.analytics.query({
48
+ * measures: [{}],
49
+ * });
50
+ * ```
51
+ */
52
+ query(body: AnalyticsQueryParams, options?: RequestOptions): APIPromise<AnalyticsQueryResponse> {
53
+ return this._client.post('/v1/analytics/query', { body, ...options });
54
+ }
55
+ }
56
+
57
+ export interface AnalyticsGetSchemaResponse {
58
+ /**
59
+ * What can be queried in this project: metrics (by slug), measure types, filters,
60
+ * breakdowns.
61
+ */
62
+ data: AnalyticsGetSchemaResponse.Data;
63
+ }
64
+
65
+ export namespace AnalyticsGetSchemaResponse {
66
+ /**
67
+ * What can be queried in this project: metrics (by slug), measure types, filters,
68
+ * breakdowns.
69
+ */
70
+ export interface Data {
71
+ breakdowns: Array<Data.Breakdown>;
72
+
73
+ callProperties: Array<Data.CallProperty>;
74
+
75
+ displayTypes: Array<'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE'>;
76
+
77
+ filters: Array<Data.Filter>;
78
+
79
+ intervals: Array<'HOUR' | 'DAY' | 'WEEK' | 'MONTH'>;
80
+
81
+ measureTypes: Array<Data.MeasureType>;
82
+
83
+ metrics: Array<Data.Metric>;
84
+
85
+ operators: Array<
86
+ | 'EQUALS'
87
+ | 'NOT_EQUALS'
88
+ | 'GREATER_THAN'
89
+ | 'GREATER_THAN_OR_EQUAL_TO'
90
+ | 'LESS_THAN'
91
+ | 'LESS_THAN_OR_EQUAL_TO'
92
+ | 'CONTAINS'
93
+ | 'STARTS_WITH'
94
+ >;
95
+ }
96
+
97
+ export namespace Data {
98
+ export interface Breakdown {
99
+ description: string;
100
+
101
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'DATASET';
102
+ }
103
+
104
+ export interface CallProperty {
105
+ isSystem: boolean;
106
+
107
+ name: string;
108
+
109
+ valueType: string;
110
+ }
111
+
112
+ export interface Filter {
113
+ description: string;
114
+
115
+ properties: Array<Filter.Property>;
116
+
117
+ type:
118
+ | 'METRIC_PROPERTY'
119
+ | 'CALL_PROPERTY'
120
+ | 'AGENT_PROPERTY'
121
+ | 'CALL_ID'
122
+ | 'MODALITY'
123
+ | 'DATASET'
124
+ | 'METRIC_VALUE';
125
+ }
126
+
127
+ export namespace Filter {
128
+ export interface Property {
129
+ description: string;
130
+
131
+ property: string;
132
+ }
133
+ }
134
+
135
+ export interface MeasureType {
136
+ aggregations: Array<'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE'>;
137
+
138
+ description: string;
139
+
140
+ type: 'METRIC' | 'CONVERSATION' | 'UPTIME';
141
+ }
142
+
143
+ export interface Metric {
144
+ id: string;
145
+
146
+ aggregations: Array<'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE'>;
147
+
148
+ defaultAggregation: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
149
+
150
+ isThreshold: boolean;
151
+
152
+ name: string;
153
+
154
+ outputType: string;
155
+
156
+ slug: string;
157
+ }
158
+ }
159
+ }
160
+
161
+ export interface AnalyticsQueryResponse {
162
+ /**
163
+ * One series per measure (or per breakdown value / comparison group). `value` is
164
+ * the aggregate over the whole window; `buckets` hold the per-interval values.
165
+ */
166
+ data: AnalyticsQueryResponse.Data;
167
+ }
168
+
169
+ export namespace AnalyticsQueryResponse {
170
+ /**
171
+ * One series per measure (or per breakdown value / comparison group). `value` is
172
+ * the aggregate over the whole window; `buckets` hold the per-interval values.
173
+ */
174
+ export interface Data {
175
+ from: string;
176
+
177
+ interval: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
178
+
179
+ omittedSeries: number;
180
+
181
+ series: Array<Data.Sery>;
182
+
183
+ timezone: string;
184
+
185
+ to: string;
186
+ }
187
+
188
+ export namespace Data {
189
+ export interface Sery {
190
+ aggregation: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
191
+
192
+ breakdownValue: string | null;
193
+
194
+ buckets: Array<Sery.Bucket>;
195
+
196
+ comparisonGroup: string | null;
197
+
198
+ comparisonValue: number | null;
199
+
200
+ measureIndex: number;
201
+
202
+ metric: string | null;
203
+
204
+ percentageOfBaseline: number | null;
205
+
206
+ sampleSize: number | null;
207
+
208
+ type: 'METRIC' | 'CONVERSATION' | 'UPTIME';
209
+
210
+ value: number;
211
+ }
212
+
213
+ export namespace Sery {
214
+ export interface Bucket {
215
+ date: string;
216
+
217
+ value: number;
218
+
219
+ comparisonDate?: string;
220
+
221
+ comparisonValue?: number;
222
+
223
+ passed?: number;
224
+
225
+ percentageOfBaseline?: number;
226
+
227
+ sampleSize?: number;
228
+ }
229
+ }
230
+ }
231
+ }
232
+
233
+ export interface AnalyticsQueryParams {
234
+ /**
235
+ * What to aggregate: 1 to 10 measures.
236
+ */
237
+ measures: Array<AnalyticsQueryParams.Measure>;
238
+
239
+ /**
240
+ * Run every measure once per named filter set, e.g. one group per agent.
241
+ */
242
+ comparisonGroups?: Array<AnalyticsQueryParams.ComparisonGroup>;
243
+
244
+ /**
245
+ * PREVIOUS_PERIOD adds the preceding window of the same length to every series.
246
+ */
247
+ comparisonMode?: 'NONE' | 'PREVIOUS_PERIOD';
248
+
249
+ /**
250
+ * Applied to every measure, on top of each measure's own filters.
251
+ */
252
+ filters?: Array<AnalyticsQueryParams.Filter>;
253
+
254
+ /**
255
+ * Set false to return only the window totals.
256
+ */
257
+ includeBuckets?: boolean;
258
+
259
+ /**
260
+ * Bucket size. Defaults from the window's length and steps coarser when the window
261
+ * would exceed 500 buckets.
262
+ */
263
+ interval?: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
264
+
265
+ /**
266
+ * Defaults to the last 30 days.
267
+ */
268
+ timeRange?:
269
+ | AnalyticsQueryParams.UnionMember0
270
+ | AnalyticsQueryParams.UnionMember1
271
+ | AnalyticsQueryParams.UnionMember2
272
+ | AnalyticsQueryParams.UnionMember3;
273
+
274
+ /**
275
+ * IANA zone that buckets and calendar periods align to, e.g. America/New_York.
276
+ * Defaults to UTC.
277
+ */
278
+ timezone?: string;
279
+ }
280
+
281
+ export namespace AnalyticsQueryParams {
282
+ export interface Measure {
283
+ /**
284
+ * Defaults by output type: AVG for numeric metrics, COUNT (split by value) for
285
+ * classification and text, PASS_RATE for thresholds and uptime, COUNT for
286
+ * conversations.
287
+ */
288
+ aggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
289
+
290
+ /**
291
+ * Split the measure into one series per value of this dimension (the largest 50
292
+ * are returned). Ignored while comparisonGroups are set: each group is then one
293
+ * series.
294
+ */
295
+ breakdown?: Measure.Breakdown;
296
+
297
+ /**
298
+ * Chart color on a dashboard.
299
+ */
300
+ color?:
301
+ | 'GREEN'
302
+ | 'RED'
303
+ | 'ORANGE'
304
+ | 'PURPLE'
305
+ | 'GREY'
306
+ | 'BLUE'
307
+ | 'PEACH'
308
+ | 'TEAL'
309
+ | 'INDIGO'
310
+ | 'AMBER'
311
+ | 'ROSE'
312
+ | 'CYAN';
313
+
314
+ /**
315
+ * CALL (default for metrics) folds each conversation to one value first, so a long
316
+ * call does not outweigh a short one. NONE aggregates every value.
317
+ */
318
+ distinctBy?: 'NONE' | 'CALL';
319
+
320
+ /**
321
+ * Filters for this measure only, on top of the query's filters.
322
+ */
323
+ filters?: Array<Measure.Filter>;
324
+
325
+ /**
326
+ * Mark one measure as the baseline: every series also reports its value as a
327
+ * percentage of it.
328
+ */
329
+ isBaseline?: boolean;
330
+
331
+ /**
332
+ * The metric's slug (e.g. `task_completion`) or id. Required for METRIC.
333
+ */
334
+ metric?: string;
335
+
336
+ /**
337
+ * How each conversation is folded when distinctBy is CALL. Defaults to SUM under
338
+ * SUM, else AVG.
339
+ */
340
+ nestedAggregation?: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
341
+
342
+ nestedAggregationPercentile?: number;
343
+
344
+ /**
345
+ * PASS_RATE condition operator. Omit for a threshold metric: its own condition is
346
+ * used.
347
+ */
348
+ passOperator?:
349
+ | 'EQUALS'
350
+ | 'NOT_EQUALS'
351
+ | 'GREATER_THAN'
352
+ | 'GREATER_THAN_OR_EQUAL_TO'
353
+ | 'LESS_THAN'
354
+ | 'LESS_THAN_OR_EQUAL_TO'
355
+ | 'CONTAINS'
356
+ | 'STARTS_WITH';
357
+
358
+ /**
359
+ * PASS_RATE condition value, e.g. 4 or "resolved".
360
+ */
361
+ passValue?: string | number | boolean;
362
+
363
+ /**
364
+ * Required with PERCENTILE, e.g. 95.
365
+ */
366
+ percentile?: number;
367
+
368
+ /**
369
+ * METRIC (default): a metric's values. CONVERSATION: conversation counts. UPTIME:
370
+ * health-check outcomes.
371
+ */
372
+ type?: 'METRIC' | 'CONVERSATION' | 'UPTIME';
373
+ }
374
+
375
+ export namespace Measure {
376
+ /**
377
+ * Split the measure into one series per value of this dimension (the largest 50
378
+ * are returned). Ignored while comparisonGroups are set: each group is then one
379
+ * series.
380
+ */
381
+ export interface Breakdown {
382
+ type: 'METRIC_PROPERTY' | 'CALL_PROPERTY' | 'AGENT_PROPERTY' | 'DATASET';
383
+
384
+ /**
385
+ * The property to split by. Required for CALL_PROPERTY and METRIC_PROPERTY.
386
+ */
387
+ property?: string;
388
+ }
389
+
390
+ export interface Filter {
391
+ /**
392
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
393
+ */
394
+ type:
395
+ | 'METRIC_PROPERTY'
396
+ | 'CALL_PROPERTY'
397
+ | 'AGENT_PROPERTY'
398
+ | 'CALL_ID'
399
+ | 'MODALITY'
400
+ | 'DATASET'
401
+ | 'METRIC_VALUE';
402
+
403
+ /**
404
+ * The value to compare against (an agent id, "call" / "chat", a property value).
405
+ */
406
+ value: string | number | boolean;
407
+
408
+ /**
409
+ * Defaults to EQUALS.
410
+ */
411
+ operator?:
412
+ | 'EQUALS'
413
+ | 'NOT_EQUALS'
414
+ | 'GREATER_THAN'
415
+ | 'GREATER_THAN_OR_EQUAL_TO'
416
+ | 'LESS_THAN'
417
+ | 'LESS_THAN_OR_EQUAL_TO'
418
+ | 'CONTAINS'
419
+ | 'STARTS_WITH';
420
+
421
+ /**
422
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
423
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
424
+ */
425
+ property?: string;
426
+ }
427
+ }
428
+
429
+ export interface ComparisonGroup {
430
+ filters: Array<ComparisonGroup.Filter>;
431
+
432
+ /**
433
+ * The series label; unique within the query.
434
+ */
435
+ name: string;
436
+
437
+ color?:
438
+ | 'GREEN'
439
+ | 'RED'
440
+ | 'ORANGE'
441
+ | 'PURPLE'
442
+ | 'GREY'
443
+ | 'BLUE'
444
+ | 'PEACH'
445
+ | 'TEAL'
446
+ | 'INDIGO'
447
+ | 'AMBER'
448
+ | 'ROSE'
449
+ | 'CYAN';
450
+ }
451
+
452
+ export namespace ComparisonGroup {
453
+ export interface Filter {
454
+ /**
455
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
456
+ */
457
+ type:
458
+ | 'METRIC_PROPERTY'
459
+ | 'CALL_PROPERTY'
460
+ | 'AGENT_PROPERTY'
461
+ | 'CALL_ID'
462
+ | 'MODALITY'
463
+ | 'DATASET'
464
+ | 'METRIC_VALUE';
465
+
466
+ /**
467
+ * The value to compare against (an agent id, "call" / "chat", a property value).
468
+ */
469
+ value: string | number | boolean;
470
+
471
+ /**
472
+ * Defaults to EQUALS.
473
+ */
474
+ operator?:
475
+ | 'EQUALS'
476
+ | 'NOT_EQUALS'
477
+ | 'GREATER_THAN'
478
+ | 'GREATER_THAN_OR_EQUAL_TO'
479
+ | 'LESS_THAN'
480
+ | 'LESS_THAN_OR_EQUAL_TO'
481
+ | 'CONTAINS'
482
+ | 'STARTS_WITH';
483
+
484
+ /**
485
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
486
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
487
+ */
488
+ property?: string;
489
+ }
490
+ }
491
+
492
+ export interface Filter {
493
+ /**
494
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
495
+ */
496
+ type:
497
+ | 'METRIC_PROPERTY'
498
+ | 'CALL_PROPERTY'
499
+ | 'AGENT_PROPERTY'
500
+ | 'CALL_ID'
501
+ | 'MODALITY'
502
+ | 'DATASET'
503
+ | 'METRIC_VALUE';
504
+
505
+ /**
506
+ * The value to compare against (an agent id, "call" / "chat", a property value).
507
+ */
508
+ value: string | number | boolean;
509
+
510
+ /**
511
+ * Defaults to EQUALS.
512
+ */
513
+ operator?:
514
+ | 'EQUALS'
515
+ | 'NOT_EQUALS'
516
+ | 'GREATER_THAN'
517
+ | 'GREATER_THAN_OR_EQUAL_TO'
518
+ | 'LESS_THAN'
519
+ | 'LESS_THAN_OR_EQUAL_TO'
520
+ | 'CONTAINS'
521
+ | 'STARTS_WITH';
522
+
523
+ /**
524
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
525
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
526
+ */
527
+ property?: string;
528
+ }
529
+
530
+ export interface UnionMember0 {
531
+ type: 'LAST';
532
+
533
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS';
534
+
535
+ value: number;
536
+ }
537
+
538
+ export interface UnionMember1 {
539
+ period:
540
+ | 'TODAY'
541
+ | 'YESTERDAY'
542
+ | 'THIS_WEEK'
543
+ | 'LAST_WEEK'
544
+ | 'THIS_MONTH'
545
+ | 'LAST_MONTH'
546
+ | 'THIS_YEAR'
547
+ | 'LAST_YEAR';
548
+
549
+ type: 'CALENDAR_ALIGNED';
550
+ }
551
+
552
+ export interface UnionMember2 {
553
+ from: string;
554
+
555
+ to: string;
556
+
557
+ type: 'FIXED';
558
+ }
559
+
560
+ export interface UnionMember3 {
561
+ from: string;
562
+
563
+ type: 'SINCE';
564
+ }
565
+ }
566
+
567
+ export declare namespace Analytics {
568
+ export {
569
+ type AnalyticsGetSchemaResponse as AnalyticsGetSchemaResponse,
570
+ type AnalyticsQueryResponse as AnalyticsQueryResponse,
571
+ type AnalyticsQueryParams as AnalyticsQueryParams,
572
+ };
573
+ }