@roarkanalytics/sdk 7.0.0 → 7.1.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 (54) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/client.d.mts +3 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +3 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/config.d.mts +2 -1
  12. package/resources/config.d.mts.map +1 -1
  13. package/resources/config.d.ts +2 -1
  14. package/resources/config.d.ts.map +1 -1
  15. package/resources/customer-flow.d.mts +49 -9
  16. package/resources/customer-flow.d.mts.map +1 -1
  17. package/resources/customer-flow.d.ts +49 -9
  18. package/resources/customer-flow.d.ts.map +1 -1
  19. package/resources/index.d.mts +1 -0
  20. package/resources/index.d.mts.map +1 -1
  21. package/resources/index.d.ts +1 -0
  22. package/resources/index.d.ts.map +1 -1
  23. package/resources/index.js +3 -1
  24. package/resources/index.js.map +1 -1
  25. package/resources/index.mjs +1 -0
  26. package/resources/index.mjs.map +1 -1
  27. package/resources/metric-variant.d.mts +2 -1
  28. package/resources/metric-variant.d.mts.map +1 -1
  29. package/resources/metric-variant.d.ts +2 -1
  30. package/resources/metric-variant.d.ts.map +1 -1
  31. package/resources/metric.d.mts +24 -21
  32. package/resources/metric.d.mts.map +1 -1
  33. package/resources/metric.d.ts +24 -21
  34. package/resources/metric.d.ts.map +1 -1
  35. package/resources/simulation-audio-clip.d.mts +44 -0
  36. package/resources/simulation-audio-clip.d.mts.map +1 -0
  37. package/resources/simulation-audio-clip.d.ts +44 -0
  38. package/resources/simulation-audio-clip.d.ts.map +1 -0
  39. package/resources/simulation-audio-clip.js +23 -0
  40. package/resources/simulation-audio-clip.js.map +1 -0
  41. package/resources/simulation-audio-clip.mjs +19 -0
  42. package/resources/simulation-audio-clip.mjs.map +1 -0
  43. package/src/client.ts +8 -0
  44. package/src/resources/config.ts +12 -0
  45. package/src/resources/customer-flow.ts +79 -11
  46. package/src/resources/index.ts +1 -0
  47. package/src/resources/metric-variant.ts +2 -1
  48. package/src/resources/metric.ts +24 -21
  49. package/src/resources/simulation-audio-clip.ts +63 -0
  50. package/src/version.ts +1 -1
  51. package/version.d.mts +1 -1
  52. package/version.d.ts +1 -1
  53. package/version.js +1 -1
  54. package/version.mjs +1 -1
@@ -206,11 +206,26 @@ export class CustomerFlow extends APIResource {
206
206
  * whoever holds the phone. It sits between turns like a silence, so it may follow
207
207
  * either side.
208
208
  *
209
+ * A `CUSTOMER_AUDIO` plays audio from the library (`audioClip`, see GET
210
+ * /v1/simulation/audio-clip) on the line for `silenceDurationSeconds` (up to 600,
211
+ * 30 when unset), looping it or cutting it to fit, the way an IVR plays hold
212
+ * music. It plays in a STRICT voice flow only: anywhere else it is a pause of the
213
+ * same length. It sits between turns like a silence.
214
+ *
209
215
  * In a STRICT flow an `AGENT_TURN` may carry its own `offScriptPolicy`, which
210
216
  * replaces the flow-level one at that step. Omit it (or send null) to follow the
211
217
  * flow's policy. Use it where one missed step makes the rest of the call
212
218
  * meaningless: an authentication menu, say, with `then: HANG_UP_INVALIDATE`.
213
219
  *
220
+ * In a STRICT flow an `AGENT_DTMF` may carry an `offScriptPolicy` too, read
221
+ * differently: `waitSeconds` is how long to wait for the keys (at least 5, and
222
+ * just under the run's silence timeout by default and at most) and `then` what
223
+ * follows (`MOVE_ON`, `HANG_UP` or `HANG_UP_INVALIDATE`). Without one the call
224
+ * hangs up in silence after that wait, whatever the flow-level policy says. Speech
225
+ * does not end the wait. `reaction` is `STAY_SILENT` or `REPEAT`: with `REPEAT`
226
+ * the caller says the line before the step again each time the wait runs out, up
227
+ * to `maxAttempts` waits (at most 5), and `then` follows the last one.
228
+ *
214
229
  * Any step may set `stage`, the named phase of the flow it belongs to: the IVR,
215
230
  * the login, the scenario itself. Steps in one stage are drawn as a group in the
216
231
  * editor, and the name is yours: the reports say it back to you. The stage does
@@ -248,7 +263,8 @@ export type FlowStep =
248
263
  | FlowStep.UnionMember6
249
264
  | FlowStep.UnionMember7
250
265
  | FlowStep.UnionMember8
251
- | FlowStep.UnionMember9;
266
+ | FlowStep.UnionMember9
267
+ | FlowStep.UnionMember10;
252
268
 
253
269
  export namespace FlowStep {
254
270
  export interface UnionMember0 {
@@ -396,9 +412,19 @@ export namespace FlowStep {
396
412
  }
397
413
 
398
414
  export interface UnionMember5 {
399
- type: 'CUSTOMER_DTMF';
400
-
401
- dtmfDigits?: string | null;
415
+ type: 'CUSTOMER_AUDIO';
416
+
417
+ audioClip?:
418
+ | 'HOLD_MUSIC_CLASSICAL_PIANO'
419
+ | 'HOLD_MUSIC_CLASSICAL_ORCHESTRA'
420
+ | 'HOLD_MUSIC_STRING_QUARTET'
421
+ | 'HOLD_MUSIC_AMBIENT'
422
+ | 'HOLD_MUSIC_SMOOTH_JAZZ'
423
+ | 'HOLD_MUSIC_SOFT_SYNTH'
424
+ | 'HOLD_BEEP'
425
+ | 'RINGBACK_US'
426
+ | 'RINGBACK_UK'
427
+ | null;
402
428
 
403
429
  mergeIntoNodeIds?: Array<string>;
404
430
 
@@ -406,6 +432,8 @@ export namespace FlowStep {
406
432
 
407
433
  ref?: string;
408
434
 
435
+ silenceDurationSeconds?: number | null;
436
+
409
437
  stage?: UnionMember5.Stage | null;
410
438
 
411
439
  steps?: Array<CustomerFlowAPI.FlowStep>;
@@ -422,7 +450,7 @@ export namespace FlowStep {
422
450
  }
423
451
 
424
452
  export interface UnionMember6 {
425
- type: 'AGENT_DTMF';
453
+ type: 'CUSTOMER_DTMF';
426
454
 
427
455
  dtmfDigits?: string | null;
428
456
 
@@ -448,12 +476,16 @@ export namespace FlowStep {
448
476
  }
449
477
 
450
478
  export interface UnionMember7 {
451
- type: 'VOICEMAIL';
479
+ type: 'AGENT_DTMF';
480
+
481
+ dtmfDigits?: string | null;
452
482
 
453
483
  mergeIntoNodeIds?: Array<string>;
454
484
 
455
485
  nodeId?: string;
456
486
 
487
+ offScriptPolicy?: UnionMember7.OffScriptPolicy | null;
488
+
457
489
  ref?: string;
458
490
 
459
491
  stage?: UnionMember7.Stage | null;
@@ -462,6 +494,18 @@ export namespace FlowStep {
462
494
  }
463
495
 
464
496
  export namespace UnionMember7 {
497
+ export interface OffScriptPolicy {
498
+ maxAttempts: number;
499
+
500
+ reaction: 'STAY_SILENT' | 'REPEAT' | 'RESPOND' | 'SAY';
501
+
502
+ then: 'HANG_UP' | 'MOVE_ON' | 'ADAPT' | 'HANG_UP_INVALIDATE';
503
+
504
+ sayLine?: string | null;
505
+
506
+ waitSeconds?: number | null;
507
+ }
508
+
465
509
  export interface Stage {
466
510
  name: string;
467
511
 
@@ -472,9 +516,7 @@ export namespace FlowStep {
472
516
  }
473
517
 
474
518
  export interface UnionMember8 {
475
- type: 'CUSTOMER_HANDOFF';
476
-
477
- handoffPersonaId?: string | null;
519
+ type: 'VOICEMAIL';
478
520
 
479
521
  mergeIntoNodeIds?: Array<string>;
480
522
 
@@ -498,6 +540,32 @@ export namespace FlowStep {
498
540
  }
499
541
 
500
542
  export interface UnionMember9 {
543
+ type: 'CUSTOMER_HANDOFF';
544
+
545
+ handoffPersonaId?: string | null;
546
+
547
+ mergeIntoNodeIds?: Array<string>;
548
+
549
+ nodeId?: string;
550
+
551
+ ref?: string;
552
+
553
+ stage?: UnionMember9.Stage | null;
554
+
555
+ steps?: Array<CustomerFlowAPI.FlowStep>;
556
+ }
557
+
558
+ export namespace UnionMember9 {
559
+ export interface Stage {
560
+ name: string;
561
+
562
+ analyze?: boolean;
563
+
564
+ required?: boolean;
565
+ }
566
+ }
567
+
568
+ export interface UnionMember10 {
501
569
  type: 'SCENARIO_LINK';
502
570
 
503
571
  linkedCustomerFlowId?: string | null;
@@ -510,12 +578,12 @@ export namespace FlowStep {
510
578
 
511
579
  ref?: string;
512
580
 
513
- stage?: UnionMember9.Stage | null;
581
+ stage?: UnionMember10.Stage | null;
514
582
 
515
583
  steps?: Array<CustomerFlowAPI.FlowStep>;
516
584
  }
517
585
 
518
- export namespace UnionMember9 {
586
+ export namespace UnionMember10 {
519
587
  export interface Stage {
520
588
  name: string;
521
589
 
@@ -290,6 +290,7 @@ export {
290
290
  type SimulationMockToolParams,
291
291
  type SimulationRunParams,
292
292
  } from './simulation';
293
+ export { SimulationAudioClip, type SimulationAudioClipListResponse } from './simulation-audio-clip';
293
294
  export {
294
295
  SimulationEnvironment,
295
296
  type SimulationEnvironmentCreateResponse,
@@ -404,7 +404,8 @@ export interface MetricVariantUpdateParams {
404
404
 
405
405
  /**
406
406
  * Body param: Score this metric on a simulated call with fewer than 4 transcript
407
- * lines. Such calls skip every other metric. Default false.
407
+ * lines or where your agent never spoke (custom metrics only, not ones that judge
408
+ * the audio). Such calls skip every other metric. Default false.
408
409
  */
409
410
  gradesShortCalls?: boolean;
410
411
 
@@ -124,7 +124,7 @@ export namespace MetricCreateDefinitionResponse {
124
124
 
125
125
  /**
126
126
  * Whether a simulation scores this metric on a call with fewer than 4 transcript
127
- * lines. Such calls skip every metric without it.
127
+ * lines or where your agent never spoke. Such calls skip every metric without it.
128
128
  */
129
129
  gradesShortCalls: boolean;
130
130
 
@@ -281,7 +281,7 @@ export namespace MetricCreateDefinitionResponse {
281
281
 
282
282
  /**
283
283
  * Whether a simulation scores this metric on a call with fewer than 4 transcript
284
- * lines. Such calls skip every metric without it.
284
+ * lines or where your agent never spoke. Such calls skip every metric without it.
285
285
  */
286
286
  gradesShortCalls: boolean;
287
287
 
@@ -444,7 +444,7 @@ export namespace MetricCreateDefinitionResponse {
444
444
 
445
445
  /**
446
446
  * Whether a simulation scores this metric on a call with fewer than 4 transcript
447
- * lines. Such calls skip every metric without it.
447
+ * lines or where your agent never spoke. Such calls skip every metric without it.
448
448
  */
449
449
  gradesShortCalls: boolean;
450
450
 
@@ -663,7 +663,7 @@ export namespace MetricCreateDefinitionResponse {
663
663
 
664
664
  /**
665
665
  * Whether a simulation scores this metric on a call with fewer than 4 transcript
666
- * lines. Such calls skip every metric without it.
666
+ * lines or where your agent never spoke. Such calls skip every metric without it.
667
667
  */
668
668
  gradesShortCalls: boolean;
669
669
 
@@ -866,7 +866,7 @@ export namespace MetricListDefinitionsResponse {
866
866
 
867
867
  /**
868
868
  * Whether a simulation scores this metric on a call with fewer than 4 transcript
869
- * lines. Such calls skip every metric without it.
869
+ * lines or where your agent never spoke. Such calls skip every metric without it.
870
870
  */
871
871
  gradesShortCalls: boolean;
872
872
 
@@ -1018,7 +1018,7 @@ export namespace MetricListDefinitionsResponse {
1018
1018
 
1019
1019
  /**
1020
1020
  * Whether a simulation scores this metric on a call with fewer than 4 transcript
1021
- * lines. Such calls skip every metric without it.
1021
+ * lines or where your agent never spoke. Such calls skip every metric without it.
1022
1022
  */
1023
1023
  gradesShortCalls: boolean;
1024
1024
 
@@ -1164,7 +1164,7 @@ export namespace MetricListDefinitionsResponse {
1164
1164
 
1165
1165
  /**
1166
1166
  * Whether a simulation scores this metric on a call with fewer than 4 transcript
1167
- * lines. Such calls skip every metric without it.
1167
+ * lines or where your agent never spoke. Such calls skip every metric without it.
1168
1168
  */
1169
1169
  gradesShortCalls: boolean;
1170
1170
 
@@ -1345,7 +1345,7 @@ export namespace MetricListDefinitionsResponse {
1345
1345
 
1346
1346
  /**
1347
1347
  * Whether a simulation scores this metric on a call with fewer than 4 transcript
1348
- * lines. Such calls skip every metric without it.
1348
+ * lines or where your agent never spoke. Such calls skip every metric without it.
1349
1349
  */
1350
1350
  gradesShortCalls: boolean;
1351
1351
 
@@ -1508,7 +1508,7 @@ export namespace MetricListDefinitionsResponse {
1508
1508
 
1509
1509
  /**
1510
1510
  * Whether a simulation scores this metric on a call with fewer than 4 transcript
1511
- * lines. Such calls skip every metric without it.
1511
+ * lines or where your agent never spoke. Such calls skip every metric without it.
1512
1512
  */
1513
1513
  gradesShortCalls: boolean;
1514
1514
 
@@ -1727,7 +1727,7 @@ export namespace MetricListDefinitionsResponse {
1727
1727
 
1728
1728
  /**
1729
1729
  * Whether a simulation scores this metric on a call with fewer than 4 transcript
1730
- * lines. Such calls skip every metric without it.
1730
+ * lines or where your agent never spoke. Such calls skip every metric without it.
1731
1731
  */
1732
1732
  gradesShortCalls: boolean;
1733
1733
 
@@ -1934,7 +1934,7 @@ export namespace MetricUpdateDefinitionResponse {
1934
1934
 
1935
1935
  /**
1936
1936
  * Whether a simulation scores this metric on a call with fewer than 4 transcript
1937
- * lines. Such calls skip every metric without it.
1937
+ * lines or where your agent never spoke. Such calls skip every metric without it.
1938
1938
  */
1939
1939
  gradesShortCalls: boolean;
1940
1940
 
@@ -2091,7 +2091,7 @@ export namespace MetricUpdateDefinitionResponse {
2091
2091
 
2092
2092
  /**
2093
2093
  * Whether a simulation scores this metric on a call with fewer than 4 transcript
2094
- * lines. Such calls skip every metric without it.
2094
+ * lines or where your agent never spoke. Such calls skip every metric without it.
2095
2095
  */
2096
2096
  gradesShortCalls: boolean;
2097
2097
 
@@ -2254,7 +2254,7 @@ export namespace MetricUpdateDefinitionResponse {
2254
2254
 
2255
2255
  /**
2256
2256
  * Whether a simulation scores this metric on a call with fewer than 4 transcript
2257
- * lines. Such calls skip every metric without it.
2257
+ * lines or where your agent never spoke. Such calls skip every metric without it.
2258
2258
  */
2259
2259
  gradesShortCalls: boolean;
2260
2260
 
@@ -2462,7 +2462,7 @@ export namespace MetricUpdateDefinitionResponse {
2462
2462
 
2463
2463
  /**
2464
2464
  * Whether a simulation scores this metric on a call with fewer than 4 transcript
2465
- * lines. Such calls skip every metric without it.
2465
+ * lines or where your agent never spoke. Such calls skip every metric without it.
2466
2466
  */
2467
2467
  gradesShortCalls: boolean;
2468
2468
 
@@ -2649,7 +2649,7 @@ export namespace MetricUpdateDefinitionResponse {
2649
2649
 
2650
2650
  /**
2651
2651
  * Whether a simulation scores this metric on a call with fewer than 4 transcript
2652
- * lines. Such calls skip every metric without it.
2652
+ * lines or where your agent never spoke. Such calls skip every metric without it.
2653
2653
  */
2654
2654
  gradesShortCalls: boolean;
2655
2655
 
@@ -2842,8 +2842,9 @@ export declare namespace MetricCreateDefinitionParams {
2842
2842
  classificationOptions?: Array<PromptMetricInput.ClassificationOption>;
2843
2843
 
2844
2844
  /**
2845
- * Score this metric on a simulated call with fewer than 4 transcript lines. Such
2846
- * calls skip every other metric. Default false.
2845
+ * Score this metric on a simulated call with fewer than 4 transcript lines or
2846
+ * where your agent never spoke (custom metrics only, not ones that judge the
2847
+ * audio). Such calls skip every other metric. Default false.
2847
2848
  */
2848
2849
  gradesShortCalls?: boolean;
2849
2850
 
@@ -3167,8 +3168,9 @@ export declare namespace MetricCreateDefinitionParams {
3167
3168
  booleanTrueLabel?: string;
3168
3169
 
3169
3170
  /**
3170
- * Score this metric on a simulated call with fewer than 4 transcript lines. Such
3171
- * calls skip every other metric. Default false.
3171
+ * Score this metric on a simulated call with fewer than 4 transcript lines or
3172
+ * where your agent never spoke (custom metrics only, not ones that judge the
3173
+ * audio). Such calls skip every other metric. Default false.
3172
3174
  */
3173
3175
  gradesShortCalls?: boolean;
3174
3176
 
@@ -3255,8 +3257,9 @@ export interface MetricUpdateDefinitionParams {
3255
3257
  formula?: string;
3256
3258
 
3257
3259
  /**
3258
- * Score this metric on a simulated call with fewer than 4 transcript lines. Such
3259
- * calls skip every other metric. Default false.
3260
+ * Score this metric on a simulated call with fewer than 4 transcript lines or
3261
+ * where your agent never spoke (custom metrics only, not ones that judge the
3262
+ * audio). Such calls skip every other metric. Default false.
3260
3263
  */
3261
3264
  gradesShortCalls?: boolean;
3262
3265
 
@@ -0,0 +1,63 @@
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 SimulationAudioClip extends APIResource {
8
+ /**
9
+ * Returns the audio a CUSTOMER_AUDIO step can play: hold music, hold tones and
10
+ * ringback. Name one as the step's `audioClip`. A fixed catalogue, so it is not
11
+ * paginated.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const simulationAudioClips =
16
+ * await client.simulationAudioClip.list();
17
+ * ```
18
+ */
19
+ list(options?: RequestOptions): APIPromise<SimulationAudioClipListResponse> {
20
+ return this._client.get('/v1/simulation/audio-clip', options);
21
+ }
22
+ }
23
+
24
+ export interface SimulationAudioClipListResponse {
25
+ data: Array<SimulationAudioClipListResponse.Data>;
26
+ }
27
+
28
+ export namespace SimulationAudioClipListResponse {
29
+ export interface Data {
30
+ /**
31
+ * The kind of audio this is
32
+ */
33
+ category: 'HOLD_MUSIC' | 'HOLD_TONE' | 'RINGBACK';
34
+
35
+ /**
36
+ * What a CUSTOMER_AUDIO step names as its `audioClip`
37
+ */
38
+ clip:
39
+ | 'HOLD_MUSIC_CLASSICAL_PIANO'
40
+ | 'HOLD_MUSIC_CLASSICAL_ORCHESTRA'
41
+ | 'HOLD_MUSIC_STRING_QUARTET'
42
+ | 'HOLD_MUSIC_AMBIENT'
43
+ | 'HOLD_MUSIC_SMOOTH_JAZZ'
44
+ | 'HOLD_MUSIC_SOFT_SYNTH'
45
+ | 'HOLD_BEEP'
46
+ | 'RINGBACK_US'
47
+ | 'RINGBACK_UK';
48
+
49
+ /**
50
+ * What it sounds like
51
+ */
52
+ description: string;
53
+
54
+ /**
55
+ * What the clip is called
56
+ */
57
+ name: string;
58
+ }
59
+ }
60
+
61
+ export declare namespace SimulationAudioClip {
62
+ export { type SimulationAudioClipListResponse as SimulationAudioClipListResponse };
63
+ }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '7.0.0'; // x-release-please-version
1
+ export const VERSION = '7.1.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "7.0.0";
1
+ export declare const VERSION = "7.1.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "7.0.0";
1
+ export declare const VERSION = "7.1.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '7.0.0'; // x-release-please-version
4
+ exports.VERSION = '7.1.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '7.0.0'; // x-release-please-version
1
+ export const VERSION = '7.1.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map