@roarkanalytics/sdk 2.33.2 → 3.0.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 (165) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/agent-endpoint.d.mts +26 -0
  10. package/resources/agent-endpoint.d.mts.map +1 -1
  11. package/resources/agent-endpoint.d.ts +26 -0
  12. package/resources/agent-endpoint.d.ts.map +1 -1
  13. package/resources/agent-endpoint.js +26 -0
  14. package/resources/agent-endpoint.js.map +1 -1
  15. package/resources/agent-endpoint.mjs +26 -0
  16. package/resources/agent-endpoint.mjs.map +1 -1
  17. package/resources/agent.d.mts +20 -0
  18. package/resources/agent.d.mts.map +1 -1
  19. package/resources/agent.d.ts +20 -0
  20. package/resources/agent.d.ts.map +1 -1
  21. package/resources/agent.js +20 -0
  22. package/resources/agent.js.map +1 -1
  23. package/resources/agent.mjs +20 -0
  24. package/resources/agent.mjs.map +1 -1
  25. package/resources/call.d.mts +39 -170
  26. package/resources/call.d.mts.map +1 -1
  27. package/resources/call.d.ts +39 -170
  28. package/resources/call.d.ts.map +1 -1
  29. package/resources/call.js +39 -0
  30. package/resources/call.js.map +1 -1
  31. package/resources/call.mjs +39 -0
  32. package/resources/call.mjs.map +1 -1
  33. package/resources/config.d.mts +90 -99
  34. package/resources/config.d.mts.map +1 -1
  35. package/resources/config.d.ts +90 -99
  36. package/resources/config.d.ts.map +1 -1
  37. package/resources/config.js +18 -5
  38. package/resources/config.js.map +1 -1
  39. package/resources/config.mjs +18 -5
  40. package/resources/config.mjs.map +1 -1
  41. package/resources/customer-flow-edge-case.d.mts +79 -0
  42. package/resources/customer-flow-edge-case.d.mts.map +1 -1
  43. package/resources/customer-flow-edge-case.d.ts +79 -0
  44. package/resources/customer-flow-edge-case.d.ts.map +1 -1
  45. package/resources/customer-flow-edge-case.js +34 -0
  46. package/resources/customer-flow-edge-case.js.map +1 -1
  47. package/resources/customer-flow-edge-case.mjs +34 -0
  48. package/resources/customer-flow-edge-case.mjs.map +1 -1
  49. package/resources/customer-flow.d.mts +271 -615
  50. package/resources/customer-flow.d.mts.map +1 -1
  51. package/resources/customer-flow.d.ts +271 -615
  52. package/resources/customer-flow.d.ts.map +1 -1
  53. package/resources/customer-flow.js +42 -1
  54. package/resources/customer-flow.js.map +1 -1
  55. package/resources/customer-flow.mjs +42 -1
  56. package/resources/customer-flow.mjs.map +1 -1
  57. package/resources/health.d.mts +5 -0
  58. package/resources/health.d.mts.map +1 -1
  59. package/resources/health.d.ts +5 -0
  60. package/resources/health.d.ts.map +1 -1
  61. package/resources/health.js +5 -0
  62. package/resources/health.js.map +1 -1
  63. package/resources/health.mjs +5 -0
  64. package/resources/health.mjs.map +1 -1
  65. package/resources/http-request-definition.d.mts +29 -0
  66. package/resources/http-request-definition.d.mts.map +1 -1
  67. package/resources/http-request-definition.d.ts +29 -0
  68. package/resources/http-request-definition.d.ts.map +1 -1
  69. package/resources/http-request-definition.js +29 -0
  70. package/resources/http-request-definition.js.map +1 -1
  71. package/resources/http-request-definition.mjs +29 -0
  72. package/resources/http-request-definition.mjs.map +1 -1
  73. package/resources/index.d.mts +1 -1
  74. package/resources/index.d.mts.map +1 -1
  75. package/resources/index.d.ts +1 -1
  76. package/resources/index.d.ts.map +1 -1
  77. package/resources/index.js.map +1 -1
  78. package/resources/index.mjs.map +1 -1
  79. package/resources/metric-collection-job.d.mts +23 -0
  80. package/resources/metric-collection-job.d.mts.map +1 -1
  81. package/resources/metric-collection-job.d.ts +23 -0
  82. package/resources/metric-collection-job.d.ts.map +1 -1
  83. package/resources/metric-collection-job.js +23 -0
  84. package/resources/metric-collection-job.js.map +1 -1
  85. package/resources/metric-collection-job.mjs +23 -0
  86. package/resources/metric-collection-job.mjs.map +1 -1
  87. package/resources/metric.d.mts +5 -7
  88. package/resources/metric.d.mts.map +1 -1
  89. package/resources/metric.d.ts +5 -7
  90. package/resources/metric.d.ts.map +1 -1
  91. package/resources/metric.js +5 -0
  92. package/resources/metric.js.map +1 -1
  93. package/resources/metric.mjs +5 -0
  94. package/resources/metric.mjs.map +1 -1
  95. package/resources/simulation-environment.d.mts +13 -0
  96. package/resources/simulation-environment.d.mts.map +1 -1
  97. package/resources/simulation-environment.d.ts +13 -0
  98. package/resources/simulation-environment.d.ts.map +1 -1
  99. package/resources/simulation-environment.js +13 -0
  100. package/resources/simulation-environment.js.map +1 -1
  101. package/resources/simulation-environment.mjs +13 -0
  102. package/resources/simulation-environment.mjs.map +1 -1
  103. package/resources/simulation-job.d.mts +14 -4
  104. package/resources/simulation-job.d.mts.map +1 -1
  105. package/resources/simulation-job.d.ts +14 -4
  106. package/resources/simulation-job.d.ts.map +1 -1
  107. package/resources/simulation-job.js +1 -1
  108. package/resources/simulation-job.js.map +1 -1
  109. package/resources/simulation-job.mjs +1 -1
  110. package/resources/simulation-job.mjs.map +1 -1
  111. package/resources/simulation-persona.d.mts +32 -3
  112. package/resources/simulation-persona.d.mts.map +1 -1
  113. package/resources/simulation-persona.d.ts +32 -3
  114. package/resources/simulation-persona.d.ts.map +1 -1
  115. package/resources/simulation-persona.js +2 -3
  116. package/resources/simulation-persona.js.map +1 -1
  117. package/resources/simulation-persona.mjs +2 -3
  118. package/resources/simulation-persona.mjs.map +1 -1
  119. package/resources/simulation-run-plan-job.d.mts +14 -2
  120. package/resources/simulation-run-plan-job.d.mts.map +1 -1
  121. package/resources/simulation-run-plan-job.d.ts +14 -2
  122. package/resources/simulation-run-plan-job.d.ts.map +1 -1
  123. package/resources/simulation-run-plan-job.js +7 -0
  124. package/resources/simulation-run-plan-job.js.map +1 -1
  125. package/resources/simulation-run-plan-job.mjs +7 -0
  126. package/resources/simulation-run-plan-job.mjs.map +1 -1
  127. package/resources/simulation.d.mts +2 -2
  128. package/resources/simulation.d.ts +2 -2
  129. package/resources/simulation.js +2 -2
  130. package/resources/simulation.mjs +2 -2
  131. package/resources/webhook.d.mts +23 -0
  132. package/resources/webhook.d.mts.map +1 -1
  133. package/resources/webhook.d.ts +23 -0
  134. package/resources/webhook.d.ts.map +1 -1
  135. package/resources/webhook.js +23 -0
  136. package/resources/webhook.js.map +1 -1
  137. package/resources/webhook.mjs +23 -0
  138. package/resources/webhook.mjs.map +1 -1
  139. package/src/client.ts +2 -0
  140. package/src/resources/agent-endpoint.ts +26 -0
  141. package/src/resources/agent.ts +20 -0
  142. package/src/resources/call.ts +39 -202
  143. package/src/resources/config.ts +123 -158
  144. package/src/resources/customer-flow-edge-case.ts +88 -0
  145. package/src/resources/customer-flow.ts +318 -1009
  146. package/src/resources/health.ts +5 -0
  147. package/src/resources/http-request-definition.ts +29 -0
  148. package/src/resources/index.ts +1 -0
  149. package/src/resources/metric-collection-job.ts +23 -0
  150. package/src/resources/metric.ts +5 -18
  151. package/src/resources/simulation-environment.ts +13 -0
  152. package/src/resources/simulation-job.ts +16 -4
  153. package/src/resources/simulation-persona.ts +38 -3
  154. package/src/resources/simulation-run-plan-job.ts +15 -2
  155. package/src/resources/simulation.ts +2 -2
  156. package/src/resources/webhook.ts +23 -0
  157. package/src/version.ts +1 -1
  158. package/version.d.mts +1 -1
  159. package/version.d.mts.map +1 -1
  160. package/version.d.ts +1 -1
  161. package/version.d.ts.map +1 -1
  162. package/version.js +1 -1
  163. package/version.js.map +1 -1
  164. package/version.mjs +1 -1
  165. package/version.mjs.map +1 -1
@@ -8,6 +8,16 @@ import { path } from '../internal/utils/path';
8
8
  export class Call extends APIResource {
9
9
  /**
10
10
  * Create a new call with recording, transcript, agents, and customers
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const call = await client.call.create({
15
+ * callDirection: 'INBOUND',
16
+ * interfaceType: 'PHONE',
17
+ * recordingUrl: 'https://example.com',
18
+ * startedAt: 'startedAt',
19
+ * });
20
+ * ```
11
21
  */
12
22
  create(body: CallCreateParams, options?: RequestOptions): APIPromise<CallCreateResponse> {
13
23
  return this._client.post('/v1/call', { body, ...options });
@@ -15,6 +25,11 @@ export class Call extends APIResource {
15
25
 
16
26
  /**
17
27
  * Returns a paginated list of calls for the authenticated project.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const calls = await client.call.list();
32
+ * ```
18
33
  */
19
34
  list(
20
35
  query: CallListParams | null | undefined = {},
@@ -25,6 +40,13 @@ export class Call extends APIResource {
25
40
 
26
41
  /**
27
42
  * Retrieve an existing call by its unique identifier
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * const response = await client.call.getByID(
47
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
48
+ * );
49
+ * ```
28
50
  */
29
51
  getByID(callID: string, options?: RequestOptions): APIPromise<CallGetByIDResponse> {
30
52
  return this._client.get(path`/v1/call/${callID}`, options);
@@ -33,6 +55,11 @@ export class Call extends APIResource {
33
55
  /**
34
56
  * Fetch the full transcript for a specific call. Optionally specify a
35
57
  * transcription source; otherwise the best available source is used automatically.
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * const response = await client.call.getTranscript('callId');
62
+ * ```
36
63
  */
37
64
  getTranscript(
38
65
  callID: string,
@@ -50,6 +77,11 @@ export class Call extends APIResource {
50
77
  * successfully computed metrics; pass `?status=all` to also include rows that
51
78
  * resolved as NOT_APPLICABLE / DATA_MISSING / ERROR (the `value` field is omitted
52
79
  * on those entries — check `captureStatus`).
80
+ *
81
+ * @example
82
+ * ```ts
83
+ * const response = await client.call.listMetrics('callId');
84
+ * ```
53
85
  */
54
86
  listMetrics(
55
87
  callID: string,
@@ -62,6 +94,13 @@ export class Call extends APIResource {
62
94
  /**
63
95
  * Fetch detailed sentiment analysis results for a specific call, including
64
96
  * emotional tone, key phrases, and sentiment scores.
97
+ *
98
+ * @example
99
+ * ```ts
100
+ * const response = await client.call.listSentimentRuns(
101
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
102
+ * );
103
+ * ```
65
104
  */
66
105
  listSentimentRuns(callID: string, options?: RequestOptions): APIPromise<CallListSentimentRunsResponse> {
67
106
  return this._client.get(path`/v1/call/${callID}/sentiment-run`, options);
@@ -1420,192 +1459,6 @@ export namespace CallCreateParams {
1420
1459
  }
1421
1460
  }
1422
1461
 
1423
- export interface AgentIdentificationByRoarkID {
1424
- /**
1425
- * Existing Roark agent ID
1426
- */
1427
- roarkId: string;
1428
-
1429
- /**
1430
- * Endpoint configuration for this agent (optional)
1431
- */
1432
- endpoint?:
1433
- | AgentIdentificationByRoarkID.AgentEndpointByID
1434
- | AgentIdentificationByRoarkID.AgentEndpointByValue;
1435
-
1436
- /**
1437
- * Agent's prompt configuration (optional)
1438
- */
1439
- prompt?: AgentIdentificationByRoarkID.Prompt;
1440
- }
1441
-
1442
- export namespace AgentIdentificationByRoarkID {
1443
- export interface AgentEndpointByID {
1444
- /**
1445
- * Existing Roark endpoint ID
1446
- */
1447
- id: string;
1448
- }
1449
-
1450
- /**
1451
- * Lookup or create endpoint if one with these values does not exist
1452
- */
1453
- export interface AgentEndpointByValue {
1454
- /**
1455
- * Type of endpoint (phone or websocket)
1456
- */
1457
- type: string;
1458
-
1459
- /**
1460
- * Endpoint value (phone number in E.164 format or websocket URL)
1461
- */
1462
- value: string;
1463
-
1464
- /**
1465
- * Call direction for this endpoint
1466
- */
1467
- direction?: string;
1468
- }
1469
-
1470
- /**
1471
- * Agent's prompt configuration (optional)
1472
- */
1473
- export interface Prompt {
1474
- /**
1475
- * The agent's system prompt used during this call
1476
- */
1477
- resolvedPrompt: string;
1478
- }
1479
- }
1480
-
1481
- /**
1482
- * Find existing by customId if provided, otherwise reuse exact project name match
1483
- * before creating
1484
- */
1485
- export interface AgentIdentificationByName {
1486
- /**
1487
- * Agent name
1488
- */
1489
- name: string;
1490
-
1491
- /**
1492
- * Agent custom ID
1493
- */
1494
- customId?: string;
1495
-
1496
- /**
1497
- * Agent description
1498
- */
1499
- description?: string;
1500
-
1501
- /**
1502
- * Endpoint configuration for this agent (optional)
1503
- */
1504
- endpoint?: AgentIdentificationByName.AgentEndpointByID | AgentIdentificationByName.AgentEndpointByValue;
1505
-
1506
- /**
1507
- * Agent's prompt configuration (optional)
1508
- */
1509
- prompt?: AgentIdentificationByName.Prompt;
1510
- }
1511
-
1512
- export namespace AgentIdentificationByName {
1513
- export interface AgentEndpointByID {
1514
- /**
1515
- * Existing Roark endpoint ID
1516
- */
1517
- id: string;
1518
- }
1519
-
1520
- /**
1521
- * Lookup or create endpoint if one with these values does not exist
1522
- */
1523
- export interface AgentEndpointByValue {
1524
- /**
1525
- * Type of endpoint (phone or websocket)
1526
- */
1527
- type: string;
1528
-
1529
- /**
1530
- * Endpoint value (phone number in E.164 format or websocket URL)
1531
- */
1532
- value: string;
1533
-
1534
- /**
1535
- * Call direction for this endpoint
1536
- */
1537
- direction?: string;
1538
- }
1539
-
1540
- /**
1541
- * Agent's prompt configuration (optional)
1542
- */
1543
- export interface Prompt {
1544
- /**
1545
- * The agent's system prompt used during this call
1546
- */
1547
- resolvedPrompt: string;
1548
- }
1549
- }
1550
-
1551
- export interface AgentIdentificationByCustomID {
1552
- /**
1553
- * Existing custom ID for a Roark agent
1554
- */
1555
- customId: string;
1556
-
1557
- /**
1558
- * Endpoint configuration for this agent (optional)
1559
- */
1560
- endpoint?:
1561
- | AgentIdentificationByCustomID.AgentEndpointByID
1562
- | AgentIdentificationByCustomID.AgentEndpointByValue;
1563
-
1564
- /**
1565
- * Agent's prompt configuration (optional)
1566
- */
1567
- prompt?: AgentIdentificationByCustomID.Prompt;
1568
- }
1569
-
1570
- export namespace AgentIdentificationByCustomID {
1571
- export interface AgentEndpointByID {
1572
- /**
1573
- * Existing Roark endpoint ID
1574
- */
1575
- id: string;
1576
- }
1577
-
1578
- /**
1579
- * Lookup or create endpoint if one with these values does not exist
1580
- */
1581
- export interface AgentEndpointByValue {
1582
- /**
1583
- * Type of endpoint (phone or websocket)
1584
- */
1585
- type: string;
1586
-
1587
- /**
1588
- * Endpoint value (phone number in E.164 format or websocket URL)
1589
- */
1590
- value: string;
1591
-
1592
- /**
1593
- * Call direction for this endpoint
1594
- */
1595
- direction?: string;
1596
- }
1597
-
1598
- /**
1599
- * Agent's prompt configuration (optional)
1600
- */
1601
- export interface Prompt {
1602
- /**
1603
- * The agent's system prompt used during this call
1604
- */
1605
- resolvedPrompt: string;
1606
- }
1607
- }
1608
-
1609
1462
  /**
1610
1463
  * Single customer participating in the call. Use this for simpler API when you
1611
1464
  * have only one customer.
@@ -1623,22 +1476,6 @@ export namespace CallCreateParams {
1623
1476
  label?: string | null;
1624
1477
  }
1625
1478
 
1626
- /**
1627
- * Customer participating in the call
1628
- */
1629
- export interface Customer {
1630
- /**
1631
- * Customer phone number in E.164 format (e.g., +14155551234)
1632
- */
1633
- phoneNumberE164: string | null;
1634
-
1635
- /**
1636
- * Label to identify this customer in the transcript (e.g., "speaker-01",
1637
- * "speaker-02")
1638
- */
1639
- label?: string | null;
1640
- }
1641
-
1642
1479
  export interface ToolInvocation {
1643
1480
  /**
1644
1481
  * Name of the tool that was invoked