@roarkanalytics/sdk 2.22.0 → 2.23.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 (137) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/client.d.mts +31 -10
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +31 -10
  5. package/client.d.ts.map +1 -1
  6. package/client.js +34 -6
  7. package/client.js.map +1 -1
  8. package/client.mjs +34 -6
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/agent-endpoint.d.mts +309 -0
  12. package/resources/agent-endpoint.d.mts.map +1 -0
  13. package/resources/agent-endpoint.d.ts +309 -0
  14. package/resources/agent-endpoint.d.ts.map +1 -0
  15. package/resources/agent-endpoint.js +35 -0
  16. package/resources/agent-endpoint.js.map +1 -0
  17. package/resources/agent-endpoint.mjs +31 -0
  18. package/resources/agent-endpoint.mjs.map +1 -0
  19. package/resources/agent.d.mts +193 -0
  20. package/resources/agent.d.mts.map +1 -0
  21. package/resources/agent.d.ts +193 -0
  22. package/resources/agent.d.ts.map +1 -0
  23. package/resources/agent.js +34 -0
  24. package/resources/agent.js.map +1 -0
  25. package/resources/agent.mjs +30 -0
  26. package/resources/agent.mjs.map +1 -0
  27. package/resources/call.d.mts +120 -1
  28. package/resources/call.d.mts.map +1 -1
  29. package/resources/call.d.ts +120 -1
  30. package/resources/call.d.ts.map +1 -1
  31. package/resources/call.js +7 -0
  32. package/resources/call.js.map +1 -1
  33. package/resources/call.mjs +7 -0
  34. package/resources/call.mjs.map +1 -1
  35. package/resources/evaluation.d.mts +2097 -617
  36. package/resources/evaluation.d.mts.map +1 -1
  37. package/resources/evaluation.d.ts +2097 -617
  38. package/resources/evaluation.d.ts.map +1 -1
  39. package/resources/evaluation.js +14 -0
  40. package/resources/evaluation.js.map +1 -1
  41. package/resources/evaluation.mjs +14 -0
  42. package/resources/evaluation.mjs.map +1 -1
  43. package/resources/http-request-definition.d.mts +339 -0
  44. package/resources/http-request-definition.d.mts.map +1 -0
  45. package/resources/http-request-definition.d.ts +339 -0
  46. package/resources/http-request-definition.d.ts.map +1 -0
  47. package/resources/http-request-definition.js +36 -0
  48. package/resources/http-request-definition.js.map +1 -0
  49. package/resources/http-request-definition.mjs +32 -0
  50. package/resources/http-request-definition.mjs.map +1 -0
  51. package/resources/index.d.mts +11 -4
  52. package/resources/index.d.mts.map +1 -1
  53. package/resources/index.d.ts +11 -4
  54. package/resources/index.d.ts.map +1 -1
  55. package/resources/index.js +19 -5
  56. package/resources/index.js.map +1 -1
  57. package/resources/index.mjs +9 -2
  58. package/resources/index.mjs.map +1 -1
  59. package/resources/simulation-job.d.mts +393 -0
  60. package/resources/simulation-job.d.mts.map +1 -0
  61. package/resources/simulation-job.d.ts +393 -0
  62. package/resources/simulation-job.d.ts.map +1 -0
  63. package/resources/simulation-job.js +38 -0
  64. package/resources/simulation-job.js.map +1 -0
  65. package/resources/simulation-job.mjs +34 -0
  66. package/resources/simulation-job.mjs.map +1 -0
  67. package/resources/{persona.d.mts → simulation-persona.d.mts} +62 -33
  68. package/resources/simulation-persona.d.mts.map +1 -0
  69. package/resources/{persona.d.ts → simulation-persona.d.ts} +62 -33
  70. package/resources/simulation-persona.d.ts.map +1 -0
  71. package/resources/{persona.js → simulation-persona.js} +18 -13
  72. package/resources/simulation-persona.js.map +1 -0
  73. package/resources/{persona.mjs → simulation-persona.mjs} +16 -11
  74. package/resources/simulation-persona.mjs.map +1 -0
  75. package/resources/simulation-run-plan-job.d.mts +359 -0
  76. package/resources/simulation-run-plan-job.d.mts.map +1 -0
  77. package/resources/simulation-run-plan-job.d.ts +359 -0
  78. package/resources/simulation-run-plan-job.d.ts.map +1 -0
  79. package/resources/simulation-run-plan-job.js +50 -0
  80. package/resources/simulation-run-plan-job.js.map +1 -0
  81. package/resources/simulation-run-plan-job.mjs +46 -0
  82. package/resources/simulation-run-plan-job.mjs.map +1 -0
  83. package/resources/simulation-run-plan.d.mts +660 -0
  84. package/resources/simulation-run-plan.d.mts.map +1 -0
  85. package/resources/simulation-run-plan.d.ts +660 -0
  86. package/resources/simulation-run-plan.d.ts.map +1 -0
  87. package/resources/simulation-run-plan.js +93 -0
  88. package/resources/simulation-run-plan.js.map +1 -0
  89. package/resources/simulation-run-plan.mjs +89 -0
  90. package/resources/simulation-run-plan.mjs.map +1 -0
  91. package/resources/simulation-scenario.d.mts +335 -0
  92. package/resources/simulation-scenario.d.mts.map +1 -0
  93. package/resources/simulation-scenario.d.ts +335 -0
  94. package/resources/simulation-scenario.d.ts.map +1 -0
  95. package/resources/simulation-scenario.js +40 -0
  96. package/resources/simulation-scenario.js.map +1 -0
  97. package/resources/simulation-scenario.mjs +36 -0
  98. package/resources/simulation-scenario.mjs.map +1 -0
  99. package/resources/webhook.d.mts +212 -0
  100. package/resources/webhook.d.mts.map +1 -0
  101. package/resources/webhook.d.ts +212 -0
  102. package/resources/webhook.d.ts.map +1 -0
  103. package/resources/webhook.js +35 -0
  104. package/resources/webhook.js.map +1 -0
  105. package/resources/webhook.mjs +31 -0
  106. package/resources/webhook.mjs.map +1 -0
  107. package/src/client.ts +208 -43
  108. package/src/resources/agent-endpoint.ts +400 -0
  109. package/src/resources/agent.ts +263 -0
  110. package/src/resources/call.ts +149 -0
  111. package/src/resources/evaluation.ts +3044 -1154
  112. package/src/resources/http-request-definition.ts +410 -0
  113. package/src/resources/index.ts +89 -21
  114. package/src/resources/simulation-job.ts +527 -0
  115. package/src/resources/{persona.ts → simulation-persona.ts} +78 -40
  116. package/src/resources/simulation-run-plan-job.ts +521 -0
  117. package/src/resources/simulation-run-plan.ts +840 -0
  118. package/src/resources/simulation-scenario.ts +463 -0
  119. package/src/resources/webhook.ts +318 -0
  120. package/src/version.ts +1 -1
  121. package/version.d.mts +1 -1
  122. package/version.d.ts +1 -1
  123. package/version.js +1 -1
  124. package/version.mjs +1 -1
  125. package/resources/persona.d.mts.map +0 -1
  126. package/resources/persona.d.ts.map +0 -1
  127. package/resources/persona.js.map +0 -1
  128. package/resources/persona.mjs.map +0 -1
  129. package/resources/simulation.d.mts +0 -802
  130. package/resources/simulation.d.mts.map +0 -1
  131. package/resources/simulation.d.ts +0 -802
  132. package/resources/simulation.d.ts.map +0 -1
  133. package/resources/simulation.js +0 -90
  134. package/resources/simulation.js.map +0 -1
  135. package/resources/simulation.mjs +0 -86
  136. package/resources/simulation.mjs.map +0 -1
  137. package/src/resources/simulation.ts +0 -1069
@@ -0,0 +1,521 @@
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 SimulationRunPlanJob extends APIResource {
9
+ /**
10
+ * Returns a paginated list of simulation run plan jobs. Filter by status, plan ID,
11
+ * or label to find specific simulation batches.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const simulationRunPlanJobs =
16
+ * await client.simulationRunPlanJob.list();
17
+ * ```
18
+ */
19
+ list(
20
+ query: SimulationRunPlanJobListParams | null | undefined = {},
21
+ options?: RequestOptions,
22
+ ): APIPromise<SimulationRunPlanJobListResponse> {
23
+ return this._client.get('/v1/simulation/plan/jobs', { query, ...options });
24
+ }
25
+
26
+ /**
27
+ * Retrieve details of a simulation plan job including all associated simulation
28
+ * jobs (calls)
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const response = await client.simulationRunPlanJob.getByID(
33
+ * '7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f',
34
+ * );
35
+ * ```
36
+ */
37
+ getByID(jobID: unknown, options?: RequestOptions): APIPromise<SimulationRunPlanJobGetByIDResponse> {
38
+ return this._client.get(path`/v1/simulation/plan/job/${jobID}`, options);
39
+ }
40
+
41
+ /**
42
+ * Create and execute a job for an existing simulation run plan
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * const response = await client.simulationRunPlanJob.start(
47
+ * '7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f',
48
+ * );
49
+ * ```
50
+ */
51
+ start(planID: unknown, options?: RequestOptions): APIPromise<SimulationRunPlanJobStartResponse> {
52
+ return this._client.post(path`/v1/simulation/plan/${planID}/job`, options);
53
+ }
54
+ }
55
+
56
+ /**
57
+ * Paginated list of simulation run plan jobs
58
+ */
59
+ export interface SimulationRunPlanJobListResponse {
60
+ data: Array<SimulationRunPlanJobListResponse.Data>;
61
+
62
+ pagination: SimulationRunPlanJobListResponse.Pagination;
63
+ }
64
+
65
+ export namespace SimulationRunPlanJobListResponse {
66
+ export interface Data {
67
+ /**
68
+ * When the job was created
69
+ */
70
+ createdAt: string;
71
+
72
+ /**
73
+ * ID of the simulation run plan
74
+ */
75
+ simulationRunPlanId: string;
76
+
77
+ /**
78
+ * ID of the simulation run plan job
79
+ */
80
+ simulationRunPlanJobId: string;
81
+
82
+ /**
83
+ * Job status
84
+ */
85
+ status:
86
+ | 'PENDING'
87
+ | 'QUEUED'
88
+ | 'CREATING_SNAPSHOTS'
89
+ | 'CREATING_SIMULATIONS'
90
+ | 'RUNNING_SIMULATIONS'
91
+ | 'COMPLETED'
92
+ | 'FAILED'
93
+ | 'TIMED_OUT'
94
+ | 'CANCELLED'
95
+ | 'CANCELLING';
96
+
97
+ /**
98
+ * How the job was triggered (SCHEDULED, USER_TRIGGERED_FROM_UI,
99
+ * TRIGGERED_FROM_API, or RE_RUN)
100
+ */
101
+ triggeredBy: 'SCHEDULED' | 'USER_TRIGGERED_FROM_UI' | 'RE_RUN' | 'TRIGGERED_FROM_API';
102
+
103
+ /**
104
+ * When the job ended
105
+ */
106
+ endedAt?: string | null;
107
+
108
+ /**
109
+ * When the job started
110
+ */
111
+ startedAt?: string | null;
112
+ }
113
+
114
+ export interface Pagination {
115
+ /**
116
+ * Whether there are more results available
117
+ */
118
+ hasMore: boolean;
119
+
120
+ /**
121
+ * Total number of matching plan jobs
122
+ */
123
+ total: number;
124
+
125
+ /**
126
+ * Cursor to use for fetching the next page
127
+ */
128
+ nextCursor?: string | null;
129
+ }
130
+ }
131
+
132
+ export interface SimulationRunPlanJobGetByIDResponse {
133
+ /**
134
+ * Simulation run plan job with all associated simulation jobs
135
+ */
136
+ data: SimulationRunPlanJobGetByIDResponse.Data;
137
+ }
138
+
139
+ export namespace SimulationRunPlanJobGetByIDResponse {
140
+ /**
141
+ * Simulation run plan job with all associated simulation jobs
142
+ */
143
+ export interface Data {
144
+ /**
145
+ * When the job was created
146
+ */
147
+ createdAt: string;
148
+
149
+ /**
150
+ * List of simulation jobs (calls) in this run plan job
151
+ */
152
+ simulationJobs: Array<Data.SimulationJob>;
153
+
154
+ /**
155
+ * ID of the simulation run plan
156
+ */
157
+ simulationRunPlanId: string;
158
+
159
+ /**
160
+ * ID of the simulation run plan job
161
+ */
162
+ simulationRunPlanJobId: string;
163
+
164
+ /**
165
+ * Job status
166
+ */
167
+ status:
168
+ | 'PENDING'
169
+ | 'QUEUED'
170
+ | 'CREATING_SNAPSHOTS'
171
+ | 'CREATING_SIMULATIONS'
172
+ | 'RUNNING_SIMULATIONS'
173
+ | 'COMPLETED'
174
+ | 'FAILED'
175
+ | 'TIMED_OUT'
176
+ | 'CANCELLED'
177
+ | 'CANCELLING';
178
+
179
+ /**
180
+ * When the job ended
181
+ */
182
+ endedAt?: string | null;
183
+
184
+ /**
185
+ * When the job started
186
+ */
187
+ startedAt?: string | null;
188
+ }
189
+
190
+ export namespace Data {
191
+ export interface SimulationJob {
192
+ /**
193
+ * Agent endpoint used in a simulation
194
+ */
195
+ agentEndpoint: SimulationJob.AgentEndpoint;
196
+
197
+ /**
198
+ * When the simulation job was created
199
+ */
200
+ createdAt: string;
201
+
202
+ persona: SimulationJob.Persona;
203
+
204
+ /**
205
+ * Processing status
206
+ */
207
+ processingStatus:
208
+ | 'CONNECTING'
209
+ | 'WAITING_FOR_OUTBOUND_CALL'
210
+ | 'SIMULATING'
211
+ | 'ANALYZING'
212
+ | 'EVALUATING'
213
+ | 'COMPLETED';
214
+
215
+ /**
216
+ * Scenario used in a simulation
217
+ */
218
+ scenario: SimulationJob.Scenario;
219
+
220
+ /**
221
+ * Simulation job ID
222
+ */
223
+ simulationJobId: string;
224
+
225
+ /**
226
+ * Job status
227
+ */
228
+ status:
229
+ | 'PENDING'
230
+ | 'QUEUED'
231
+ | 'PROCESSING'
232
+ | 'COMPLETED'
233
+ | 'FAILED'
234
+ | 'TIMED_OUT'
235
+ | 'CANCELLED'
236
+ | 'CANCELLING';
237
+
238
+ /**
239
+ * ID of the call created for this simulation job. Null if the call has not been
240
+ * created yet.
241
+ */
242
+ callId?: string | null;
243
+
244
+ /**
245
+ * When the simulation job completed
246
+ */
247
+ completedAt?: string | null;
248
+
249
+ /**
250
+ * Phone number provisioned by Roark for this simulation job in E.164 format. Null
251
+ * if the simulation job is queued and has not been assigned a phone number yet.
252
+ */
253
+ roarkPhoneNumber?: string | null;
254
+
255
+ /**
256
+ * When the simulation job started
257
+ */
258
+ startedAt?: string | null;
259
+ }
260
+
261
+ export namespace SimulationJob {
262
+ /**
263
+ * Agent endpoint used in a simulation
264
+ */
265
+ export interface AgentEndpoint {
266
+ /**
267
+ * Agent endpoint ID
268
+ */
269
+ id: string;
270
+
271
+ /**
272
+ * Agent endpoint name
273
+ */
274
+ name: string;
275
+
276
+ /**
277
+ * Agent endpoint phone number
278
+ */
279
+ phoneNumber: string | null;
280
+
281
+ /**
282
+ * Agent endpoint type
283
+ */
284
+ type: 'PHONE' | 'WEBSOCKET';
285
+ }
286
+
287
+ export interface Persona {
288
+ /**
289
+ * Unique identifier of the persona
290
+ */
291
+ id: string;
292
+
293
+ /**
294
+ * Accent of the persona, defined using ISO 3166-1 alpha-2 country codes with
295
+ * optional variants
296
+ */
297
+ accent:
298
+ | 'US'
299
+ | 'US_X_SOUTH'
300
+ | 'GB'
301
+ | 'ES'
302
+ | 'DE'
303
+ | 'IN'
304
+ | 'FR'
305
+ | 'NL'
306
+ | 'SA'
307
+ | 'GR'
308
+ | 'AU'
309
+ | 'IT'
310
+ | 'ID'
311
+ | 'TH'
312
+ | 'JP';
313
+
314
+ /**
315
+ * Background noise setting
316
+ */
317
+ backgroundNoise:
318
+ | 'NONE'
319
+ | 'AIRPORT'
320
+ | 'CHILDREN_PLAYING'
321
+ | 'CITY'
322
+ | 'COFFEE_SHOP'
323
+ | 'DRIVING'
324
+ | 'OFFICE'
325
+ | 'THUNDERSTORM';
326
+
327
+ /**
328
+ * Base emotional state of the persona
329
+ */
330
+ baseEmotion: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED';
331
+
332
+ /**
333
+ * How the persona confirms information
334
+ */
335
+ confirmationStyle: 'EXPLICIT' | 'VAGUE';
336
+
337
+ /**
338
+ * Creation timestamp
339
+ */
340
+ createdAt: string;
341
+
342
+ /**
343
+ * Gender of the persona
344
+ */
345
+ gender: 'MALE' | 'FEMALE' | 'NEUTRAL';
346
+
347
+ /**
348
+ * Whether the persona uses filler words like "um" and "uh"
349
+ */
350
+ hasDisfluencies: boolean;
351
+
352
+ /**
353
+ * How clearly the persona expresses their intentions
354
+ */
355
+ intentClarity: 'CLEAR' | 'INDIRECT' | 'VAGUE';
356
+
357
+ /**
358
+ * Primary language ISO 639-1 code for the persona
359
+ */
360
+ language: 'EN' | 'ES' | 'DE' | 'HI' | 'FR' | 'NL' | 'AR' | 'EL' | 'IT' | 'ID' | 'TH' | 'JA';
361
+
362
+ /**
363
+ * How reliable the persona's memory is
364
+ */
365
+ memoryReliability: 'HIGH' | 'LOW';
366
+
367
+ /**
368
+ * The name the agent will identify as during conversations
369
+ */
370
+ name: string;
371
+
372
+ /**
373
+ * Additional custom properties about the persona
374
+ */
375
+ properties: { [key: string]: unknown };
376
+
377
+ /**
378
+ * Speech clarity of the persona
379
+ */
380
+ speechClarity: 'CLEAR' | 'VAGUE' | 'RAMBLING';
381
+
382
+ /**
383
+ * Speech pace of the persona
384
+ */
385
+ speechPace: 'SLOW' | 'NORMAL' | 'FAST';
386
+
387
+ /**
388
+ * Last update timestamp
389
+ */
390
+ updatedAt: string;
391
+
392
+ /**
393
+ * Background story and behavioral patterns for the persona
394
+ */
395
+ backstoryPrompt?: string | null;
396
+
397
+ /**
398
+ * Human-readable description of the persona
399
+ */
400
+ description?: string | null;
401
+
402
+ /**
403
+ * Secondary language ISO 639-1 code for code-switching (e.g., Hinglish, Spanglish)
404
+ */
405
+ secondaryLanguage?: 'EN' | null;
406
+ }
407
+
408
+ /**
409
+ * Scenario used in a simulation
410
+ */
411
+ export interface Scenario {
412
+ /**
413
+ * Scenario ID
414
+ */
415
+ id: string;
416
+
417
+ /**
418
+ * Scenario description
419
+ */
420
+ description?: string | null;
421
+ }
422
+ }
423
+ }
424
+ }
425
+
426
+ export interface SimulationRunPlanJobStartResponse {
427
+ /**
428
+ * Response when triggering a simulation run plan
429
+ */
430
+ data: SimulationRunPlanJobStartResponse.Data;
431
+ }
432
+
433
+ export namespace SimulationRunPlanJobStartResponse {
434
+ /**
435
+ * Response when triggering a simulation run plan
436
+ */
437
+ export interface Data {
438
+ /**
439
+ * When the job was created
440
+ */
441
+ createdAt: string;
442
+
443
+ /**
444
+ * ID of the simulation run plan that was executed
445
+ */
446
+ simulationRunPlanId: string;
447
+
448
+ /**
449
+ * ID of the simulation run plan job that was created
450
+ */
451
+ simulationRunPlanJobId: string;
452
+
453
+ /**
454
+ * Initial status of the job
455
+ */
456
+ status:
457
+ | 'PENDING'
458
+ | 'QUEUED'
459
+ | 'CREATING_SNAPSHOTS'
460
+ | 'CREATING_SIMULATIONS'
461
+ | 'RUNNING_SIMULATIONS'
462
+ | 'COMPLETED'
463
+ | 'FAILED'
464
+ | 'TIMED_OUT'
465
+ | 'CANCELLED'
466
+ | 'CANCELLING';
467
+ }
468
+ }
469
+
470
+ export interface SimulationRunPlanJobListParams {
471
+ /**
472
+ * Cursor for pagination - use the nextCursor value from a previous response
473
+ */
474
+ after?: string;
475
+
476
+ /**
477
+ * Filter by label ID attached to the plan job. Use this if you know the label ID.
478
+ */
479
+ labelId?: string;
480
+
481
+ /**
482
+ * Filter by label name attached to the plan job. More user-friendly alternative to
483
+ * labelId. Case-insensitive.
484
+ */
485
+ labelName?: string;
486
+
487
+ /**
488
+ * Maximum number of plan jobs to return (default: 20, max: 50)
489
+ */
490
+ limit?: number;
491
+
492
+ /**
493
+ * Filter by simulation run plan ID
494
+ */
495
+ simulationRunPlanId?: string;
496
+
497
+ /**
498
+ * Filter by plan job status (PENDING, CREATING_SNAPSHOTS, CREATING_SIMULATIONS,
499
+ * RUNNING_SIMULATIONS, COMPLETED, FAILED, TIMED_OUT, CANCELLED, CANCELLING)
500
+ */
501
+ status?:
502
+ | 'PENDING'
503
+ | 'QUEUED'
504
+ | 'CREATING_SNAPSHOTS'
505
+ | 'CREATING_SIMULATIONS'
506
+ | 'RUNNING_SIMULATIONS'
507
+ | 'COMPLETED'
508
+ | 'FAILED'
509
+ | 'TIMED_OUT'
510
+ | 'CANCELLED'
511
+ | 'CANCELLING';
512
+ }
513
+
514
+ export declare namespace SimulationRunPlanJob {
515
+ export {
516
+ type SimulationRunPlanJobListResponse as SimulationRunPlanJobListResponse,
517
+ type SimulationRunPlanJobGetByIDResponse as SimulationRunPlanJobGetByIDResponse,
518
+ type SimulationRunPlanJobStartResponse as SimulationRunPlanJobStartResponse,
519
+ type SimulationRunPlanJobListParams as SimulationRunPlanJobListParams,
520
+ };
521
+ }