@roarkanalytics/sdk 2.24.0 → 2.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/client.d.mts +8 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +8 -2
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +7 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +3 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -1
- package/resources/index.mjs.map +1 -1
- package/resources/metric-collection-job.d.mts +237 -0
- package/resources/metric-collection-job.d.mts.map +1 -0
- package/resources/metric-collection-job.d.ts +237 -0
- package/resources/metric-collection-job.d.ts.map +1 -0
- package/resources/metric-collection-job.js +29 -0
- package/resources/metric-collection-job.js.map +1 -0
- package/resources/metric-collection-job.mjs +25 -0
- package/resources/metric-collection-job.mjs.map +1 -0
- package/resources/metric-policy.d.mts +502 -0
- package/resources/metric-policy.d.mts.map +1 -0
- package/resources/metric-policy.d.ts +502 -0
- package/resources/metric-policy.d.ts.map +1 -0
- package/resources/metric-policy.js +76 -0
- package/resources/metric-policy.js.map +1 -0
- package/resources/metric-policy.mjs +72 -0
- package/resources/metric-policy.mjs.map +1 -0
- package/resources/metric.d.mts +187 -1
- package/resources/metric.d.mts.map +1 -1
- package/resources/metric.d.ts +187 -1
- package/resources/metric.d.ts.map +1 -1
- package/resources/metric.js +21 -0
- package/resources/metric.js.map +1 -1
- package/resources/metric.mjs +21 -0
- package/resources/metric.mjs.map +1 -1
- package/resources/simulation-job.d.mts +34 -2
- package/resources/simulation-job.d.mts.map +1 -1
- package/resources/simulation-job.d.ts +34 -2
- package/resources/simulation-job.d.ts.map +1 -1
- package/resources/simulation-persona.d.mts +102 -6
- package/resources/simulation-persona.d.mts.map +1 -1
- package/resources/simulation-persona.d.ts +102 -6
- package/resources/simulation-persona.d.ts.map +1 -1
- package/resources/simulation-run-plan-job.d.mts +24 -7
- package/resources/simulation-run-plan-job.d.mts.map +1 -1
- package/resources/simulation-run-plan-job.d.ts +24 -7
- package/resources/simulation-run-plan-job.d.ts.map +1 -1
- package/resources/simulation-run-plan.d.mts +31 -1
- package/resources/simulation-run-plan.d.mts.map +1 -1
- package/resources/simulation-run-plan.d.ts +31 -1
- package/resources/simulation-run-plan.d.ts.map +1 -1
- package/resources/webhook.d.mts +4 -4
- package/resources/webhook.d.mts.map +1 -1
- package/resources/webhook.d.ts +4 -4
- package/resources/webhook.d.ts.map +1 -1
- package/src/client.ts +56 -2
- package/src/resources/index.ts +25 -1
- package/src/resources/metric-collection-job.ts +307 -0
- package/src/resources/metric-policy.ts +679 -0
- package/src/resources/metric.ts +232 -1
- package/src/resources/simulation-job.ts +42 -2
- package/src/resources/simulation-persona.ts +126 -6
- package/src/resources/simulation-run-plan-job.ts +32 -6
- package/src/resources/simulation-run-plan.ts +38 -1
- package/src/resources/webhook.ts +4 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
import { path } from '../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
export class MetricCollectionJob extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Creates a metric collection job for the specified calls and metrics, then
|
|
11
|
+
* triggers processing.
|
|
12
|
+
*/
|
|
13
|
+
create(
|
|
14
|
+
body: MetricCollectionJobCreateParams,
|
|
15
|
+
options?: RequestOptions,
|
|
16
|
+
): APIPromise<MetricCollectionJobCreateResponse> {
|
|
17
|
+
return this._client.post('/v1/metric/collection-jobs', { body, ...options });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Returns a paginated list of metric collection jobs for the project.
|
|
22
|
+
*/
|
|
23
|
+
list(
|
|
24
|
+
query: MetricCollectionJobListParams | null | undefined = {},
|
|
25
|
+
options?: RequestOptions,
|
|
26
|
+
): APIPromise<MetricCollectionJobListResponse> {
|
|
27
|
+
return this._client.get('/v1/metric/collection-jobs', { query, ...options });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Returns a specific metric collection job with progress information.
|
|
32
|
+
*/
|
|
33
|
+
getByID(jobID: string, options?: RequestOptions): APIPromise<MetricCollectionJobGetByIDResponse> {
|
|
34
|
+
return this._client.get(path`/v1/metric/collection-jobs/${jobID}`, options);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface MetricCollectionJobCreateResponse {
|
|
39
|
+
/**
|
|
40
|
+
* A metric collection job that processes metrics for calls
|
|
41
|
+
*/
|
|
42
|
+
data: MetricCollectionJobCreateResponse.Data;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export namespace MetricCollectionJobCreateResponse {
|
|
46
|
+
/**
|
|
47
|
+
* A metric collection job that processes metrics for calls
|
|
48
|
+
*/
|
|
49
|
+
export interface Data {
|
|
50
|
+
/**
|
|
51
|
+
* Unique identifier of the metric collection job
|
|
52
|
+
*/
|
|
53
|
+
id: string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* When the job completed
|
|
57
|
+
*/
|
|
58
|
+
completedAt: string | null;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Number of successfully completed items
|
|
62
|
+
*/
|
|
63
|
+
completedItems: number;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* When the job was created
|
|
67
|
+
*/
|
|
68
|
+
createdAt: string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Error message if the job failed
|
|
72
|
+
*/
|
|
73
|
+
errorMessage: string | null;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Number of failed items
|
|
77
|
+
*/
|
|
78
|
+
failedItems: number;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* When the job started processing
|
|
82
|
+
*/
|
|
83
|
+
startedAt: string | null;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Current status of the job
|
|
87
|
+
*/
|
|
88
|
+
status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED';
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Total number of call-metric pairs to process
|
|
92
|
+
*/
|
|
93
|
+
totalItems: number;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* What triggered this job
|
|
97
|
+
*/
|
|
98
|
+
triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION';
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* When the job was last updated
|
|
102
|
+
*/
|
|
103
|
+
updatedAt: string;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Paginated list of metric collection jobs
|
|
109
|
+
*/
|
|
110
|
+
export interface MetricCollectionJobListResponse {
|
|
111
|
+
data: Array<MetricCollectionJobListResponse.Data>;
|
|
112
|
+
|
|
113
|
+
pagination: MetricCollectionJobListResponse.Pagination;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export namespace MetricCollectionJobListResponse {
|
|
117
|
+
/**
|
|
118
|
+
* A metric collection job that processes metrics for calls
|
|
119
|
+
*/
|
|
120
|
+
export interface Data {
|
|
121
|
+
/**
|
|
122
|
+
* Unique identifier of the metric collection job
|
|
123
|
+
*/
|
|
124
|
+
id: string;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* When the job completed
|
|
128
|
+
*/
|
|
129
|
+
completedAt: string | null;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Number of successfully completed items
|
|
133
|
+
*/
|
|
134
|
+
completedItems: number;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* When the job was created
|
|
138
|
+
*/
|
|
139
|
+
createdAt: string;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Error message if the job failed
|
|
143
|
+
*/
|
|
144
|
+
errorMessage: string | null;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Number of failed items
|
|
148
|
+
*/
|
|
149
|
+
failedItems: number;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* When the job started processing
|
|
153
|
+
*/
|
|
154
|
+
startedAt: string | null;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Current status of the job
|
|
158
|
+
*/
|
|
159
|
+
status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED';
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Total number of call-metric pairs to process
|
|
163
|
+
*/
|
|
164
|
+
totalItems: number;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* What triggered this job
|
|
168
|
+
*/
|
|
169
|
+
triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION';
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* When the job was last updated
|
|
173
|
+
*/
|
|
174
|
+
updatedAt: string;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface Pagination {
|
|
178
|
+
/**
|
|
179
|
+
* Whether there are more items to fetch
|
|
180
|
+
*/
|
|
181
|
+
hasMore: boolean;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Cursor for the next page of items
|
|
185
|
+
*/
|
|
186
|
+
nextCursor: string | null;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Total number of items
|
|
190
|
+
*/
|
|
191
|
+
total: number;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export interface MetricCollectionJobGetByIDResponse {
|
|
196
|
+
/**
|
|
197
|
+
* A metric collection job that processes metrics for calls
|
|
198
|
+
*/
|
|
199
|
+
data: MetricCollectionJobGetByIDResponse.Data;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export namespace MetricCollectionJobGetByIDResponse {
|
|
203
|
+
/**
|
|
204
|
+
* A metric collection job that processes metrics for calls
|
|
205
|
+
*/
|
|
206
|
+
export interface Data {
|
|
207
|
+
/**
|
|
208
|
+
* Unique identifier of the metric collection job
|
|
209
|
+
*/
|
|
210
|
+
id: string;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* When the job completed
|
|
214
|
+
*/
|
|
215
|
+
completedAt: string | null;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Number of successfully completed items
|
|
219
|
+
*/
|
|
220
|
+
completedItems: number;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* When the job was created
|
|
224
|
+
*/
|
|
225
|
+
createdAt: string;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Error message if the job failed
|
|
229
|
+
*/
|
|
230
|
+
errorMessage: string | null;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Number of failed items
|
|
234
|
+
*/
|
|
235
|
+
failedItems: number;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* When the job started processing
|
|
239
|
+
*/
|
|
240
|
+
startedAt: string | null;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Current status of the job
|
|
244
|
+
*/
|
|
245
|
+
status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED';
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Total number of call-metric pairs to process
|
|
249
|
+
*/
|
|
250
|
+
totalItems: number;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* What triggered this job
|
|
254
|
+
*/
|
|
255
|
+
triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION';
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* When the job was last updated
|
|
259
|
+
*/
|
|
260
|
+
updatedAt: string;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export interface MetricCollectionJobCreateParams {
|
|
265
|
+
/**
|
|
266
|
+
* Call IDs to collect metrics for
|
|
267
|
+
*/
|
|
268
|
+
callIds: Array<string>;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Metric definitions to collect
|
|
272
|
+
*/
|
|
273
|
+
metrics: Array<MetricCollectionJobCreateParams.Metric>;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export namespace MetricCollectionJobCreateParams {
|
|
277
|
+
export interface Metric {
|
|
278
|
+
id: string;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export interface MetricCollectionJobListParams {
|
|
283
|
+
/**
|
|
284
|
+
* Cursor for pagination - use the nextCursor value from a previous response
|
|
285
|
+
*/
|
|
286
|
+
after?: string;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Maximum number of jobs to return (default: 20, max: 50)
|
|
290
|
+
*/
|
|
291
|
+
limit?: number;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Filter by job status
|
|
295
|
+
*/
|
|
296
|
+
status?: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED';
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export declare namespace MetricCollectionJob {
|
|
300
|
+
export {
|
|
301
|
+
type MetricCollectionJobCreateResponse as MetricCollectionJobCreateResponse,
|
|
302
|
+
type MetricCollectionJobListResponse as MetricCollectionJobListResponse,
|
|
303
|
+
type MetricCollectionJobGetByIDResponse as MetricCollectionJobGetByIDResponse,
|
|
304
|
+
type MetricCollectionJobCreateParams as MetricCollectionJobCreateParams,
|
|
305
|
+
type MetricCollectionJobListParams as MetricCollectionJobListParams,
|
|
306
|
+
};
|
|
307
|
+
}
|