@roarkanalytics/sdk 2.21.1 → 2.22.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 (348) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +78 -46
  3. package/api-promise.d.mts +1 -46
  4. package/api-promise.d.mts.map +1 -1
  5. package/api-promise.d.ts +1 -46
  6. package/api-promise.d.ts.map +1 -1
  7. package/api-promise.js +3 -81
  8. package/api-promise.js.map +1 -1
  9. package/api-promise.mjs +1 -79
  10. package/api-promise.mjs.map +1 -1
  11. package/client.d.mts +25 -30
  12. package/client.d.mts.map +1 -1
  13. package/client.d.ts +25 -30
  14. package/client.d.ts.map +1 -1
  15. package/client.js +150 -132
  16. package/client.js.map +1 -1
  17. package/client.mjs +145 -104
  18. package/client.mjs.map +1 -1
  19. package/core/api-promise.d.mts +46 -0
  20. package/core/api-promise.d.mts.map +1 -0
  21. package/core/api-promise.d.ts +46 -0
  22. package/core/api-promise.d.ts.map +1 -0
  23. package/core/api-promise.js +74 -0
  24. package/core/api-promise.js.map +1 -0
  25. package/core/api-promise.mjs +70 -0
  26. package/core/api-promise.mjs.map +1 -0
  27. package/core/error.d.mts +46 -0
  28. package/core/error.d.mts.map +1 -0
  29. package/core/error.d.ts +46 -0
  30. package/core/error.d.ts.map +1 -0
  31. package/core/error.js +113 -0
  32. package/core/error.js.map +1 -0
  33. package/core/error.mjs +97 -0
  34. package/core/error.mjs.map +1 -0
  35. package/core/resource.d.mts +6 -0
  36. package/core/resource.d.mts.map +1 -0
  37. package/core/resource.d.ts +6 -0
  38. package/core/resource.d.ts.map +1 -0
  39. package/core/resource.js +11 -0
  40. package/core/resource.js.map +1 -0
  41. package/core/resource.mjs +7 -0
  42. package/core/resource.mjs.map +1 -0
  43. package/core/uploads.d.mts +3 -0
  44. package/core/uploads.d.mts.map +1 -0
  45. package/core/uploads.d.ts +3 -0
  46. package/core/uploads.d.ts.map +1 -0
  47. package/core/uploads.js +6 -0
  48. package/core/uploads.js.map +1 -0
  49. package/core/uploads.mjs +2 -0
  50. package/core/uploads.mjs.map +1 -0
  51. package/error.d.mts +1 -46
  52. package/error.d.mts.map +1 -1
  53. package/error.d.ts +1 -46
  54. package/error.d.ts.map +1 -1
  55. package/error.js +3 -110
  56. package/error.js.map +1 -1
  57. package/error.mjs +1 -96
  58. package/error.mjs.map +1 -1
  59. package/index.d.mts +6 -6
  60. package/index.d.ts +3 -3
  61. package/index.js +3 -3
  62. package/index.js.map +1 -1
  63. package/index.mjs +3 -3
  64. package/internal/builtin-types.d.mts +11 -3
  65. package/internal/builtin-types.d.mts.map +1 -1
  66. package/internal/builtin-types.d.ts +11 -3
  67. package/internal/builtin-types.d.ts.map +1 -1
  68. package/internal/detect-platform.js +3 -3
  69. package/internal/detect-platform.js.map +1 -1
  70. package/internal/detect-platform.mjs +3 -3
  71. package/internal/detect-platform.mjs.map +1 -1
  72. package/internal/errors.d.mts.map +1 -1
  73. package/internal/errors.d.ts.map +1 -1
  74. package/internal/errors.js +17 -2
  75. package/internal/errors.js.map +1 -1
  76. package/internal/errors.mjs +15 -0
  77. package/internal/errors.mjs.map +1 -1
  78. package/internal/headers.d.mts +1 -2
  79. package/internal/headers.d.mts.map +1 -1
  80. package/internal/headers.d.ts +1 -2
  81. package/internal/headers.d.ts.map +1 -1
  82. package/internal/headers.js +7 -5
  83. package/internal/headers.js.map +1 -1
  84. package/internal/headers.mjs +7 -5
  85. package/internal/headers.mjs.map +1 -1
  86. package/internal/parse.d.mts +3 -1
  87. package/internal/parse.d.mts.map +1 -1
  88. package/internal/parse.d.ts +3 -1
  89. package/internal/parse.d.ts.map +1 -1
  90. package/internal/parse.js +33 -21
  91. package/internal/parse.js.map +1 -1
  92. package/internal/parse.mjs +33 -20
  93. package/internal/parse.mjs.map +1 -1
  94. package/internal/qs/formats.d.mts +1 -0
  95. package/internal/qs/formats.d.mts.map +1 -1
  96. package/internal/qs/formats.d.ts +1 -0
  97. package/internal/qs/formats.d.ts.map +1 -1
  98. package/internal/qs/formats.js +4 -2
  99. package/internal/qs/formats.js.map +1 -1
  100. package/internal/qs/formats.mjs +2 -1
  101. package/internal/qs/formats.mjs.map +1 -1
  102. package/internal/qs/stringify.d.mts.map +1 -1
  103. package/internal/qs/stringify.d.ts.map +1 -1
  104. package/internal/qs/stringify.js +16 -19
  105. package/internal/qs/stringify.js.map +1 -1
  106. package/internal/qs/stringify.mjs +17 -19
  107. package/internal/qs/stringify.mjs.map +1 -1
  108. package/internal/qs/utils.d.mts +1 -0
  109. package/internal/qs/utils.d.mts.map +1 -1
  110. package/internal/qs/utils.d.ts +1 -0
  111. package/internal/qs/utils.d.ts.map +1 -1
  112. package/internal/qs/utils.js +22 -21
  113. package/internal/qs/utils.js.map +1 -1
  114. package/internal/qs/utils.mjs +12 -12
  115. package/internal/qs/utils.mjs.map +1 -1
  116. package/internal/request-options.d.mts +43 -2
  117. package/internal/request-options.d.mts.map +1 -1
  118. package/internal/request-options.d.ts +43 -2
  119. package/internal/request-options.d.ts.map +1 -1
  120. package/internal/request-options.js +1 -26
  121. package/internal/request-options.js.map +1 -1
  122. package/internal/request-options.mjs +0 -24
  123. package/internal/request-options.mjs.map +1 -1
  124. package/internal/shim-types.d.mts +11 -22
  125. package/internal/shim-types.d.mts.map +1 -0
  126. package/internal/shim-types.d.ts +11 -22
  127. package/internal/shim-types.d.ts.map +1 -0
  128. package/internal/shim-types.js +4 -0
  129. package/internal/shim-types.js.map +1 -0
  130. package/internal/shim-types.mjs +3 -0
  131. package/internal/shim-types.mjs.map +1 -0
  132. package/internal/shims.d.mts +7 -48
  133. package/internal/shims.d.mts.map +1 -1
  134. package/internal/shims.d.ts +7 -48
  135. package/internal/shims.d.ts.map +1 -1
  136. package/internal/shims.js +21 -30
  137. package/internal/shims.js.map +1 -1
  138. package/internal/shims.mjs +16 -23
  139. package/internal/shims.mjs.map +1 -1
  140. package/internal/to-file.d.mts +45 -0
  141. package/internal/to-file.d.mts.map +1 -0
  142. package/internal/to-file.d.ts +45 -0
  143. package/internal/to-file.d.ts.map +1 -0
  144. package/internal/to-file.js +91 -0
  145. package/internal/to-file.js.map +1 -0
  146. package/internal/to-file.mjs +88 -0
  147. package/internal/to-file.mjs.map +1 -0
  148. package/internal/tslib.js +81 -0
  149. package/internal/tslib.mjs +17 -0
  150. package/internal/types.d.mts +14 -13
  151. package/internal/types.d.mts.map +1 -1
  152. package/internal/types.d.ts +14 -13
  153. package/internal/types.d.ts.map +1 -1
  154. package/internal/uploads.d.mts +16 -47
  155. package/internal/uploads.d.mts.map +1 -1
  156. package/internal/uploads.d.ts +16 -47
  157. package/internal/uploads.d.ts.map +1 -1
  158. package/internal/uploads.js +41 -108
  159. package/internal/uploads.js.map +1 -1
  160. package/internal/uploads.mjs +39 -108
  161. package/internal/uploads.mjs.map +1 -1
  162. package/internal/utils/base64.d.mts.map +1 -1
  163. package/internal/utils/base64.d.ts.map +1 -1
  164. package/internal/utils/base64.js +13 -8
  165. package/internal/utils/base64.js.map +1 -1
  166. package/internal/utils/base64.mjs +13 -8
  167. package/internal/utils/base64.mjs.map +1 -1
  168. package/internal/utils/bytes.d.mts +4 -0
  169. package/internal/utils/bytes.d.mts.map +1 -0
  170. package/internal/utils/bytes.d.ts +4 -0
  171. package/internal/utils/bytes.d.ts.map +1 -0
  172. package/internal/utils/bytes.js +31 -0
  173. package/internal/utils/bytes.js.map +1 -0
  174. package/internal/utils/bytes.mjs +26 -0
  175. package/internal/utils/bytes.mjs.map +1 -0
  176. package/internal/utils/env.d.mts.map +1 -1
  177. package/internal/utils/env.d.ts.map +1 -1
  178. package/internal/utils/env.js.map +1 -1
  179. package/internal/utils/env.mjs.map +1 -1
  180. package/internal/utils/log.d.mts +35 -2
  181. package/internal/utils/log.d.mts.map +1 -1
  182. package/internal/utils/log.d.ts +35 -2
  183. package/internal/utils/log.d.ts.map +1 -1
  184. package/internal/utils/log.js +62 -24
  185. package/internal/utils/log.js.map +1 -1
  186. package/internal/utils/log.mjs +58 -22
  187. package/internal/utils/log.mjs.map +1 -1
  188. package/internal/utils/path.d.mts +15 -0
  189. package/internal/utils/path.d.mts.map +1 -0
  190. package/internal/utils/path.d.ts +15 -0
  191. package/internal/utils/path.d.ts.map +1 -0
  192. package/internal/utils/path.js +79 -0
  193. package/internal/utils/path.js.map +1 -0
  194. package/internal/utils/path.mjs +74 -0
  195. package/internal/utils/path.mjs.map +1 -0
  196. package/internal/utils/sleep.d.mts.map +1 -1
  197. package/internal/utils/sleep.d.ts.map +1 -1
  198. package/internal/utils/uuid.d.mts +1 -1
  199. package/internal/utils/uuid.d.mts.map +1 -1
  200. package/internal/utils/uuid.d.ts +1 -1
  201. package/internal/utils/uuid.d.ts.map +1 -1
  202. package/internal/utils/uuid.js +10 -6
  203. package/internal/utils/uuid.js.map +1 -1
  204. package/internal/utils/uuid.mjs +9 -5
  205. package/internal/utils/uuid.mjs.map +1 -1
  206. package/internal/utils/values.d.mts +4 -1
  207. package/internal/utils/values.d.mts.map +1 -1
  208. package/internal/utils/values.d.ts +4 -1
  209. package/internal/utils/values.d.ts.map +1 -1
  210. package/internal/utils/values.js +21 -9
  211. package/internal/utils/values.js.map +1 -1
  212. package/internal/utils/values.mjs +14 -4
  213. package/internal/utils/values.mjs.map +1 -1
  214. package/internal/utils.js +7 -20
  215. package/internal/utils.js.map +1 -1
  216. package/package.json +31 -13
  217. package/resource.d.mts +1 -5
  218. package/resource.d.mts.map +1 -1
  219. package/resource.d.ts +1 -5
  220. package/resource.d.ts.map +1 -1
  221. package/resource.js +3 -8
  222. package/resource.js.map +1 -1
  223. package/resource.mjs +1 -6
  224. package/resource.mjs.map +1 -1
  225. package/resources/call.d.mts +17 -7
  226. package/resources/call.d.mts.map +1 -1
  227. package/resources/call.d.ts +17 -7
  228. package/resources/call.d.ts.map +1 -1
  229. package/resources/call.js +6 -5
  230. package/resources/call.js.map +1 -1
  231. package/resources/call.mjs +6 -5
  232. package/resources/call.mjs.map +1 -1
  233. package/resources/evaluation.d.mts +20 -8
  234. package/resources/evaluation.d.mts.map +1 -1
  235. package/resources/evaluation.d.ts +20 -8
  236. package/resources/evaluation.d.ts.map +1 -1
  237. package/resources/evaluation.js +5 -4
  238. package/resources/evaluation.js.map +1 -1
  239. package/resources/evaluation.mjs +5 -4
  240. package/resources/evaluation.mjs.map +1 -1
  241. package/resources/health.d.mts +2 -2
  242. package/resources/health.d.ts +2 -2
  243. package/resources/health.js +1 -1
  244. package/resources/health.js.map +1 -1
  245. package/resources/health.mjs +1 -1
  246. package/resources/integrations.d.mts +39 -6
  247. package/resources/integrations.d.mts.map +1 -1
  248. package/resources/integrations.d.ts +39 -6
  249. package/resources/integrations.d.ts.map +1 -1
  250. package/resources/integrations.js +26 -1
  251. package/resources/integrations.js.map +1 -1
  252. package/resources/integrations.mjs +26 -1
  253. package/resources/integrations.mjs.map +1 -1
  254. package/resources/metric.d.mts +2 -2
  255. package/resources/metric.d.ts +2 -2
  256. package/resources/metric.js +1 -1
  257. package/resources/metric.js.map +1 -1
  258. package/resources/metric.mjs +1 -1
  259. package/resources/persona.d.mts +45 -8
  260. package/resources/persona.d.mts.map +1 -1
  261. package/resources/persona.d.ts +45 -8
  262. package/resources/persona.d.ts.map +1 -1
  263. package/resources/persona.js +29 -3
  264. package/resources/persona.js.map +1 -1
  265. package/resources/persona.mjs +29 -3
  266. package/resources/persona.mjs.map +1 -1
  267. package/resources/simulation.d.mts +51 -5
  268. package/resources/simulation.d.mts.map +1 -1
  269. package/resources/simulation.d.ts +51 -5
  270. package/resources/simulation.d.ts.map +1 -1
  271. package/resources/simulation.js +45 -4
  272. package/resources/simulation.js.map +1 -1
  273. package/resources/simulation.mjs +45 -4
  274. package/resources/simulation.mjs.map +1 -1
  275. package/resources.d.mts +2 -0
  276. package/resources.d.mts.map +1 -0
  277. package/resources.d.ts +2 -0
  278. package/resources.d.ts.map +1 -0
  279. package/resources.js +5 -0
  280. package/resources.js.map +1 -0
  281. package/resources.mjs +2 -0
  282. package/resources.mjs.map +1 -0
  283. package/src/api-promise.ts +2 -92
  284. package/src/client.ts +207 -116
  285. package/src/core/README.md +3 -0
  286. package/src/core/api-promise.ts +92 -0
  287. package/src/core/error.ts +130 -0
  288. package/src/core/resource.ts +11 -0
  289. package/src/core/uploads.ts +2 -0
  290. package/src/error.ts +2 -130
  291. package/src/index.ts +3 -3
  292. package/src/internal/README.md +3 -0
  293. package/src/internal/builtin-types.ts +14 -0
  294. package/src/internal/detect-platform.ts +3 -3
  295. package/src/internal/errors.ts +11 -0
  296. package/src/internal/headers.ts +9 -8
  297. package/src/internal/parse.ts +43 -28
  298. package/src/internal/qs/formats.ts +2 -1
  299. package/src/internal/qs/stringify.ts +17 -20
  300. package/src/internal/qs/utils.ts +14 -14
  301. package/src/internal/request-options.ts +55 -31
  302. package/src/internal/shim-types.ts +26 -0
  303. package/src/internal/shims.ts +20 -58
  304. package/src/internal/to-file.ts +154 -0
  305. package/src/internal/types.ts +14 -17
  306. package/src/internal/uploads.ts +60 -180
  307. package/src/internal/utils/base64.ts +14 -11
  308. package/src/internal/utils/bytes.ts +32 -0
  309. package/src/internal/utils/log.ts +100 -23
  310. package/src/internal/utils/path.ts +88 -0
  311. package/src/internal/utils/uuid.ts +10 -6
  312. package/src/internal/utils/values.ts +16 -5
  313. package/src/resource.ts +2 -11
  314. package/src/resources/call.ts +12 -11
  315. package/src/resources/evaluation.ts +12 -11
  316. package/src/resources/health.ts +2 -2
  317. package/src/resources/integrations.ts +31 -6
  318. package/src/resources/metric.ts +2 -2
  319. package/src/resources/persona.ts +36 -10
  320. package/src/resources/simulation.ts +49 -8
  321. package/src/resources.ts +1 -0
  322. package/src/uploads.ts +2 -1
  323. package/src/version.ts +1 -1
  324. package/uploads.d.mts +1 -1
  325. package/uploads.d.mts.map +1 -1
  326. package/uploads.d.ts +1 -1
  327. package/uploads.d.ts.map +1 -1
  328. package/uploads.js +3 -3
  329. package/uploads.js.map +1 -1
  330. package/uploads.mjs +1 -1
  331. package/uploads.mjs.map +1 -1
  332. package/version.d.mts +1 -1
  333. package/version.d.ts +1 -1
  334. package/version.js +1 -1
  335. package/version.mjs +1 -1
  336. package/internal/polyfill/crypto.node.d.ts +0 -10
  337. package/internal/polyfill/crypto.node.js +0 -11
  338. package/internal/polyfill/crypto.node.mjs +0 -2
  339. package/internal/polyfill/file.node.d.ts +0 -9
  340. package/internal/polyfill/file.node.js +0 -17
  341. package/internal/polyfill/file.node.mjs +0 -9
  342. package/src/internal/polyfill/crypto.node.d.ts +0 -10
  343. package/src/internal/polyfill/crypto.node.js +0 -11
  344. package/src/internal/polyfill/crypto.node.mjs +0 -2
  345. package/src/internal/polyfill/file.node.d.ts +0 -9
  346. package/src/internal/polyfill/file.node.js +0 -17
  347. package/src/internal/polyfill/file.node.mjs +0 -9
  348. package/src/internal/shim-types.d.ts +0 -28
@@ -1,6 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { RoarkError } from '../../error';
3
+ import { RoarkError } from '../../core/error';
4
4
 
5
5
  // https://url.spec.whatwg.org/#url-scheme-string
6
6
  const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
@@ -9,6 +9,9 @@ export const isAbsoluteURL = (url: string): boolean => {
9
9
  return startsWithSchemeRegexp.test(url);
10
10
  };
11
11
 
12
+ export let isArray = (val: unknown): val is unknown[] => ((isArray = Array.isArray), isArray(val));
13
+ export let isReadonlyArray = isArray as (val: unknown) => val is readonly unknown[];
14
+
12
15
  /** Returns an object if the given value isn't an object, otherwise returns as-is */
13
16
  export function maybeObj(x: unknown): object {
14
17
  if (typeof x !== 'object') {
@@ -26,7 +29,7 @@ export function isEmptyObj(obj: Object | null | undefined): boolean {
26
29
  }
27
30
 
28
31
  // https://eslint.org/docs/latest/rules/no-prototype-builtins
29
- export function hasOwn(obj: Object, key: string): boolean {
32
+ export function hasOwn<T extends object = object>(obj: T, key: PropertyKey): key is keyof T {
30
33
  return Object.prototype.hasOwnProperty.call(obj, key);
31
34
  }
32
35
 
@@ -73,22 +76,30 @@ export const coerceBoolean = (value: unknown): boolean => {
73
76
  };
74
77
 
75
78
  export const maybeCoerceInteger = (value: unknown): number | undefined => {
76
- if (value === undefined) {
79
+ if (value == null) {
77
80
  return undefined;
78
81
  }
79
82
  return coerceInteger(value);
80
83
  };
81
84
 
82
85
  export const maybeCoerceFloat = (value: unknown): number | undefined => {
83
- if (value === undefined) {
86
+ if (value == null) {
84
87
  return undefined;
85
88
  }
86
89
  return coerceFloat(value);
87
90
  };
88
91
 
89
92
  export const maybeCoerceBoolean = (value: unknown): boolean | undefined => {
90
- if (value === undefined) {
93
+ if (value == null) {
91
94
  return undefined;
92
95
  }
93
96
  return coerceBoolean(value);
94
97
  };
98
+
99
+ export const safeJSON = (text: string) => {
100
+ try {
101
+ return JSON.parse(text);
102
+ } catch (err) {
103
+ return undefined;
104
+ }
105
+ };
package/src/resource.ts CHANGED
@@ -1,11 +1,2 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import type { Roark } from './client';
4
-
5
- export class APIResource {
6
- protected _client: Roark;
7
-
8
- constructor(client: Roark) {
9
- this._client = client;
10
- }
11
- }
1
+ /** @deprecated Import from ./core/resource instead */
2
+ export * from './core/resource';
@@ -1,8 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../resource';
4
- import { APIPromise } from '../api-promise';
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
5
  import { RequestOptions } from '../internal/request-options';
6
+ import { path } from '../internal/utils/path';
6
7
 
7
8
  export class Call extends APIResource {
8
9
  /**
@@ -26,14 +27,14 @@ export class Call extends APIResource {
26
27
  * Retrieve an existing call by its unique identifier
27
28
  */
28
29
  getByID(callID: string, options?: RequestOptions): APIPromise<CallGetByIDResponse> {
29
- return this._client.get(`/v1/call/${callID}`, options);
30
+ return this._client.get(path`/v1/call/${callID}`, options);
30
31
  }
31
32
 
32
33
  /**
33
34
  * Fetch all evaluation run results for a specific call.
34
35
  */
35
36
  listEvaluationRuns(callID: string, options?: RequestOptions): APIPromise<CallListEvaluationRunsResponse> {
36
- return this._client.get(`/v1/call/${callID}/evaluation-run`, options);
37
+ return this._client.get(path`/v1/call/${callID}/evaluation-run`, options);
37
38
  }
38
39
 
39
40
  /**
@@ -45,7 +46,7 @@ export class Call extends APIResource {
45
46
  query: CallListMetricsParams | null | undefined = {},
46
47
  options?: RequestOptions,
47
48
  ): APIPromise<CallListMetricsResponse> {
48
- return this._client.get(`/v1/call/${callID}/metrics`, { query, ...options });
49
+ return this._client.get(path`/v1/call/${callID}/metrics`, { query, ...options });
49
50
  }
50
51
 
51
52
  /**
@@ -53,7 +54,7 @@ export class Call extends APIResource {
53
54
  * emotional tone, key phrases, and sentiment scores.
54
55
  */
55
56
  listSentimentRuns(callID: string, options?: RequestOptions): APIPromise<CallListSentimentRunsResponse> {
56
- return this._client.get(`/v1/call/${callID}/sentiment-run`, options);
57
+ return this._client.get(path`/v1/call/${callID}/sentiment-run`, options);
57
58
  }
58
59
  }
59
60
 
@@ -207,7 +208,7 @@ export namespace CallListResponse {
207
208
  /**
208
209
  * Custom properties associated with the call
209
210
  */
210
- properties?: Record<string, unknown> | null;
211
+ properties?: { [key: string]: unknown } | null;
211
212
 
212
213
  /**
213
214
  * Pre-signed URL to the call recording (expires in 1 hour)
@@ -372,7 +373,7 @@ export namespace CallGetByIDResponse {
372
373
  /**
373
374
  * Custom properties associated with the call
374
375
  */
375
- properties?: Record<string, unknown> | null;
376
+ properties?: { [key: string]: unknown } | null;
376
377
 
377
378
  /**
378
379
  * Pre-signed URL to the call recording (expires in 1 hour)
@@ -935,7 +936,7 @@ export interface CallCreateParams {
935
936
  * Custom properties to include with the call. These can be used for filtering and
936
937
  * will show in the call details page
937
938
  */
938
- properties?: Record<string, unknown>;
939
+ properties?: { [key: string]: unknown };
939
940
 
940
941
  /**
941
942
  * URL of source stereo recording. Must be accessible. Can be a signed URL.
@@ -1367,12 +1368,12 @@ export namespace CallCreateParams {
1367
1368
  /**
1368
1369
  * Parameters provided to the tool during invocation
1369
1370
  */
1370
- parameters: Record<string, ToolInvocation.UnionMember0 | unknown>;
1371
+ parameters: { [key: string]: ToolInvocation.UnionMember0 | unknown };
1371
1372
 
1372
1373
  /**
1373
1374
  * Result returned by the tool after execution. Can be a string or a JSON object
1374
1375
  */
1375
- result: string | Record<string, unknown>;
1376
+ result: string | { [key: string]: unknown };
1376
1377
 
1377
1378
  /**
1378
1379
  * Offset in milliseconds from the start of the call when the tool was invoked
@@ -1,8 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../resource';
4
- import { APIPromise } from '../api-promise';
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
5
  import { RequestOptions } from '../internal/request-options';
6
+ import { path } from '../internal/utils/path';
6
7
 
7
8
  export class Evaluation extends APIResource {
8
9
  /**
@@ -22,14 +23,14 @@ export class Evaluation extends APIResource {
22
23
  evaluatorID: string,
23
24
  options?: RequestOptions,
24
25
  ): APIPromise<EvaluationGetEvaluatorByIDResponse> {
25
- return this._client.get(`/v1/evaluation/evaluators/${evaluatorID}`, options);
26
+ return this._client.get(path`/v1/evaluation/evaluators/${evaluatorID}`, options);
26
27
  }
27
28
 
28
29
  /**
29
30
  * Retrieve details of a specific evaluation job
30
31
  */
31
32
  getJob(jobID: string, options?: RequestOptions): APIPromise<EvaluationGetJobResponse> {
32
- return this._client.get(`/v1/evaluation/job/${jobID}`, options);
33
+ return this._client.get(path`/v1/evaluation/job/${jobID}`, options);
33
34
  }
34
35
 
35
36
  /**
@@ -51,7 +52,7 @@ export class Evaluation extends APIResource {
51
52
  query: EvaluationListJobRunsParams | null | undefined = {},
52
53
  options?: RequestOptions,
53
54
  ): APIPromise<EvaluationListJobRunsResponse> {
54
- return this._client.get(`/v1/evaluation/job/${jobID}/runs`, { query, ...options });
55
+ return this._client.get(path`/v1/evaluation/job/${jobID}/runs`, { query, ...options });
55
56
  }
56
57
  }
57
58
 
@@ -1399,7 +1400,7 @@ export namespace EvaluationCreateJobParams {
1399
1400
  * Custom properties to include with the call. These can be used for filtering and
1400
1401
  * will show in the call details page
1401
1402
  */
1402
- properties?: Record<string, unknown>;
1403
+ properties?: { [key: string]: unknown };
1403
1404
 
1404
1405
  /**
1405
1406
  * Retell call ID if call is being imported from Retell
@@ -1447,12 +1448,12 @@ export namespace EvaluationCreateJobParams {
1447
1448
  /**
1448
1449
  * Parameters provided to the tool during invocation
1449
1450
  */
1450
- parameters: Record<string, ToolInvocation.UnionMember0 | unknown>;
1451
+ parameters: { [key: string]: ToolInvocation.UnionMember0 | unknown };
1451
1452
 
1452
1453
  /**
1453
1454
  * Result returned by the tool after execution. Can be a string or a JSON object
1454
1455
  */
1455
- result: string | Record<string, unknown>;
1456
+ result: string | { [key: string]: unknown };
1456
1457
 
1457
1458
  /**
1458
1459
  * Offset in milliseconds from the start of the call when the tool was invoked
@@ -1560,7 +1561,7 @@ export namespace EvaluationCreateJobParams {
1560
1561
  * Custom properties to include with the call. These can be used for filtering and
1561
1562
  * will show in the call details page
1562
1563
  */
1563
- properties?: Record<string, unknown>;
1564
+ properties?: { [key: string]: unknown };
1564
1565
 
1565
1566
  /**
1566
1567
  * Retell call ID if call is being imported from Retell
@@ -1608,12 +1609,12 @@ export namespace EvaluationCreateJobParams {
1608
1609
  /**
1609
1610
  * Parameters provided to the tool during invocation
1610
1611
  */
1611
- parameters: Record<string, ToolInvocation.UnionMember0 | unknown>;
1612
+ parameters: { [key: string]: ToolInvocation.UnionMember0 | unknown };
1612
1613
 
1613
1614
  /**
1614
1615
  * Result returned by the tool after execution. Can be a string or a JSON object
1615
1616
  */
1616
- result: string | Record<string, unknown>;
1617
+ result: string | { [key: string]: unknown };
1617
1618
 
1618
1619
  /**
1619
1620
  * Offset in milliseconds from the start of the call when the tool was invoked
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../resource';
4
- import { APIPromise } from '../api-promise';
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
5
  import { RequestOptions } from '../internal/request-options';
6
6
 
7
7
  export class Health extends APIResource {
@@ -1,12 +1,19 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../resource';
4
- import { APIPromise } from '../api-promise';
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
5
  import { RequestOptions } from '../internal/request-options';
6
6
 
7
7
  export class Integrations extends APIResource {
8
8
  /**
9
9
  * Process and upload a Retell call to Roark evaluation
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const response = await client.integrations.createRetellCall(
14
+ * { retellCallEndedPayload: { event: 'bar', call: 'bar' } },
15
+ * );
16
+ * ```
10
17
  */
11
18
  createRetellCall(
12
19
  body: IntegrationCreateRetellCallParams,
@@ -17,6 +24,24 @@ export class Integrations extends APIResource {
17
24
 
18
25
  /**
19
26
  * Process and upload a VAPI call to Roark evaluation
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const response = await client.integrations.createVapiCall({
31
+ * vapiEndOfCallReportPayload: {
32
+ * call: 'bar',
33
+ * type: 'bar',
34
+ * status: 'bar',
35
+ * assistant: 'bar',
36
+ * customer: 'bar',
37
+ * phoneNumber: 'bar',
38
+ * artifact: 'bar',
39
+ * startedAt: 'bar',
40
+ * endedAt: 'bar',
41
+ * endedReason: 'bar',
42
+ * },
43
+ * });
44
+ * ```
20
45
  */
21
46
  createVapiCall(
22
47
  body: IntegrationCreateVapiCallParams,
@@ -68,13 +93,13 @@ export interface IntegrationCreateRetellCallParams {
68
93
  /**
69
94
  * Raw Retell data forwarded directly from the Retell call_ended webhook
70
95
  */
71
- retellCallEndedPayload: Record<string, unknown>;
96
+ retellCallEndedPayload: { [key: string]: unknown };
72
97
 
73
98
  /**
74
99
  * Optional metadata (key-value pairs) to include with the call. Useful for
75
100
  * filtering and display in call details.
76
101
  */
77
- properties?: Record<string, unknown>;
102
+ properties?: { [key: string]: unknown };
78
103
 
79
104
  /**
80
105
  * Skip already imported Retell calls with the same Retell call id.
@@ -86,13 +111,13 @@ export interface IntegrationCreateVapiCallParams {
86
111
  /**
87
112
  * Raw Vapi data forwarded directly from the Vapi end-of-call-report webhook
88
113
  */
89
- vapiEndOfCallReportPayload: Record<string, unknown>;
114
+ vapiEndOfCallReportPayload: { [key: string]: unknown };
90
115
 
91
116
  /**
92
117
  * Optional metadata (key-value pairs) to include with the call. Useful for
93
118
  * filtering and display in call details.
94
119
  */
95
- properties?: Record<string, unknown>;
120
+ properties?: { [key: string]: unknown };
96
121
 
97
122
  /**
98
123
  * Skip already imported Vapi calls with the same Vapi call id.
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../resource';
4
- import { APIPromise } from '../api-promise';
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
5
  import { RequestOptions } from '../internal/request-options';
6
6
 
7
7
  export class Metric extends APIResource {
@@ -1,12 +1,23 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../resource';
4
- import { APIPromise } from '../api-promise';
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
5
  import { RequestOptions } from '../internal/request-options';
6
+ import { path } from '../internal/utils/path';
6
7
 
7
8
  export class Persona extends APIResource {
8
9
  /**
9
10
  * Creates a new persona for the authenticated project.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const persona = await client.persona.create({
15
+ * accent: 'US',
16
+ * gender: 'MALE',
17
+ * language: 'EN',
18
+ * name: 'name',
19
+ * });
20
+ * ```
10
21
  */
11
22
  create(body: PersonaCreateParams, options?: RequestOptions): APIPromise<PersonaCreateResponse> {
12
23
  return this._client.post('/v1/persona', { body, ...options });
@@ -14,17 +25,27 @@ export class Persona extends APIResource {
14
25
 
15
26
  /**
16
27
  * Updates an existing persona by its ID.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const persona = await client.persona.update('personaId');
32
+ * ```
17
33
  */
18
34
  update(
19
35
  personaID: string,
20
36
  body: PersonaUpdateParams | null | undefined = {},
21
37
  options?: RequestOptions,
22
38
  ): APIPromise<PersonaUpdateResponse> {
23
- return this._client.put(`/v1/persona/${personaID}`, { body, ...options });
39
+ return this._client.put(path`/v1/persona/${personaID}`, { body, ...options });
24
40
  }
25
41
 
26
42
  /**
27
43
  * Returns a paginated list of personas for the authenticated project.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const personas = await client.persona.list();
48
+ * ```
28
49
  */
29
50
  list(
30
51
  query: PersonaListParams | null | undefined = {},
@@ -35,9 +56,14 @@ export class Persona extends APIResource {
35
56
 
36
57
  /**
37
58
  * Returns a specific persona by its ID.
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * const response = await client.persona.getByID('personaId');
63
+ * ```
38
64
  */
39
65
  getByID(personaID: string, options?: RequestOptions): APIPromise<PersonaGetByIDResponse> {
40
- return this._client.get(`/v1/persona/${personaID}`, options);
66
+ return this._client.get(path`/v1/persona/${personaID}`, options);
41
67
  }
42
68
  }
43
69
 
@@ -134,7 +160,7 @@ export namespace PersonaCreateResponse {
134
160
  /**
135
161
  * Additional custom properties about the persona
136
162
  */
137
- properties: Record<string, unknown>;
163
+ properties: { [key: string]: unknown };
138
164
 
139
165
  /**
140
166
  * Speech clarity of the persona
@@ -256,7 +282,7 @@ export namespace PersonaUpdateResponse {
256
282
  /**
257
283
  * Additional custom properties about the persona
258
284
  */
259
- properties: Record<string, unknown>;
285
+ properties: { [key: string]: unknown };
260
286
 
261
287
  /**
262
288
  * Speech clarity of the persona
@@ -380,7 +406,7 @@ export namespace PersonaListResponse {
380
406
  /**
381
407
  * Additional custom properties about the persona
382
408
  */
383
- properties: Record<string, unknown>;
409
+ properties: { [key: string]: unknown };
384
410
 
385
411
  /**
386
412
  * Speech clarity of the persona
@@ -519,7 +545,7 @@ export namespace PersonaGetByIDResponse {
519
545
  /**
520
546
  * Additional custom properties about the persona
521
547
  */
522
- properties: Record<string, unknown>;
548
+ properties: { [key: string]: unknown };
523
549
 
524
550
  /**
525
551
  * Speech clarity of the persona
@@ -631,7 +657,7 @@ export interface PersonaCreateParams {
631
657
  /**
632
658
  * Additional custom properties about the persona
633
659
  */
634
- properties?: Record<string, unknown>;
660
+ properties?: { [key: string]: unknown };
635
661
 
636
662
  /**
637
663
  * Secondary language ISO 639-1 code for code-switching (e.g., Hinglish, Spanglish)
@@ -732,7 +758,7 @@ export interface PersonaUpdateParams {
732
758
  /**
733
759
  * Additional custom properties about the persona
734
760
  */
735
- properties?: Record<string, unknown>;
761
+ properties?: { [key: string]: unknown };
736
762
 
737
763
  /**
738
764
  * Secondary language ISO 639-1 code for code-switching (e.g., Hinglish, Spanglish)
@@ -1,32 +1,53 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../resource';
4
- import { APIPromise } from '../api-promise';
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
5
  import { RequestOptions } from '../internal/request-options';
6
+ import { path } from '../internal/utils/path';
6
7
 
7
8
  export class Simulation extends APIResource {
8
9
  /**
9
10
  * Retrieve details of a simulation plan job including all associated simulation
10
11
  * jobs (calls)
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const response = await client.simulation.getRunPlanJob(
16
+ * '7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f',
17
+ * );
18
+ * ```
11
19
  */
12
20
  getRunPlanJob(jobID: unknown, options?: RequestOptions): APIPromise<SimulationGetRunPlanJobResponse> {
13
- return this._client.get(`/v1/simulation/plan/job/${jobID}`, options);
21
+ return this._client.get(path`/v1/simulation/plan/job/${jobID}`, options);
14
22
  }
15
23
 
16
24
  /**
17
25
  * Get a individual simulation run directly by its ID. This is generally part of a
18
26
  * larger simulation run plan job.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const response =
31
+ * await client.simulation.getSimulationJobByID(
32
+ * '7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f',
33
+ * );
34
+ * ```
19
35
  */
20
36
  getSimulationJobByID(
21
37
  jobID: unknown,
22
38
  options?: RequestOptions,
23
39
  ): APIPromise<SimulationGetSimulationJobByIDResponse> {
24
- return this._client.get(`/v1/simulation/job/${jobID}`, options);
40
+ return this._client.get(path`/v1/simulation/job/${jobID}`, options);
25
41
  }
26
42
 
27
43
  /**
28
44
  * Returns a paginated list of simulation run plan jobs. Filter by status, plan ID,
29
45
  * or label to find specific simulation batches.
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * const response = await client.simulation.listRunPlanJobs();
50
+ * ```
30
51
  */
31
52
  listRunPlanJobs(
32
53
  query: SimulationListRunPlanJobsParams | null | undefined = {},
@@ -37,6 +58,11 @@ export class Simulation extends APIResource {
37
58
 
38
59
  /**
39
60
  * Returns a paginated list of simulation scenarios for the authenticated project.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * const response = await client.simulation.listScenarios();
65
+ * ```
40
66
  */
41
67
  listScenarios(
42
68
  query: SimulationListScenariosParams | null | undefined = {},
@@ -48,6 +74,14 @@ export class Simulation extends APIResource {
48
74
  /**
49
75
  * Find the matching simulation using the number used by the Roark simulation
50
76
  * agent.
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * const response =
81
+ * await client.simulation.lookupSimulationJob({
82
+ * roarkPhoneNumber: {},
83
+ * });
84
+ * ```
51
85
  */
52
86
  lookupSimulationJob(
53
87
  query: SimulationLookupSimulationJobParams,
@@ -58,9 +92,16 @@ export class Simulation extends APIResource {
58
92
 
59
93
  /**
60
94
  * Create and execute a job for an existing simulation run plan
95
+ *
96
+ * @example
97
+ * ```ts
98
+ * const response = await client.simulation.startRunPlanJob(
99
+ * '7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f',
100
+ * );
101
+ * ```
61
102
  */
62
103
  startRunPlanJob(planID: unknown, options?: RequestOptions): APIPromise<SimulationStartRunPlanJobResponse> {
63
- return this._client.post(`/v1/simulation/plan/${planID}/job`, options);
104
+ return this._client.post(path`/v1/simulation/plan/${planID}/job`, options);
64
105
  }
65
106
  }
66
107
 
@@ -283,7 +324,7 @@ export namespace SimulationGetRunPlanJobResponse {
283
324
  /**
284
325
  * Additional custom properties about the persona
285
326
  */
286
- properties: Record<string, unknown>;
327
+ properties: { [key: string]: unknown };
287
328
 
288
329
  /**
289
330
  * Speech clarity of the persona
@@ -510,7 +551,7 @@ export namespace SimulationGetSimulationJobByIDResponse {
510
551
  /**
511
552
  * Additional custom properties about the persona
512
553
  */
513
- properties: Record<string, unknown>;
554
+ properties: { [key: string]: unknown };
514
555
 
515
556
  /**
516
557
  * Speech clarity of the persona
@@ -878,7 +919,7 @@ export namespace SimulationLookupSimulationJobResponse {
878
919
  /**
879
920
  * Additional custom properties about the persona
880
921
  */
881
- properties: Record<string, unknown>;
922
+ properties: { [key: string]: unknown };
882
923
 
883
924
  /**
884
925
  * Speech clarity of the persona
@@ -0,0 +1 @@
1
+ export * from './resources/index';
package/src/uploads.ts CHANGED
@@ -1 +1,2 @@
1
- export { type Uploadable, toFile } from './internal/uploads';
1
+ /** @deprecated Import from ./core/uploads instead */
2
+ export * from './core/uploads';
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '2.21.1'; // x-release-please-version
1
+ export const VERSION = '2.22.0'; // x-release-please-version
package/uploads.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export { type Uploadable, toFile } from "./internal/uploads.mjs";
1
+ export * from "./core/uploads.mjs";
2
2
  //# sourceMappingURL=uploads.d.mts.map
package/uploads.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"uploads.d.mts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":"OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,EAAE"}
1
+ {"version":3,"file":"uploads.d.mts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":""}
package/uploads.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { type Uploadable, toFile } from "./internal/uploads.js";
1
+ export * from "./core/uploads.js";
2
2
  //# sourceMappingURL=uploads.d.ts.map
package/uploads.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"uploads.d.ts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":"OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,EAAE"}
1
+ {"version":3,"file":"uploads.d.ts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":""}
package/uploads.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toFile = void 0;
4
- var uploads_1 = require("./internal/uploads.js");
5
- Object.defineProperty(exports, "toFile", { enumerable: true, get: function () { return uploads_1.toFile; } });
3
+ const tslib_1 = require("./internal/tslib.js");
4
+ /** @deprecated Import from ./core/uploads instead */
5
+ tslib_1.__exportStar(require("./core/uploads.js"), exports);
6
6
  //# sourceMappingURL=uploads.js.map
package/uploads.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"uploads.js","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":";;;AAAA,iDAA6D;AAAnC,iGAAA,MAAM,OAAA"}
1
+ {"version":3,"file":"uploads.js","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":";;;AAAA,qDAAqD;AACrD,4DAA+B"}
package/uploads.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { toFile } from "./internal/uploads.mjs";
1
+ export * from "./core/uploads.mjs";
2
2
  //# sourceMappingURL=uploads.mjs.map
package/uploads.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"uploads.mjs","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":"OAAO,EAAmB,MAAM,EAAE"}
1
+ {"version":3,"file":"uploads.mjs","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":""}
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.21.1";
1
+ export declare const VERSION = "2.22.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.21.1";
1
+ export declare const VERSION = "2.22.0";
2
2
  //# sourceMappingURL=version.d.ts.map