@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
@@ -87,6 +87,24 @@ export class Call extends APIResource {
87
87
  return this._client.get(path`/v1/call/${callID}`, options);
88
88
  }
89
89
 
90
+ /**
91
+ * The billable spend attributed to one call, split by cost type, with every cost
92
+ * line behind it. Simulated calls include the costs their simulation incurred
93
+ * before the call connected. Amounts are billable spend only, in exact
94
+ * micro-dollars (`\*UsdMicros`) and dollars (`\*Usd`, for display). Requires an
95
+ * API key with the `billing:read` permission.
96
+ *
97
+ * @example
98
+ * ```ts
99
+ * const response = await client.call.getCost(
100
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
101
+ * );
102
+ * ```
103
+ */
104
+ getCost(callID: string, options?: RequestOptions): APIPromise<CallGetCostResponse> {
105
+ return this._client.get(path`/v1/call/${callID}/cost`, options);
106
+ }
107
+
90
108
  /**
91
109
  * Fetch the full transcript for a specific call. Optionally specify a
92
110
  * transcription source; otherwise the best available source is used automatically.
@@ -707,6 +725,123 @@ export namespace CallGetByIDResponse {
707
725
  }
708
726
  }
709
727
 
728
+ export interface CallGetCostResponse {
729
+ data: CallGetCostResponse.Data;
730
+ }
731
+
732
+ export namespace CallGetCostResponse {
733
+ export interface Data {
734
+ /**
735
+ * Spend by cost type. Sums to totalUsdMicros.
736
+ */
737
+ breakdown: Array<Data.Breakdown>;
738
+
739
+ callId: string;
740
+
741
+ currency: 'usd';
742
+
743
+ /**
744
+ * Every billable cost line attributed to the call.
745
+ */
746
+ items: Array<Data.Item>;
747
+
748
+ totalUsd: number;
749
+
750
+ /**
751
+ * Total billable spend for this call, in micro-dollars.
752
+ */
753
+ totalUsdMicros: number;
754
+ }
755
+
756
+ export namespace Data {
757
+ export interface Breakdown {
758
+ /**
759
+ * The same figure in US dollars.
760
+ */
761
+ amountUsd: number;
762
+
763
+ /**
764
+ * Billable spend for this type, in micro-dollars.
765
+ */
766
+ amountUsdMicros: number;
767
+
768
+ /**
769
+ * Units billed (see the line items for the unit).
770
+ */
771
+ quantity: number;
772
+
773
+ /**
774
+ * The cost source, e.g. SIM_PLATFORM_FEE, SIM_LLM, METRIC.
775
+ */
776
+ source:
777
+ | 'SIM_PLATFORM_FEE'
778
+ | 'SIM_TTS'
779
+ | 'SIM_STT'
780
+ | 'SIM_LLM'
781
+ | 'SIM_TELEPHONY'
782
+ | 'METRIC'
783
+ | 'TRANSCRIPTION'
784
+ | 'INTERNAL_LLM'
785
+ | 'INTERNAL_STT';
786
+
787
+ /**
788
+ * SIMULATION or POST_CALL.
789
+ */
790
+ surface: 'SIMULATION' | 'POST_CALL';
791
+ }
792
+
793
+ export interface Item {
794
+ amountUsd: number;
795
+
796
+ amountUsdMicros: number;
797
+
798
+ /**
799
+ * Stable id of the cost event. Use it to deduplicate.
800
+ */
801
+ eventId: string;
802
+
803
+ /**
804
+ * The grading pass a METRIC line paid for. A call graded twice carries one line
805
+ * per pass.
806
+ */
807
+ metricCollectionJobId: string | null;
808
+
809
+ /**
810
+ * The metric a METRIC line was charged for.
811
+ */
812
+ metricDefinitionId: string | null;
813
+
814
+ model: string | null;
815
+
816
+ /**
817
+ * When the cost was incurred, ISO 8601.
818
+ */
819
+ occurredAt: string;
820
+
821
+ provider: string | null;
822
+
823
+ quantity: number;
824
+
825
+ quantityUnit: 'MINUTES' | 'INPUT_TOKENS' | 'OUTPUT_TOKENS' | 'CHARACTERS' | 'AUDIO_SECONDS' | 'UNITS';
826
+
827
+ simulationJobId: string | null;
828
+
829
+ source:
830
+ | 'SIM_PLATFORM_FEE'
831
+ | 'SIM_TTS'
832
+ | 'SIM_STT'
833
+ | 'SIM_LLM'
834
+ | 'SIM_TELEPHONY'
835
+ | 'METRIC'
836
+ | 'TRANSCRIPTION'
837
+ | 'INTERNAL_LLM'
838
+ | 'INTERNAL_STT';
839
+
840
+ surface: 'SIMULATION' | 'POST_CALL';
841
+ }
842
+ }
843
+ }
844
+
710
845
  export interface CallGetTranscriptResponse {
711
846
  /**
712
847
  * Call transcript response
@@ -2283,6 +2418,7 @@ export declare namespace Call {
2283
2418
  type CallListResponse as CallListResponse,
2284
2419
  type CallAppendToolInvocationsResponse as CallAppendToolInvocationsResponse,
2285
2420
  type CallGetByIDResponse as CallGetByIDResponse,
2421
+ type CallGetCostResponse as CallGetCostResponse,
2286
2422
  type CallGetTranscriptResponse as CallGetTranscriptResponse,
2287
2423
  type CallListMetricsResponse as CallListMetricsResponse,
2288
2424
  type CallListSentimentRunsResponse as CallListSentimentRunsResponse,