@roarkanalytics/sdk 2.22.0 → 2.23.1

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 +27 -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
@@ -30,6 +30,18 @@ export class Call extends APIResource {
30
30
  return this._client.get(path`/v1/call/${callID}`, options);
31
31
  }
32
32
 
33
+ /**
34
+ * Fetch the full transcript for a specific call. Optionally specify a
35
+ * transcription source; otherwise the best available source is used automatically.
36
+ */
37
+ getTranscript(
38
+ callID: string,
39
+ query: CallGetTranscriptParams | null | undefined = {},
40
+ options?: RequestOptions,
41
+ ): APIPromise<CallGetTranscriptResponse> {
42
+ return this._client.get(path`/v1/call/${callID}/transcript`, { query, ...options });
43
+ }
44
+
33
45
  /**
34
46
  * Fetch all evaluation run results for a specific call.
35
47
  */
@@ -436,6 +448,132 @@ export namespace CallGetByIDResponse {
436
448
  }
437
449
  }
438
450
 
451
+ export interface CallGetTranscriptResponse {
452
+ /**
453
+ * Call transcript response
454
+ */
455
+ data: CallGetTranscriptResponse.Data;
456
+ }
457
+
458
+ export namespace CallGetTranscriptResponse {
459
+ /**
460
+ * Call transcript response
461
+ */
462
+ export interface Data {
463
+ /**
464
+ * Ordered list of transcript entries from the call
465
+ */
466
+ entries: Array<Data.Entry>;
467
+
468
+ /**
469
+ * All participants in this transcript, referenced by participantId on each entry
470
+ */
471
+ participants: Array<Data.UnionMember0 | Data.UnionMember1 | Data.UnionMember2 | Data.UnionMember3>;
472
+
473
+ /**
474
+ * The transcription source used for this transcript. Null if no transcript is
475
+ * available.
476
+ */
477
+ transcriptionSource: 'ROARK_POST_CALL' | 'SIMULATION_AGENT_REALTIME' | 'CUSTOMER_AGENT_REALTIME' | null;
478
+ }
479
+
480
+ export namespace Data {
481
+ /**
482
+ * A single transcript entry
483
+ */
484
+ export interface Entry {
485
+ /**
486
+ * End time offset in milliseconds from the start of the call
487
+ */
488
+ endOffsetMs: number;
489
+
490
+ /**
491
+ * ID of the conversation participant who spoke this entry. References
492
+ * participants[].id.
493
+ */
494
+ participantId: string | null;
495
+
496
+ /**
497
+ * Convenience role derived from participant type
498
+ */
499
+ role: 'AGENT' | 'CUSTOMER' | null;
500
+
501
+ /**
502
+ * Start time offset in milliseconds from the start of the call
503
+ */
504
+ startOffsetMs: number;
505
+
506
+ /**
507
+ * Transcript text for this entry
508
+ */
509
+ text: string;
510
+ }
511
+
512
+ /**
513
+ * An agent participant
514
+ */
515
+ export interface UnionMember0 {
516
+ /**
517
+ * Conversation participant ID
518
+ */
519
+ id: string;
520
+
521
+ /**
522
+ * ID of the agent entity
523
+ */
524
+ agentId: string | null;
525
+
526
+ type: 'AGENT';
527
+ }
528
+
529
+ /**
530
+ * A customer participant
531
+ */
532
+ export interface UnionMember1 {
533
+ /**
534
+ * Conversation participant ID
535
+ */
536
+ id: string;
537
+
538
+ /**
539
+ * ID of the conversation customer record
540
+ */
541
+ customerId: string | null;
542
+
543
+ type: 'CUSTOMER';
544
+ }
545
+
546
+ /**
547
+ * A simulated customer participant
548
+ */
549
+ export interface UnionMember2 {
550
+ /**
551
+ * Conversation participant ID
552
+ */
553
+ id: string;
554
+
555
+ /**
556
+ * ID of the conversation customer record
557
+ */
558
+ customerId: string | null;
559
+
560
+ type: 'SIMULATED_CUSTOMER';
561
+ }
562
+
563
+ /**
564
+ * A background speaker participant
565
+ */
566
+ export interface UnionMember3 {
567
+ /**
568
+ * Conversation participant ID
569
+ */
570
+ id: string;
571
+
572
+ type: 'BACKGROUND_SPEAKER';
573
+ }
574
+ }
575
+ }
576
+
439
577
  export interface CallListEvaluationRunsResponse {
440
578
  /**
441
579
  * Evaluation run response payload
@@ -1536,6 +1674,15 @@ export interface CallListParams {
1536
1674
  status?: 'RINGING' | 'IN_PROGRESS' | 'ENDED';
1537
1675
  }
1538
1676
 
1677
+ export interface CallGetTranscriptParams {
1678
+ /**
1679
+ * Transcription source to fetch. When omitted, uses the preferred source based on
1680
+ * availability: CUSTOMER_AGENT_REALTIME > SIMULATION_AGENT_REALTIME >
1681
+ * ROARK_POST_CALL
1682
+ */
1683
+ source?: 'ROARK_POST_CALL' | 'SIMULATION_AGENT_REALTIME' | 'CUSTOMER_AGENT_REALTIME';
1684
+ }
1685
+
1539
1686
  export interface CallListMetricsParams {
1540
1687
  /**
1541
1688
  * Whether to return a flat list instead of grouped by metric definition (default:
@@ -1549,11 +1696,13 @@ export declare namespace Call {
1549
1696
  type CallCreateResponse as CallCreateResponse,
1550
1697
  type CallListResponse as CallListResponse,
1551
1698
  type CallGetByIDResponse as CallGetByIDResponse,
1699
+ type CallGetTranscriptResponse as CallGetTranscriptResponse,
1552
1700
  type CallListEvaluationRunsResponse as CallListEvaluationRunsResponse,
1553
1701
  type CallListMetricsResponse as CallListMetricsResponse,
1554
1702
  type CallListSentimentRunsResponse as CallListSentimentRunsResponse,
1555
1703
  type CallCreateParams as CallCreateParams,
1556
1704
  type CallListParams as CallListParams,
1705
+ type CallGetTranscriptParams as CallGetTranscriptParams,
1557
1706
  type CallListMetricsParams as CallListMetricsParams,
1558
1707
  };
1559
1708
  }