@roarkanalytics/sdk 5.8.0 → 5.10.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 (79) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/client.d.mts +13 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +13 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +9 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +9 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/analytics.d.mts +354 -0
  12. package/resources/analytics.d.mts.map +1 -0
  13. package/resources/analytics.d.ts +354 -0
  14. package/resources/analytics.d.ts.map +1 -0
  15. package/resources/analytics.js +55 -0
  16. package/resources/analytics.js.map +1 -0
  17. package/resources/analytics.mjs +51 -0
  18. package/resources/analytics.mjs.map +1 -0
  19. package/resources/call.d.mts +90 -1
  20. package/resources/call.d.mts.map +1 -1
  21. package/resources/call.d.ts +90 -1
  22. package/resources/call.d.ts.map +1 -1
  23. package/resources/call.js +17 -0
  24. package/resources/call.js.map +1 -1
  25. package/resources/call.mjs +17 -0
  26. package/resources/call.mjs.map +1 -1
  27. package/resources/config.d.mts +578 -8
  28. package/resources/config.d.mts.map +1 -1
  29. package/resources/config.d.ts +578 -8
  30. package/resources/config.d.ts.map +1 -1
  31. package/resources/dashboard.d.mts +2280 -0
  32. package/resources/dashboard.d.mts.map +1 -0
  33. package/resources/dashboard.d.ts +2280 -0
  34. package/resources/dashboard.d.ts.map +1 -0
  35. package/resources/dashboard.js +170 -0
  36. package/resources/dashboard.js.map +1 -0
  37. package/resources/dashboard.mjs +166 -0
  38. package/resources/dashboard.mjs.map +1 -0
  39. package/resources/index.d.mts +5 -2
  40. package/resources/index.d.mts.map +1 -1
  41. package/resources/index.d.ts +5 -2
  42. package/resources/index.d.ts.map +1 -1
  43. package/resources/index.js +7 -1
  44. package/resources/index.js.map +1 -1
  45. package/resources/index.mjs +3 -0
  46. package/resources/index.mjs.map +1 -1
  47. package/resources/simulation-run-plan-job.d.mts +98 -1
  48. package/resources/simulation-run-plan-job.d.mts.map +1 -1
  49. package/resources/simulation-run-plan-job.d.ts +98 -1
  50. package/resources/simulation-run-plan-job.d.ts.map +1 -1
  51. package/resources/simulation-run-plan-job.js +17 -0
  52. package/resources/simulation-run-plan-job.js.map +1 -1
  53. package/resources/simulation-run-plan-job.mjs +17 -0
  54. package/resources/simulation-run-plan-job.mjs.map +1 -1
  55. package/resources/usage.d.mts +116 -0
  56. package/resources/usage.d.mts.map +1 -0
  57. package/resources/usage.d.ts +116 -0
  58. package/resources/usage.d.ts.map +1 -0
  59. package/resources/usage.js +29 -0
  60. package/resources/usage.js.map +1 -0
  61. package/resources/usage.mjs +25 -0
  62. package/resources/usage.mjs.map +1 -0
  63. package/src/client.ts +67 -0
  64. package/src/resources/analytics.ts +573 -0
  65. package/src/resources/call.ts +136 -0
  66. package/src/resources/config.ts +1441 -41
  67. package/src/resources/dashboard.ts +3752 -0
  68. package/src/resources/index.ts +29 -0
  69. package/src/resources/simulation-run-plan-job.ts +141 -0
  70. package/src/resources/usage.ts +149 -0
  71. package/src/version.ts +1 -1
  72. package/version.d.mts +1 -1
  73. package/version.d.mts.map +1 -1
  74. package/version.d.ts +1 -1
  75. package/version.d.ts.map +1 -1
  76. package/version.js +1 -1
  77. package/version.js.map +1 -1
  78. package/version.mjs +1 -1
  79. package/version.mjs.map +1 -1
@@ -42,6 +42,12 @@ export {
42
42
  type AgentPromptUpdateParams,
43
43
  type AgentPromptListVersionsParams,
44
44
  } from './agent-prompt';
45
+ export {
46
+ Analytics,
47
+ type AnalyticsGetSchemaResponse,
48
+ type AnalyticsQueryResponse,
49
+ type AnalyticsQueryParams,
50
+ } from './analytics';
45
51
  export {
46
52
  AutoimproveJob,
47
53
  type AutoimproveLogEntry,
@@ -77,6 +83,7 @@ export {
77
83
  type CallListResponse,
78
84
  type CallAppendToolInvocationsResponse,
79
85
  type CallGetByIDResponse,
86
+ type CallGetCostResponse,
80
87
  type CallGetTranscriptResponse,
81
88
  type CallListMetricsResponse,
82
89
  type CallListSentimentRunsResponse,
@@ -126,6 +133,26 @@ export {
126
133
  type CustomerFlowEdgeCasePromoteParams,
127
134
  type CustomerFlowEdgeCaseRemoveParams,
128
135
  } from './customer-flow-edge-case';
136
+ export {
137
+ Dashboard,
138
+ type DashboardCreateResponse,
139
+ type DashboardUpdateResponse,
140
+ type DashboardListResponse,
141
+ type DashboardDeleteResponse,
142
+ type DashboardCreateWidgetResponse,
143
+ type DashboardDeleteWidgetResponse,
144
+ type DashboardGetByIDResponse,
145
+ type DashboardGetDataResponse,
146
+ type DashboardGetWidgetDataResponse,
147
+ type DashboardUpdateWidgetResponse,
148
+ type DashboardCreateParams,
149
+ type DashboardUpdateParams,
150
+ type DashboardCreateWidgetParams,
151
+ type DashboardDeleteWidgetParams,
152
+ type DashboardGetDataParams,
153
+ type DashboardGetWidgetDataParams,
154
+ type DashboardUpdateWidgetParams,
155
+ } from './dashboard';
129
156
  export {
130
157
  HTTPRequestDefinition,
131
158
  type HTTPRequestDefinitionCreateResponse,
@@ -261,6 +288,7 @@ export {
261
288
  type SimulationRunPlanJobCancelResponse,
262
289
  type SimulationRunPlanJobCreateDebriefResponse,
263
290
  type SimulationRunPlanJobGetByIDResponse,
291
+ type SimulationRunPlanJobGetCostResponse,
264
292
  type SimulationRunPlanJobGetResultsResponse,
265
293
  type SimulationRunPlanJobStartResponse,
266
294
  type SimulationRunPlanJobListParams,
@@ -279,6 +307,7 @@ export {
279
307
  type SimulationToolFixtureUpdateParams,
280
308
  type SimulationToolFixtureListParams,
281
309
  } from './simulation-tool-fixture';
310
+ export { Usage, type UsageGetResponse, type UsageGetParams } from './usage';
282
311
  export {
283
312
  Webhook,
284
313
  type WebhookCreateResponse,
@@ -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,
@@ -0,0 +1,149 @@
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 Usage extends APIResource {
8
+ /**
9
+ * Report billable usage and cost for the organization over a time window, broken
10
+ * down by project (highest spend first). Pass `from`/`to` as ISO 8601 timestamps;
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 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).
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const usage = await client.usage.get({
20
+ * from: '2026-09-01T00:00:00Z',
21
+ * to: '2026-10-01T00:00:00Z',
22
+ * });
23
+ * ```
24
+ */
25
+ get(query: UsageGetParams, options?: RequestOptions): APIPromise<UsageGetResponse> {
26
+ return this._client.get('/v1/usage', { query, ...options });
27
+ }
28
+ }
29
+
30
+ export interface UsageGetResponse {
31
+ data: UsageGetResponse.Data;
32
+ }
33
+
34
+ export namespace UsageGetResponse {
35
+ export interface Data {
36
+ currency: 'usd';
37
+
38
+ /**
39
+ * The resolved window start, echoed back as ISO 8601.
40
+ */
41
+ from: string;
42
+
43
+ /**
44
+ * Per-project billable spend, highest first. Only projects with spend in the
45
+ * window appear.
46
+ */
47
+ projects: Array<Data.Project>;
48
+
49
+ /**
50
+ * The resolved window end, echoed back as ISO 8601.
51
+ */
52
+ to: string;
53
+
54
+ /**
55
+ * The same total in US dollars.
56
+ */
57
+ totalUsd: number;
58
+
59
+ /**
60
+ * Total billable spend across the organization (or the single project) in
61
+ * micro-dollars.
62
+ */
63
+ totalUsdMicros: number;
64
+ }
65
+
66
+ export namespace Data {
67
+ export interface Project {
68
+ /**
69
+ * The same billable spend in US dollars. For display; use amountUsdMicros to
70
+ * reconcile.
71
+ */
72
+ amountUsd: number;
73
+
74
+ /**
75
+ * Billable spend in integer micro-dollars (1,000,000 = $1). The exact value.
76
+ */
77
+ amountUsdMicros: number;
78
+
79
+ /**
80
+ * This project's spend split by cost type, highest first. Sums to amountUsdMicros.
81
+ */
82
+ breakdown: Array<Project.Breakdown>;
83
+
84
+ projectId: string;
85
+
86
+ /**
87
+ * Null only if the project no longer exists in this organization.
88
+ */
89
+ projectName: string | null;
90
+ }
91
+
92
+ export namespace Project {
93
+ export interface Breakdown {
94
+ /**
95
+ * The same figure in US dollars.
96
+ */
97
+ amountUsd: number;
98
+
99
+ /**
100
+ * Billable spend for this type, in micro-dollars.
101
+ */
102
+ amountUsdMicros: number;
103
+
104
+ /**
105
+ * The cost source, e.g. SIM*PLATFORM_FEE, SIM_LLM, SIM_TTS, SIM_STT,
106
+ * SIM_TELEPHONY, METRIC, or TRANSCRIPTION. These are the granular sources behind
107
+ * the Billing screen categories (SIM*\* roll up into "Simulation").
108
+ */
109
+ source:
110
+ | 'SIM_PLATFORM_FEE'
111
+ | 'SIM_TTS'
112
+ | 'SIM_STT'
113
+ | 'SIM_LLM'
114
+ | 'SIM_TELEPHONY'
115
+ | 'METRIC'
116
+ | 'TRANSCRIPTION'
117
+ | 'INTERNAL_LLM'
118
+ | 'INTERNAL_STT';
119
+
120
+ /**
121
+ * Whether this cost came from a SIMULATION or a production call (POST_CALL).
122
+ */
123
+ surface: 'SIMULATION' | 'POST_CALL';
124
+ }
125
+ }
126
+ }
127
+ }
128
+
129
+ export interface UsageGetParams {
130
+ /**
131
+ * Start of the window (inclusive), ISO 8601.
132
+ */
133
+ from: string;
134
+
135
+ /**
136
+ * End of the window (exclusive), ISO 8601. Must be after `from`, and the window
137
+ * may not exceed 366 days.
138
+ */
139
+ to: string;
140
+
141
+ /**
142
+ * Limit the report to a single project. Omit for the whole organization.
143
+ */
144
+ projectId?: string;
145
+ }
146
+
147
+ export declare namespace Usage {
148
+ export { type UsageGetResponse as UsageGetResponse, type UsageGetParams as UsageGetParams };
149
+ }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '5.8.0'; // x-release-please-version
1
+ export const VERSION = '5.10.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "5.8.0";
1
+ export declare const VERSION = "5.10.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.8.0";
1
+ export declare const VERSION = "5.10.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.8.0'; // x-release-please-version
4
+ exports.VERSION = '5.10.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.8.0'; // x-release-please-version
1
+ export const VERSION = '5.10.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"}