@roarkanalytics/sdk 5.9.0 → 5.11.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 (67) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/client.d.mts +4 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +4 -4
  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/analytics.d.mts +29 -20
  10. package/resources/analytics.d.mts.map +1 -1
  11. package/resources/analytics.d.ts +29 -20
  12. package/resources/analytics.d.ts.map +1 -1
  13. package/resources/call.d.mts +187 -1
  14. package/resources/call.d.mts.map +1 -1
  15. package/resources/call.d.ts +187 -1
  16. package/resources/call.d.ts.map +1 -1
  17. package/resources/call.js +52 -0
  18. package/resources/call.js.map +1 -1
  19. package/resources/call.mjs +52 -0
  20. package/resources/call.mjs.map +1 -1
  21. package/resources/config.d.mts +48 -48
  22. package/resources/config.d.mts.map +1 -1
  23. package/resources/config.d.ts +48 -48
  24. package/resources/config.d.ts.map +1 -1
  25. package/resources/dashboard.d.mts +297 -201
  26. package/resources/dashboard.d.mts.map +1 -1
  27. package/resources/dashboard.d.ts +297 -201
  28. package/resources/dashboard.d.ts.map +1 -1
  29. package/resources/index.d.mts +2 -2
  30. package/resources/index.d.mts.map +1 -1
  31. package/resources/index.d.ts +2 -2
  32. package/resources/index.d.ts.map +1 -1
  33. package/resources/index.js.map +1 -1
  34. package/resources/index.mjs.map +1 -1
  35. package/resources/simulation-run-plan-job.d.mts +98 -1
  36. package/resources/simulation-run-plan-job.d.mts.map +1 -1
  37. package/resources/simulation-run-plan-job.d.ts +98 -1
  38. package/resources/simulation-run-plan-job.d.ts.map +1 -1
  39. package/resources/simulation-run-plan-job.js +17 -0
  40. package/resources/simulation-run-plan-job.js.map +1 -1
  41. package/resources/simulation-run-plan-job.mjs +17 -0
  42. package/resources/simulation-run-plan-job.mjs.map +1 -1
  43. package/resources/usage.d.mts +4 -2
  44. package/resources/usage.d.mts.map +1 -1
  45. package/resources/usage.d.ts +4 -2
  46. package/resources/usage.d.ts.map +1 -1
  47. package/resources/usage.js +4 -2
  48. package/resources/usage.js.map +1 -1
  49. package/resources/usage.mjs +4 -2
  50. package/resources/usage.mjs.map +1 -1
  51. package/src/client.ts +10 -0
  52. package/src/resources/analytics.ts +41 -22
  53. package/src/resources/call.ts +249 -0
  54. package/src/resources/config.ts +120 -72
  55. package/src/resources/dashboard.ts +411 -233
  56. package/src/resources/index.ts +5 -0
  57. package/src/resources/simulation-run-plan-job.ts +141 -0
  58. package/src/resources/usage.ts +4 -2
  59. package/src/version.ts +1 -1
  60. package/version.d.mts +1 -1
  61. package/version.d.mts.map +1 -1
  62. package/version.d.ts +1 -1
  63. package/version.d.ts.map +1 -1
  64. package/version.js +1 -1
  65. package/version.js.map +1 -1
  66. package/version.mjs +1 -1
  67. package/version.mjs.map +1 -1
@@ -81,8 +81,11 @@ export {
81
81
  Call,
82
82
  type CallCreateResponse,
83
83
  type CallListResponse,
84
+ type CallDeleteResponse,
84
85
  type CallAppendToolInvocationsResponse,
86
+ type CallBatchDeleteResponse,
85
87
  type CallGetByIDResponse,
88
+ type CallGetCostResponse,
86
89
  type CallGetTranscriptResponse,
87
90
  type CallListMetricsResponse,
88
91
  type CallListSentimentRunsResponse,
@@ -90,6 +93,7 @@ export {
90
93
  type CallCreateParams,
91
94
  type CallListParams,
92
95
  type CallAppendToolInvocationsParams,
96
+ type CallBatchDeleteParams,
93
97
  type CallGetTranscriptParams,
94
98
  type CallListMetricsParams,
95
99
  type CallUpdatePropertiesParams,
@@ -287,6 +291,7 @@ export {
287
291
  type SimulationRunPlanJobCancelResponse,
288
292
  type SimulationRunPlanJobCreateDebriefResponse,
289
293
  type SimulationRunPlanJobGetByIDResponse,
294
+ type SimulationRunPlanJobGetCostResponse,
290
295
  type SimulationRunPlanJobGetResultsResponse,
291
296
  type SimulationRunPlanJobStartResponse,
292
297
  type SimulationRunPlanJobListParams,
@@ -81,6 +81,24 @@ export class SimulationRunPlanJob extends APIResource {
81
81
  return this._client.get(path`/v1/simulation/plan/job/${jobID}`, options);
82
82
  }
83
83
 
84
+ /**
85
+ * The billable spend for one simulation run (run plan job), split by cost type,
86
+ * with the spend of each simulated call in it. Safe to call while the run is in
87
+ * progress: totals reflect the costs recorded so far. Amounts are billable spend
88
+ * only, in exact micro-dollars (`\*UsdMicros`) and dollars (`\*Usd`, for display).
89
+ * Requires an API key with the `billing:read` permission.
90
+ *
91
+ * @example
92
+ * ```ts
93
+ * const response = await client.simulationRunPlanJob.getCost(
94
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
95
+ * );
96
+ * ```
97
+ */
98
+ getCost(jobID: string, options?: RequestOptions): APIPromise<SimulationRunPlanJobGetCostResponse> {
99
+ return this._client.get(path`/v1/simulation/plan/job/${jobID}/cost`, options);
100
+ }
101
+
84
102
  /**
85
103
  * Everything the run report shows, in one request: the summary and score, the
86
104
  * pass/fail verdict, per-metric aggregates, every simulation with its check
@@ -1552,6 +1570,128 @@ export namespace SimulationRunPlanJobGetByIDResponse {
1552
1570
  }
1553
1571
  }
1554
1572
 
1573
+ export interface SimulationRunPlanJobGetCostResponse {
1574
+ data: SimulationRunPlanJobGetCostResponse.Data;
1575
+ }
1576
+
1577
+ export namespace SimulationRunPlanJobGetCostResponse {
1578
+ export interface Data {
1579
+ /**
1580
+ * Spend by cost type. Sums to totalUsdMicros.
1581
+ */
1582
+ breakdown: Array<Data.Breakdown>;
1583
+
1584
+ /**
1585
+ * Spend per simulated call in the run.
1586
+ */
1587
+ calls: Array<Data.Call>;
1588
+
1589
+ currency: 'usd';
1590
+
1591
+ jobId: string;
1592
+
1593
+ totalUsd: number;
1594
+
1595
+ /**
1596
+ * Total billable spend for the run, in micro-dollars.
1597
+ */
1598
+ totalUsdMicros: number;
1599
+ }
1600
+
1601
+ export namespace Data {
1602
+ export interface Breakdown {
1603
+ /**
1604
+ * The same figure in US dollars.
1605
+ */
1606
+ amountUsd: number;
1607
+
1608
+ /**
1609
+ * Billable spend for this type, in micro-dollars.
1610
+ */
1611
+ amountUsdMicros: number;
1612
+
1613
+ /**
1614
+ * Units billed (see the line items for the unit).
1615
+ */
1616
+ quantity: number;
1617
+
1618
+ /**
1619
+ * The cost source, e.g. SIM_PLATFORM_FEE, SIM_LLM, METRIC.
1620
+ */
1621
+ source:
1622
+ | 'SIM_PLATFORM_FEE'
1623
+ | 'SIM_TTS'
1624
+ | 'SIM_STT'
1625
+ | 'SIM_LLM'
1626
+ | 'SIM_TELEPHONY'
1627
+ | 'METRIC'
1628
+ | 'TRANSCRIPTION'
1629
+ | 'INTERNAL_LLM'
1630
+ | 'INTERNAL_STT';
1631
+
1632
+ /**
1633
+ * SIMULATION or POST_CALL.
1634
+ */
1635
+ surface: 'SIMULATION' | 'POST_CALL';
1636
+ }
1637
+
1638
+ export interface Call {
1639
+ amountUsd: number;
1640
+
1641
+ amountUsdMicros: number;
1642
+
1643
+ breakdown: Array<Call.Breakdown>;
1644
+
1645
+ /**
1646
+ * The call (voice runs) or chat (chat runs) the spend is attributed to. Null for
1647
+ * costs incurred before the conversation existed; use simulationJobId to join
1648
+ * those.
1649
+ */
1650
+ conversationId: string | null;
1651
+
1652
+ simulationJobId: string | null;
1653
+ }
1654
+
1655
+ export namespace Call {
1656
+ export interface Breakdown {
1657
+ /**
1658
+ * The same figure in US dollars.
1659
+ */
1660
+ amountUsd: number;
1661
+
1662
+ /**
1663
+ * Billable spend for this type, in micro-dollars.
1664
+ */
1665
+ amountUsdMicros: number;
1666
+
1667
+ /**
1668
+ * Units billed (see the line items for the unit).
1669
+ */
1670
+ quantity: number;
1671
+
1672
+ /**
1673
+ * The cost source, e.g. SIM_PLATFORM_FEE, SIM_LLM, METRIC.
1674
+ */
1675
+ source:
1676
+ | 'SIM_PLATFORM_FEE'
1677
+ | 'SIM_TTS'
1678
+ | 'SIM_STT'
1679
+ | 'SIM_LLM'
1680
+ | 'SIM_TELEPHONY'
1681
+ | 'METRIC'
1682
+ | 'TRANSCRIPTION'
1683
+ | 'INTERNAL_LLM'
1684
+ | 'INTERNAL_STT';
1685
+
1686
+ /**
1687
+ * SIMULATION or POST_CALL.
1688
+ */
1689
+ surface: 'SIMULATION' | 'POST_CALL';
1690
+ }
1691
+ }
1692
+ }
1693
+ }
1694
+
1555
1695
  export interface SimulationRunPlanJobGetResultsResponse {
1556
1696
  /**
1557
1697
  * Everything the run report shows, in one response.
@@ -2882,6 +3022,7 @@ export declare namespace SimulationRunPlanJob {
2882
3022
  type SimulationRunPlanJobCancelResponse as SimulationRunPlanJobCancelResponse,
2883
3023
  type SimulationRunPlanJobCreateDebriefResponse as SimulationRunPlanJobCreateDebriefResponse,
2884
3024
  type SimulationRunPlanJobGetByIDResponse as SimulationRunPlanJobGetByIDResponse,
3025
+ type SimulationRunPlanJobGetCostResponse as SimulationRunPlanJobGetCostResponse,
2885
3026
  type SimulationRunPlanJobGetResultsResponse as SimulationRunPlanJobGetResultsResponse,
2886
3027
  type SimulationRunPlanJobStartResponse as SimulationRunPlanJobStartResponse,
2887
3028
  type SimulationRunPlanJobListParams as SimulationRunPlanJobListParams,
@@ -9,8 +9,10 @@ export class Usage extends APIResource {
9
9
  * Report billable usage and cost for the organization over a time window, broken
10
10
  * down by project (highest spend first). Pass `from`/`to` as ISO 8601 timestamps;
11
11
  * optionally pass `projectId` to scope the report to one project. Amounts are
12
- * billable spend only (what we absorb is never included). Authenticated by an
13
- * organization API key with the `usage:read` permission.
12
+ * billable spend only (what we absorb is never included). Authenticated by either
13
+ * an organization API key with the `usage:read` permission (any project in the
14
+ * organization), or a project API key with the `billing:read` permission (that
15
+ * key's own project only; any other `projectId` is a 403).
14
16
  *
15
17
  * @example
16
18
  * ```ts
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '5.9.0'; // x-release-please-version
1
+ export const VERSION = '5.11.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "5.9.0";
1
+ export declare const VERSION = "5.11.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "5.9.0";
1
+ export declare const VERSION = "5.11.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
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 = '5.9.0'; // x-release-please-version
4
+ exports.VERSION = '5.11.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAC,CAAC,2BAA2B"}
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '5.9.0'; // x-release-please-version
1
+ export const VERSION = '5.11.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map
package/version.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,2BAA2B"}