@roarkanalytics/sdk 2.20.0 → 2.21.1

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 (419) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +83 -45
  3. package/api-promise.d.mts +47 -0
  4. package/api-promise.d.mts.map +1 -0
  5. package/api-promise.d.ts +47 -0
  6. package/api-promise.d.ts.map +1 -0
  7. package/api-promise.js +84 -0
  8. package/api-promise.js.map +1 -0
  9. package/api-promise.mjs +80 -0
  10. package/api-promise.mjs.map +1 -0
  11. package/client.d.mts +201 -0
  12. package/client.d.mts.map +1 -0
  13. package/client.d.ts +201 -0
  14. package/client.d.ts.map +1 -0
  15. package/client.js +454 -0
  16. package/client.js.map +1 -0
  17. package/client.mjs +427 -0
  18. package/client.mjs.map +1 -0
  19. package/error.d.mts +47 -0
  20. package/error.d.mts.map +1 -0
  21. package/error.d.ts +1 -1
  22. package/error.d.ts.map +1 -1
  23. package/error.js +2 -2
  24. package/error.js.map +1 -1
  25. package/error.mjs +1 -1
  26. package/error.mjs.map +1 -1
  27. package/index.d.mts +4 -130
  28. package/index.d.mts.map +1 -0
  29. package/index.d.ts +4 -130
  30. package/index.d.ts.map +1 -1
  31. package/index.js +10 -128
  32. package/index.js.map +1 -1
  33. package/index.mjs +4 -102
  34. package/index.mjs.map +1 -1
  35. package/internal/builtin-types.d.mts +65 -0
  36. package/internal/builtin-types.d.mts.map +1 -0
  37. package/internal/builtin-types.d.ts +65 -0
  38. package/internal/builtin-types.d.ts.map +1 -0
  39. package/internal/builtin-types.js +4 -0
  40. package/internal/builtin-types.js.map +1 -0
  41. package/internal/builtin-types.mjs +3 -0
  42. package/internal/builtin-types.mjs.map +1 -0
  43. package/internal/detect-platform.d.mts +15 -0
  44. package/internal/detect-platform.d.mts.map +1 -0
  45. package/internal/detect-platform.d.ts +15 -0
  46. package/internal/detect-platform.d.ts.map +1 -0
  47. package/internal/detect-platform.js +162 -0
  48. package/internal/detect-platform.js.map +1 -0
  49. package/internal/detect-platform.mjs +157 -0
  50. package/internal/detect-platform.mjs.map +1 -0
  51. package/internal/errors.d.mts +3 -0
  52. package/internal/errors.d.mts.map +1 -0
  53. package/internal/errors.d.ts +3 -0
  54. package/internal/errors.d.ts.map +1 -0
  55. package/internal/errors.js +26 -0
  56. package/internal/errors.js.map +1 -0
  57. package/internal/errors.mjs +21 -0
  58. package/internal/errors.mjs.map +1 -0
  59. package/internal/headers.d.mts +21 -0
  60. package/internal/headers.d.mts.map +1 -0
  61. package/internal/headers.d.ts +21 -0
  62. package/internal/headers.d.ts.map +1 -0
  63. package/internal/headers.js +77 -0
  64. package/internal/headers.js.map +1 -0
  65. package/internal/headers.mjs +72 -0
  66. package/internal/headers.mjs.map +1 -0
  67. package/internal/parse.d.mts +10 -0
  68. package/internal/parse.d.mts.map +1 -0
  69. package/internal/parse.d.ts +10 -0
  70. package/internal/parse.d.ts.map +1 -0
  71. package/internal/parse.js +28 -0
  72. package/internal/parse.js.map +1 -0
  73. package/internal/parse.mjs +24 -0
  74. package/internal/parse.mjs.map +1 -0
  75. package/internal/polyfill/crypto.node.d.ts +10 -0
  76. package/internal/polyfill/crypto.node.js +11 -0
  77. package/internal/polyfill/crypto.node.mjs +2 -0
  78. package/internal/polyfill/file.node.d.ts +9 -0
  79. package/internal/polyfill/file.node.js +17 -0
  80. package/internal/polyfill/file.node.mjs +9 -0
  81. package/internal/qs/formats.d.mts +6 -0
  82. package/internal/qs/formats.d.mts.map +1 -0
  83. package/internal/qs/formats.d.ts.map +1 -1
  84. package/internal/qs/index.d.mts +10 -0
  85. package/internal/qs/index.d.mts.map +1 -0
  86. package/internal/qs/index.d.ts.map +1 -1
  87. package/internal/qs/stringify.d.mts +3 -0
  88. package/internal/qs/stringify.d.mts.map +1 -0
  89. package/internal/qs/stringify.d.ts.map +1 -1
  90. package/internal/qs/types.d.mts +57 -0
  91. package/internal/qs/types.d.mts.map +1 -0
  92. package/internal/qs/utils.d.mts +14 -0
  93. package/internal/qs/utils.d.mts.map +1 -0
  94. package/internal/qs/utils.d.ts.map +1 -1
  95. package/internal/request-options.d.mts +34 -0
  96. package/internal/request-options.d.mts.map +1 -0
  97. package/internal/request-options.d.ts +34 -0
  98. package/internal/request-options.d.ts.map +1 -0
  99. package/internal/request-options.js +39 -0
  100. package/internal/request-options.js.map +1 -0
  101. package/internal/request-options.mjs +34 -0
  102. package/internal/request-options.mjs.map +1 -0
  103. package/internal/shim-types.d.mts +28 -0
  104. package/internal/shim-types.d.ts +28 -0
  105. package/internal/shims.d.mts +61 -0
  106. package/internal/shims.d.mts.map +1 -0
  107. package/internal/shims.d.ts +61 -0
  108. package/internal/shims.d.ts.map +1 -0
  109. package/internal/shims.js +101 -0
  110. package/internal/shims.js.map +1 -0
  111. package/internal/shims.mjs +92 -0
  112. package/internal/shims.mjs.map +1 -0
  113. package/internal/types.d.mts +68 -0
  114. package/internal/types.d.mts.map +1 -0
  115. package/internal/types.d.ts +68 -0
  116. package/internal/types.d.ts.map +1 -0
  117. package/internal/types.js +4 -0
  118. package/internal/types.js.map +1 -0
  119. package/internal/types.mjs +3 -0
  120. package/internal/types.mjs.map +1 -0
  121. package/internal/uploads.d.mts +73 -0
  122. package/internal/uploads.d.mts.map +1 -0
  123. package/internal/uploads.d.ts +73 -0
  124. package/internal/uploads.d.ts.map +1 -0
  125. package/internal/uploads.js +208 -0
  126. package/internal/uploads.js.map +1 -0
  127. package/internal/uploads.mjs +200 -0
  128. package/internal/uploads.mjs.map +1 -0
  129. package/internal/utils/base64.d.mts +3 -0
  130. package/internal/utils/base64.d.mts.map +1 -0
  131. package/internal/utils/base64.d.ts +3 -0
  132. package/internal/utils/base64.d.ts.map +1 -0
  133. package/internal/utils/base64.js +33 -0
  134. package/internal/utils/base64.js.map +1 -0
  135. package/internal/utils/base64.mjs +28 -0
  136. package/internal/utils/base64.mjs.map +1 -0
  137. package/internal/utils/env.d.mts +9 -0
  138. package/internal/utils/env.d.mts.map +1 -0
  139. package/internal/utils/env.d.ts +9 -0
  140. package/internal/utils/env.d.ts.map +1 -0
  141. package/internal/utils/env.js +22 -0
  142. package/internal/utils/env.js.map +1 -0
  143. package/internal/utils/env.mjs +18 -0
  144. package/internal/utils/env.mjs.map +1 -0
  145. package/internal/utils/log.d.mts +4 -0
  146. package/internal/utils/log.d.mts.map +1 -0
  147. package/internal/utils/log.d.ts +4 -0
  148. package/internal/utils/log.d.ts.map +1 -0
  149. package/internal/utils/log.js +47 -0
  150. package/internal/utils/log.js.map +1 -0
  151. package/internal/utils/log.mjs +43 -0
  152. package/internal/utils/log.mjs.map +1 -0
  153. package/internal/utils/sleep.d.mts +2 -0
  154. package/internal/utils/sleep.d.mts.map +1 -0
  155. package/internal/utils/sleep.d.ts +2 -0
  156. package/internal/utils/sleep.d.ts.map +1 -0
  157. package/internal/utils/sleep.js +7 -0
  158. package/internal/utils/sleep.js.map +1 -0
  159. package/internal/utils/sleep.mjs +3 -0
  160. package/internal/utils/sleep.mjs.map +1 -0
  161. package/internal/utils/uuid.d.mts +5 -0
  162. package/internal/utils/uuid.d.mts.map +1 -0
  163. package/internal/utils/uuid.d.ts +5 -0
  164. package/internal/utils/uuid.d.ts.map +1 -0
  165. package/internal/utils/uuid.js +15 -0
  166. package/internal/utils/uuid.js.map +1 -0
  167. package/internal/utils/uuid.mjs +11 -0
  168. package/internal/utils/uuid.mjs.map +1 -0
  169. package/internal/utils/values.d.mts +15 -0
  170. package/internal/utils/values.d.mts.map +1 -0
  171. package/internal/utils/values.d.ts +15 -0
  172. package/internal/utils/values.d.ts.map +1 -0
  173. package/internal/utils/values.js +100 -0
  174. package/internal/utils/values.js.map +1 -0
  175. package/internal/utils/values.mjs +84 -0
  176. package/internal/utils/values.mjs.map +1 -0
  177. package/internal/utils.d.mts +7 -0
  178. package/internal/utils.d.mts.map +1 -0
  179. package/internal/utils.d.ts +7 -0
  180. package/internal/utils.d.ts.map +1 -0
  181. package/{_shims/auto/runtime-bun.js → internal/utils.js} +8 -5
  182. package/internal/utils.js.map +1 -0
  183. package/internal/utils.mjs +8 -0
  184. package/internal/utils.mjs.map +1 -0
  185. package/package.json +83 -66
  186. package/resource.d.mts +6 -0
  187. package/resource.d.mts.map +1 -0
  188. package/resource.d.ts +2 -2
  189. package/resource.d.ts.map +1 -1
  190. package/resource.js.map +1 -1
  191. package/resource.mjs.map +1 -1
  192. package/resources/call.d.mts +1197 -0
  193. package/resources/call.d.mts.map +1 -0
  194. package/resources/call.d.ts +13 -24
  195. package/resources/call.d.ts.map +1 -1
  196. package/resources/call.js +15 -15
  197. package/resources/call.js.map +1 -1
  198. package/resources/call.mjs +15 -15
  199. package/resources/call.mjs.map +1 -1
  200. package/resources/evaluation.d.mts +1295 -0
  201. package/resources/evaluation.d.mts.map +1 -0
  202. package/resources/evaluation.d.ts +13 -26
  203. package/resources/evaluation.d.ts.map +1 -1
  204. package/resources/evaluation.js +13 -13
  205. package/resources/evaluation.js.map +1 -1
  206. package/resources/evaluation.mjs +13 -13
  207. package/resources/evaluation.mjs.map +1 -1
  208. package/resources/health.d.mts +29 -0
  209. package/resources/health.d.mts.map +1 -0
  210. package/resources/health.d.ts +3 -2
  211. package/resources/health.d.ts.map +1 -1
  212. package/resources/health.js.map +1 -1
  213. package/resources/health.mjs.map +1 -1
  214. package/resources/index.d.mts +8 -0
  215. package/resources/index.d.mts.map +1 -0
  216. package/resources/index.d.ts.map +1 -1
  217. package/resources/integrations.d.mts +81 -0
  218. package/resources/integrations.d.mts.map +1 -0
  219. package/resources/integrations.d.ts +8 -40
  220. package/resources/integrations.d.ts.map +1 -1
  221. package/resources/integrations.js +0 -25
  222. package/resources/integrations.js.map +1 -1
  223. package/resources/integrations.mjs +0 -25
  224. package/resources/integrations.mjs.map +1 -1
  225. package/resources/metric.d.mts +75 -0
  226. package/resources/metric.d.mts.map +1 -0
  227. package/resources/metric.d.ts +3 -2
  228. package/resources/metric.d.ts.map +1 -1
  229. package/resources/metric.js.map +1 -1
  230. package/resources/metric.mjs.map +1 -1
  231. package/resources/persona.d.mts +491 -0
  232. package/resources/persona.d.mts.map +1 -0
  233. package/resources/persona.d.ts +13 -51
  234. package/resources/persona.d.ts.map +1 -1
  235. package/resources/persona.js +10 -26
  236. package/resources/persona.js.map +1 -1
  237. package/resources/persona.mjs +10 -26
  238. package/resources/persona.mjs.map +1 -1
  239. package/resources/simulation.d.mts +756 -0
  240. package/resources/simulation.d.mts.map +1 -0
  241. package/resources/simulation.d.ts +11 -58
  242. package/resources/simulation.d.ts.map +1 -1
  243. package/resources/simulation.js +13 -43
  244. package/resources/simulation.js.map +1 -1
  245. package/resources/simulation.mjs +13 -43
  246. package/resources/simulation.mjs.map +1 -1
  247. package/src/api-promise.ts +92 -0
  248. package/src/client.ts +751 -0
  249. package/src/error.ts +1 -1
  250. package/src/index.ts +4 -307
  251. package/src/internal/builtin-types.ts +79 -0
  252. package/src/internal/detect-platform.ts +196 -0
  253. package/src/internal/errors.ts +22 -0
  254. package/src/internal/headers.ts +96 -0
  255. package/src/internal/parse.ts +41 -0
  256. package/src/internal/polyfill/crypto.node.d.ts +10 -0
  257. package/src/internal/polyfill/crypto.node.js +11 -0
  258. package/src/internal/polyfill/crypto.node.mjs +2 -0
  259. package/src/internal/polyfill/file.node.d.ts +9 -0
  260. package/src/internal/polyfill/file.node.js +17 -0
  261. package/src/internal/polyfill/file.node.mjs +9 -0
  262. package/src/internal/request-options.ts +67 -0
  263. package/src/internal/shim-types.d.ts +28 -0
  264. package/src/internal/shims.ts +145 -0
  265. package/src/internal/types.ts +98 -0
  266. package/src/internal/uploads.ts +307 -0
  267. package/src/internal/utils/base64.ts +37 -0
  268. package/src/internal/utils/env.ts +18 -0
  269. package/src/internal/utils/log.ts +49 -0
  270. package/src/internal/utils/sleep.ts +3 -0
  271. package/src/internal/utils/uuid.ts +13 -0
  272. package/src/internal/utils/values.ts +94 -0
  273. package/src/internal/utils.ts +8 -0
  274. package/src/resource.ts +2 -2
  275. package/src/resources/call.ts +22 -42
  276. package/src/resources/evaluation.ts +25 -42
  277. package/src/resources/health.ts +3 -2
  278. package/src/resources/integrations.ts +10 -34
  279. package/src/resources/metric.ts +3 -2
  280. package/src/resources/persona.ts +22 -61
  281. package/src/resources/simulation.ts +22 -84
  282. package/src/tsconfig.json +2 -2
  283. package/src/uploads.ts +1 -255
  284. package/src/version.ts +1 -1
  285. package/uploads.d.mts +2 -0
  286. package/uploads.d.mts.map +1 -0
  287. package/uploads.d.ts +1 -74
  288. package/uploads.d.ts.map +1 -1
  289. package/uploads.js +3 -168
  290. package/uploads.js.map +1 -1
  291. package/uploads.mjs +1 -157
  292. package/uploads.mjs.map +1 -1
  293. package/version.d.mts +2 -0
  294. package/version.d.mts.map +1 -0
  295. package/version.d.ts +1 -1
  296. package/version.js +1 -1
  297. package/version.mjs +1 -1
  298. package/_shims/MultipartBody.d.ts +0 -9
  299. package/_shims/MultipartBody.d.ts.map +0 -1
  300. package/_shims/MultipartBody.js +0 -16
  301. package/_shims/MultipartBody.js.map +0 -1
  302. package/_shims/MultipartBody.mjs +0 -12
  303. package/_shims/MultipartBody.mjs.map +0 -1
  304. package/_shims/README.md +0 -46
  305. package/_shims/auto/runtime-bun.d.ts +0 -5
  306. package/_shims/auto/runtime-bun.d.ts.map +0 -1
  307. package/_shims/auto/runtime-bun.js.map +0 -1
  308. package/_shims/auto/runtime-bun.mjs +0 -2
  309. package/_shims/auto/runtime-bun.mjs.map +0 -1
  310. package/_shims/auto/runtime-node.d.ts +0 -5
  311. package/_shims/auto/runtime-node.d.ts.map +0 -1
  312. package/_shims/auto/runtime-node.js +0 -21
  313. package/_shims/auto/runtime-node.js.map +0 -1
  314. package/_shims/auto/runtime-node.mjs +0 -2
  315. package/_shims/auto/runtime-node.mjs.map +0 -1
  316. package/_shims/auto/runtime.d.ts +0 -5
  317. package/_shims/auto/runtime.d.ts.map +0 -1
  318. package/_shims/auto/runtime.js +0 -21
  319. package/_shims/auto/runtime.js.map +0 -1
  320. package/_shims/auto/runtime.mjs +0 -2
  321. package/_shims/auto/runtime.mjs.map +0 -1
  322. package/_shims/auto/types-node.d.ts +0 -5
  323. package/_shims/auto/types-node.d.ts.map +0 -1
  324. package/_shims/auto/types-node.js +0 -21
  325. package/_shims/auto/types-node.js.map +0 -1
  326. package/_shims/auto/types-node.mjs +0 -2
  327. package/_shims/auto/types-node.mjs.map +0 -1
  328. package/_shims/auto/types.d.ts +0 -101
  329. package/_shims/auto/types.js +0 -3
  330. package/_shims/auto/types.mjs +0 -3
  331. package/_shims/bun-runtime.d.ts +0 -6
  332. package/_shims/bun-runtime.d.ts.map +0 -1
  333. package/_shims/bun-runtime.js +0 -14
  334. package/_shims/bun-runtime.js.map +0 -1
  335. package/_shims/bun-runtime.mjs +0 -10
  336. package/_shims/bun-runtime.mjs.map +0 -1
  337. package/_shims/index.d.ts +0 -83
  338. package/_shims/index.js +0 -17
  339. package/_shims/index.mjs +0 -11
  340. package/_shims/manual-types.d.ts +0 -12
  341. package/_shims/manual-types.js +0 -3
  342. package/_shims/manual-types.mjs +0 -3
  343. package/_shims/node-runtime.d.ts +0 -3
  344. package/_shims/node-runtime.d.ts.map +0 -1
  345. package/_shims/node-runtime.js +0 -89
  346. package/_shims/node-runtime.js.map +0 -1
  347. package/_shims/node-runtime.mjs +0 -56
  348. package/_shims/node-runtime.mjs.map +0 -1
  349. package/_shims/node-types.d.ts +0 -42
  350. package/_shims/node-types.js +0 -3
  351. package/_shims/node-types.mjs +0 -3
  352. package/_shims/registry.d.ts +0 -37
  353. package/_shims/registry.d.ts.map +0 -1
  354. package/_shims/registry.js +0 -41
  355. package/_shims/registry.js.map +0 -1
  356. package/_shims/registry.mjs +0 -37
  357. package/_shims/registry.mjs.map +0 -1
  358. package/_shims/web-runtime.d.ts +0 -5
  359. package/_shims/web-runtime.d.ts.map +0 -1
  360. package/_shims/web-runtime.js +0 -78
  361. package/_shims/web-runtime.js.map +0 -1
  362. package/_shims/web-runtime.mjs +0 -71
  363. package/_shims/web-runtime.mjs.map +0 -1
  364. package/_shims/web-types.d.ts +0 -83
  365. package/_shims/web-types.js +0 -3
  366. package/_shims/web-types.mjs +0 -3
  367. package/core.d.ts +0 -255
  368. package/core.d.ts.map +0 -1
  369. package/core.js +0 -929
  370. package/core.js.map +0 -1
  371. package/core.mjs +0 -897
  372. package/core.mjs.map +0 -1
  373. package/resources.d.ts +0 -2
  374. package/resources.d.ts.map +0 -1
  375. package/resources.js +0 -18
  376. package/resources.js.map +0 -1
  377. package/resources.mjs +0 -2
  378. package/resources.mjs.map +0 -1
  379. package/shims/node.d.ts +0 -30
  380. package/shims/node.d.ts.map +0 -1
  381. package/shims/node.js +0 -31
  382. package/shims/node.js.map +0 -1
  383. package/shims/node.mjs +0 -5
  384. package/shims/node.mjs.map +0 -1
  385. package/shims/web.d.ts +0 -26
  386. package/shims/web.d.ts.map +0 -1
  387. package/shims/web.js +0 -31
  388. package/shims/web.js.map +0 -1
  389. package/shims/web.mjs +0 -5
  390. package/shims/web.mjs.map +0 -1
  391. package/src/_shims/MultipartBody.ts +0 -9
  392. package/src/_shims/README.md +0 -46
  393. package/src/_shims/auto/runtime-bun.ts +0 -4
  394. package/src/_shims/auto/runtime-node.ts +0 -4
  395. package/src/_shims/auto/runtime.ts +0 -4
  396. package/src/_shims/auto/types-node.ts +0 -4
  397. package/src/_shims/auto/types.d.ts +0 -101
  398. package/src/_shims/auto/types.js +0 -3
  399. package/src/_shims/auto/types.mjs +0 -3
  400. package/src/_shims/bun-runtime.ts +0 -14
  401. package/src/_shims/index.d.ts +0 -83
  402. package/src/_shims/index.js +0 -17
  403. package/src/_shims/index.mjs +0 -11
  404. package/src/_shims/manual-types.d.ts +0 -12
  405. package/src/_shims/manual-types.js +0 -3
  406. package/src/_shims/manual-types.mjs +0 -3
  407. package/src/_shims/node-runtime.ts +0 -81
  408. package/src/_shims/node-types.d.ts +0 -42
  409. package/src/_shims/node-types.js +0 -3
  410. package/src/_shims/node-types.mjs +0 -3
  411. package/src/_shims/registry.ts +0 -67
  412. package/src/_shims/web-runtime.ts +0 -103
  413. package/src/_shims/web-types.d.ts +0 -83
  414. package/src/_shims/web-types.js +0 -3
  415. package/src/_shims/web-types.mjs +0 -3
  416. package/src/core.ts +0 -1242
  417. package/src/resources.ts +0 -1
  418. package/src/shims/node.ts +0 -50
  419. package/src/shims/web.ts +0 -50
package/index.d.mts CHANGED
@@ -1,132 +1,6 @@
1
- import { type Agent } from "./_shims/index.js";
2
- import * as Core from "./core.js";
3
- import * as Errors from "./error.js";
4
- import * as Uploads from "./uploads.js";
5
- import * as API from "./resources/index.js";
6
- import { Call, CallCreateParams, CallCreateResponse, CallGetByIDResponse, CallListEvaluationRunsResponse, CallListMetricsParams, CallListMetricsResponse, CallListParams, CallListResponse, CallListSentimentRunsResponse } from "./resources/call.js";
7
- import { Evaluation, EvaluationCreateJobParams, EvaluationCreateJobResponse, EvaluationGetEvaluatorByIDResponse, EvaluationGetJobResponse, EvaluationListEvaluatorsParams, EvaluationListEvaluatorsResponse, EvaluationListJobRunsParams, EvaluationListJobRunsResponse } from "./resources/evaluation.js";
8
- import { Health, HealthGetResponse } from "./resources/health.js";
9
- import { IntegrationCreateRetellCallParams, IntegrationCreateRetellCallResponse, IntegrationCreateVapiCallParams, IntegrationCreateVapiCallResponse, Integrations } from "./resources/integrations.js";
10
- import { Metric, MetricListDefinitionsResponse } from "./resources/metric.js";
11
- import { Persona, PersonaCreateParams, PersonaCreateResponse, PersonaGetByIDResponse, PersonaListParams, PersonaListResponse, PersonaUpdateParams, PersonaUpdateResponse } from "./resources/persona.js";
12
- import { Simulation, SimulationGetRunPlanJobResponse, SimulationGetSimulationJobByIDResponse, SimulationListRunPlanJobsParams, SimulationListRunPlanJobsResponse, SimulationListScenariosParams, SimulationListScenariosResponse, SimulationLookupSimulationJobParams, SimulationLookupSimulationJobResponse, SimulationStartRunPlanJobResponse } from "./resources/simulation.js";
13
- export interface ClientOptions {
14
- /**
15
- * JWT token for authentication
16
- */
17
- bearerToken?: string | undefined;
18
- /**
19
- * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
20
- *
21
- * Defaults to process.env['ROARK_BASE_URL'].
22
- */
23
- baseURL?: string | null | undefined;
24
- /**
25
- * The maximum amount of time (in milliseconds) that the client should wait for a response
26
- * from the server before timing out a single request.
27
- *
28
- * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
29
- * much longer than this timeout before the promise succeeds or fails.
30
- *
31
- * @unit milliseconds
32
- */
33
- timeout?: number | undefined;
34
- /**
35
- * An HTTP agent used to manage HTTP(S) connections.
36
- *
37
- * If not provided, an agent will be constructed by default in the Node.js environment,
38
- * otherwise no agent is used.
39
- */
40
- httpAgent?: Agent | undefined;
41
- /**
42
- * Specify a custom `fetch` function implementation.
43
- *
44
- * If not provided, we use `node-fetch` on Node.js and otherwise expect that `fetch` is
45
- * defined globally.
46
- */
47
- fetch?: Core.Fetch | undefined;
48
- /**
49
- * The maximum number of times that the client will retry a request in case of a
50
- * temporary failure, like a network error or a 5XX error from the server.
51
- *
52
- * @default 2
53
- */
54
- maxRetries?: number | undefined;
55
- /**
56
- * Default headers to include with every request to the API.
57
- *
58
- * These can be removed in individual requests by explicitly setting the
59
- * header to `undefined` or `null` in request options.
60
- */
61
- defaultHeaders?: Core.Headers | undefined;
62
- /**
63
- * Default query parameters to include with every request to the API.
64
- *
65
- * These can be removed in individual requests by explicitly setting the
66
- * param to `undefined` in request options.
67
- */
68
- defaultQuery?: Core.DefaultQuery | undefined;
69
- }
70
- /**
71
- * API Client for interfacing with the Roark API.
72
- */
73
- export declare class Roark extends Core.APIClient {
74
- #private;
75
- bearerToken: string;
76
- private _options;
77
- /**
78
- * API Client for interfacing with the Roark API.
79
- *
80
- * @param {string | undefined} [opts.bearerToken=process.env['ROARK_API_BEARER_TOKEN'] ?? undefined]
81
- * @param {string} [opts.baseURL=process.env['ROARK_BASE_URL'] ?? https://api.roark.ai] - Override the default base URL for the API.
82
- * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
83
- * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
84
- * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
85
- * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
86
- * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
87
- * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
88
- */
89
- constructor({ baseURL, bearerToken, ...opts }?: ClientOptions);
90
- health: API.Health;
91
- evaluation: API.Evaluation;
92
- call: API.Call;
93
- metric: API.Metric;
94
- integrations: API.Integrations;
95
- simulation: API.Simulation;
96
- persona: API.Persona;
97
- protected defaultQuery(): Core.DefaultQuery | undefined;
98
- protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;
99
- protected authHeaders(opts: Core.FinalRequestOptions): Core.Headers;
100
- protected stringifyQuery(query: Record<string, unknown>): string;
101
- static Roark: typeof Roark;
102
- static DEFAULT_TIMEOUT: number;
103
- static RoarkError: typeof Errors.RoarkError;
104
- static APIError: typeof Errors.APIError;
105
- static APIConnectionError: typeof Errors.APIConnectionError;
106
- static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
107
- static APIUserAbortError: typeof Errors.APIUserAbortError;
108
- static NotFoundError: typeof Errors.NotFoundError;
109
- static ConflictError: typeof Errors.ConflictError;
110
- static RateLimitError: typeof Errors.RateLimitError;
111
- static BadRequestError: typeof Errors.BadRequestError;
112
- static AuthenticationError: typeof Errors.AuthenticationError;
113
- static InternalServerError: typeof Errors.InternalServerError;
114
- static PermissionDeniedError: typeof Errors.PermissionDeniedError;
115
- static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
116
- static toFile: typeof Uploads.toFile;
117
- static fileFromPath: typeof Uploads.fileFromPath;
118
- }
119
- export declare namespace Roark {
120
- export type RequestOptions = Core.RequestOptions;
121
- export { Health as Health, type HealthGetResponse as HealthGetResponse };
122
- export { Evaluation as Evaluation, type EvaluationCreateJobResponse as EvaluationCreateJobResponse, type EvaluationGetEvaluatorByIDResponse as EvaluationGetEvaluatorByIDResponse, type EvaluationGetJobResponse as EvaluationGetJobResponse, type EvaluationListEvaluatorsResponse as EvaluationListEvaluatorsResponse, type EvaluationListJobRunsResponse as EvaluationListJobRunsResponse, type EvaluationCreateJobParams as EvaluationCreateJobParams, type EvaluationListEvaluatorsParams as EvaluationListEvaluatorsParams, type EvaluationListJobRunsParams as EvaluationListJobRunsParams, };
123
- export { Call as Call, type CallCreateResponse as CallCreateResponse, type CallListResponse as CallListResponse, type CallGetByIDResponse as CallGetByIDResponse, type CallListEvaluationRunsResponse as CallListEvaluationRunsResponse, type CallListMetricsResponse as CallListMetricsResponse, type CallListSentimentRunsResponse as CallListSentimentRunsResponse, type CallCreateParams as CallCreateParams, type CallListParams as CallListParams, type CallListMetricsParams as CallListMetricsParams, };
124
- export { Metric as Metric, type MetricListDefinitionsResponse as MetricListDefinitionsResponse };
125
- export { Integrations as Integrations, type IntegrationCreateRetellCallResponse as IntegrationCreateRetellCallResponse, type IntegrationCreateVapiCallResponse as IntegrationCreateVapiCallResponse, type IntegrationCreateRetellCallParams as IntegrationCreateRetellCallParams, type IntegrationCreateVapiCallParams as IntegrationCreateVapiCallParams, };
126
- export { Simulation as Simulation, type SimulationGetRunPlanJobResponse as SimulationGetRunPlanJobResponse, type SimulationGetSimulationJobByIDResponse as SimulationGetSimulationJobByIDResponse, type SimulationListRunPlanJobsResponse as SimulationListRunPlanJobsResponse, type SimulationListScenariosResponse as SimulationListScenariosResponse, type SimulationLookupSimulationJobResponse as SimulationLookupSimulationJobResponse, type SimulationStartRunPlanJobResponse as SimulationStartRunPlanJobResponse, type SimulationListRunPlanJobsParams as SimulationListRunPlanJobsParams, type SimulationListScenariosParams as SimulationListScenariosParams, type SimulationLookupSimulationJobParams as SimulationLookupSimulationJobParams, };
127
- export { Persona as Persona, type PersonaCreateResponse as PersonaCreateResponse, type PersonaUpdateResponse as PersonaUpdateResponse, type PersonaListResponse as PersonaListResponse, type PersonaGetByIDResponse as PersonaGetByIDResponse, type PersonaCreateParams as PersonaCreateParams, type PersonaUpdateParams as PersonaUpdateParams, type PersonaListParams as PersonaListParams, };
128
- }
129
- export { toFile, fileFromPath } from "./uploads.js";
1
+ export { Roark as default } from "./client.js";
2
+ export { type Uploadable, toFile } from "./uploads.js";
3
+ export { APIPromise } from "./api-promise.js";
4
+ export { Roark, type ClientOptions } from "./client.js";
130
5
  export { RoarkError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.js";
131
- export default Roark;
132
6
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"OAEO,EAAE,KAAK,IAAI,OAAO,EAAE;OAEpB,EAAE,KAAK,UAAU,EAAE,MAAM,EAAE;OAC3B,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,EAAE,KAAK,aAAa,EAAE;OAC7B,EACL,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB"}
package/index.d.ts CHANGED
@@ -1,132 +1,6 @@
1
- import { type Agent } from "./_shims/index.js";
2
- import * as Core from "./core.js";
3
- import * as Errors from "./error.js";
4
- import * as Uploads from "./uploads.js";
5
- import * as API from "./resources/index.js";
6
- import { Call, CallCreateParams, CallCreateResponse, CallGetByIDResponse, CallListEvaluationRunsResponse, CallListMetricsParams, CallListMetricsResponse, CallListParams, CallListResponse, CallListSentimentRunsResponse } from "./resources/call.js";
7
- import { Evaluation, EvaluationCreateJobParams, EvaluationCreateJobResponse, EvaluationGetEvaluatorByIDResponse, EvaluationGetJobResponse, EvaluationListEvaluatorsParams, EvaluationListEvaluatorsResponse, EvaluationListJobRunsParams, EvaluationListJobRunsResponse } from "./resources/evaluation.js";
8
- import { Health, HealthGetResponse } from "./resources/health.js";
9
- import { IntegrationCreateRetellCallParams, IntegrationCreateRetellCallResponse, IntegrationCreateVapiCallParams, IntegrationCreateVapiCallResponse, Integrations } from "./resources/integrations.js";
10
- import { Metric, MetricListDefinitionsResponse } from "./resources/metric.js";
11
- import { Persona, PersonaCreateParams, PersonaCreateResponse, PersonaGetByIDResponse, PersonaListParams, PersonaListResponse, PersonaUpdateParams, PersonaUpdateResponse } from "./resources/persona.js";
12
- import { Simulation, SimulationGetRunPlanJobResponse, SimulationGetSimulationJobByIDResponse, SimulationListRunPlanJobsParams, SimulationListRunPlanJobsResponse, SimulationListScenariosParams, SimulationListScenariosResponse, SimulationLookupSimulationJobParams, SimulationLookupSimulationJobResponse, SimulationStartRunPlanJobResponse } from "./resources/simulation.js";
13
- export interface ClientOptions {
14
- /**
15
- * JWT token for authentication
16
- */
17
- bearerToken?: string | undefined;
18
- /**
19
- * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
20
- *
21
- * Defaults to process.env['ROARK_BASE_URL'].
22
- */
23
- baseURL?: string | null | undefined;
24
- /**
25
- * The maximum amount of time (in milliseconds) that the client should wait for a response
26
- * from the server before timing out a single request.
27
- *
28
- * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
29
- * much longer than this timeout before the promise succeeds or fails.
30
- *
31
- * @unit milliseconds
32
- */
33
- timeout?: number | undefined;
34
- /**
35
- * An HTTP agent used to manage HTTP(S) connections.
36
- *
37
- * If not provided, an agent will be constructed by default in the Node.js environment,
38
- * otherwise no agent is used.
39
- */
40
- httpAgent?: Agent | undefined;
41
- /**
42
- * Specify a custom `fetch` function implementation.
43
- *
44
- * If not provided, we use `node-fetch` on Node.js and otherwise expect that `fetch` is
45
- * defined globally.
46
- */
47
- fetch?: Core.Fetch | undefined;
48
- /**
49
- * The maximum number of times that the client will retry a request in case of a
50
- * temporary failure, like a network error or a 5XX error from the server.
51
- *
52
- * @default 2
53
- */
54
- maxRetries?: number | undefined;
55
- /**
56
- * Default headers to include with every request to the API.
57
- *
58
- * These can be removed in individual requests by explicitly setting the
59
- * header to `undefined` or `null` in request options.
60
- */
61
- defaultHeaders?: Core.Headers | undefined;
62
- /**
63
- * Default query parameters to include with every request to the API.
64
- *
65
- * These can be removed in individual requests by explicitly setting the
66
- * param to `undefined` in request options.
67
- */
68
- defaultQuery?: Core.DefaultQuery | undefined;
69
- }
70
- /**
71
- * API Client for interfacing with the Roark API.
72
- */
73
- export declare class Roark extends Core.APIClient {
74
- #private;
75
- bearerToken: string;
76
- private _options;
77
- /**
78
- * API Client for interfacing with the Roark API.
79
- *
80
- * @param {string | undefined} [opts.bearerToken=process.env['ROARK_API_BEARER_TOKEN'] ?? undefined]
81
- * @param {string} [opts.baseURL=process.env['ROARK_BASE_URL'] ?? https://api.roark.ai] - Override the default base URL for the API.
82
- * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
83
- * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
84
- * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
85
- * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
86
- * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
87
- * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
88
- */
89
- constructor({ baseURL, bearerToken, ...opts }?: ClientOptions);
90
- health: API.Health;
91
- evaluation: API.Evaluation;
92
- call: API.Call;
93
- metric: API.Metric;
94
- integrations: API.Integrations;
95
- simulation: API.Simulation;
96
- persona: API.Persona;
97
- protected defaultQuery(): Core.DefaultQuery | undefined;
98
- protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;
99
- protected authHeaders(opts: Core.FinalRequestOptions): Core.Headers;
100
- protected stringifyQuery(query: Record<string, unknown>): string;
101
- static Roark: typeof Roark;
102
- static DEFAULT_TIMEOUT: number;
103
- static RoarkError: typeof Errors.RoarkError;
104
- static APIError: typeof Errors.APIError;
105
- static APIConnectionError: typeof Errors.APIConnectionError;
106
- static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
107
- static APIUserAbortError: typeof Errors.APIUserAbortError;
108
- static NotFoundError: typeof Errors.NotFoundError;
109
- static ConflictError: typeof Errors.ConflictError;
110
- static RateLimitError: typeof Errors.RateLimitError;
111
- static BadRequestError: typeof Errors.BadRequestError;
112
- static AuthenticationError: typeof Errors.AuthenticationError;
113
- static InternalServerError: typeof Errors.InternalServerError;
114
- static PermissionDeniedError: typeof Errors.PermissionDeniedError;
115
- static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
116
- static toFile: typeof Uploads.toFile;
117
- static fileFromPath: typeof Uploads.fileFromPath;
118
- }
119
- export declare namespace Roark {
120
- export type RequestOptions = Core.RequestOptions;
121
- export { Health as Health, type HealthGetResponse as HealthGetResponse };
122
- export { Evaluation as Evaluation, type EvaluationCreateJobResponse as EvaluationCreateJobResponse, type EvaluationGetEvaluatorByIDResponse as EvaluationGetEvaluatorByIDResponse, type EvaluationGetJobResponse as EvaluationGetJobResponse, type EvaluationListEvaluatorsResponse as EvaluationListEvaluatorsResponse, type EvaluationListJobRunsResponse as EvaluationListJobRunsResponse, type EvaluationCreateJobParams as EvaluationCreateJobParams, type EvaluationListEvaluatorsParams as EvaluationListEvaluatorsParams, type EvaluationListJobRunsParams as EvaluationListJobRunsParams, };
123
- export { Call as Call, type CallCreateResponse as CallCreateResponse, type CallListResponse as CallListResponse, type CallGetByIDResponse as CallGetByIDResponse, type CallListEvaluationRunsResponse as CallListEvaluationRunsResponse, type CallListMetricsResponse as CallListMetricsResponse, type CallListSentimentRunsResponse as CallListSentimentRunsResponse, type CallCreateParams as CallCreateParams, type CallListParams as CallListParams, type CallListMetricsParams as CallListMetricsParams, };
124
- export { Metric as Metric, type MetricListDefinitionsResponse as MetricListDefinitionsResponse };
125
- export { Integrations as Integrations, type IntegrationCreateRetellCallResponse as IntegrationCreateRetellCallResponse, type IntegrationCreateVapiCallResponse as IntegrationCreateVapiCallResponse, type IntegrationCreateRetellCallParams as IntegrationCreateRetellCallParams, type IntegrationCreateVapiCallParams as IntegrationCreateVapiCallParams, };
126
- export { Simulation as Simulation, type SimulationGetRunPlanJobResponse as SimulationGetRunPlanJobResponse, type SimulationGetSimulationJobByIDResponse as SimulationGetSimulationJobByIDResponse, type SimulationListRunPlanJobsResponse as SimulationListRunPlanJobsResponse, type SimulationListScenariosResponse as SimulationListScenariosResponse, type SimulationLookupSimulationJobResponse as SimulationLookupSimulationJobResponse, type SimulationStartRunPlanJobResponse as SimulationStartRunPlanJobResponse, type SimulationListRunPlanJobsParams as SimulationListRunPlanJobsParams, type SimulationListScenariosParams as SimulationListScenariosParams, type SimulationLookupSimulationJobParams as SimulationLookupSimulationJobParams, };
127
- export { Persona as Persona, type PersonaCreateResponse as PersonaCreateResponse, type PersonaUpdateResponse as PersonaUpdateResponse, type PersonaListResponse as PersonaListResponse, type PersonaGetByIDResponse as PersonaGetByIDResponse, type PersonaCreateParams as PersonaCreateParams, type PersonaUpdateParams as PersonaUpdateParams, type PersonaListParams as PersonaListParams, };
128
- }
129
- export { toFile, fileFromPath } from "./uploads.js";
1
+ export { Roark as default } from "./client.js";
2
+ export { type Uploadable, toFile } from "./uploads.js";
3
+ export { APIPromise } from "./api-promise.js";
4
+ export { Roark, type ClientOptions } from "./client.js";
130
5
  export { RoarkError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.js";
131
- export default Roark;
132
6
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAEA,OAAO,E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CACH;AAED,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EACL,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAEjB,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"OAEO,EAAE,KAAK,IAAI,OAAO,EAAE;OAEpB,EAAE,KAAK,UAAU,EAAE,MAAM,EAAE;OAC3B,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,EAAE,KAAK,aAAa,EAAE;OAC7B,EACL,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB"}
package/index.js CHANGED
@@ -1,134 +1,18 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || function (mod) {
20
- if (mod && mod.__esModule) return mod;
21
- var result = {};
22
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
- __setModuleDefault(result, mod);
24
- return result;
25
- };
26
- var _Roark_instances, _a, _Roark_baseURLOverridden;
27
- Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.UnprocessableEntityError = exports.PermissionDeniedError = exports.InternalServerError = exports.AuthenticationError = exports.BadRequestError = exports.RateLimitError = exports.ConflictError = exports.NotFoundError = exports.APIUserAbortError = exports.APIConnectionTimeoutError = exports.APIConnectionError = exports.APIError = exports.RoarkError = exports.fileFromPath = exports.toFile = exports.Roark = void 0;
29
- const qs = __importStar(require("./internal/qs/index.js"));
30
- const Core = __importStar(require("./core.js"));
31
- const Errors = __importStar(require("./error.js"));
32
- const Uploads = __importStar(require("./uploads.js"));
33
- const API = __importStar(require("./resources/index.js"));
34
- const call_1 = require("./resources/call.js");
35
- const evaluation_1 = require("./resources/evaluation.js");
36
- const health_1 = require("./resources/health.js");
37
- const integrations_1 = require("./resources/integrations.js");
38
- const metric_1 = require("./resources/metric.js");
39
- const persona_1 = require("./resources/persona.js");
40
- const simulation_1 = require("./resources/simulation.js");
41
- /**
42
- * API Client for interfacing with the Roark API.
43
- */
44
- class Roark extends Core.APIClient {
45
- /**
46
- * API Client for interfacing with the Roark API.
47
- *
48
- * @param {string | undefined} [opts.bearerToken=process.env['ROARK_API_BEARER_TOKEN'] ?? undefined]
49
- * @param {string} [opts.baseURL=process.env['ROARK_BASE_URL'] ?? https://api.roark.ai] - Override the default base URL for the API.
50
- * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
51
- * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
52
- * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
53
- * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
54
- * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
55
- * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
56
- */
57
- constructor({ baseURL = Core.readEnv('ROARK_BASE_URL'), bearerToken = Core.readEnv('ROARK_API_BEARER_TOKEN'), ...opts } = {}) {
58
- if (bearerToken === undefined) {
59
- throw new Errors.RoarkError("The ROARK_API_BEARER_TOKEN environment variable is missing or empty; either provide it, or instantiate the Roark client with an bearerToken option, like new Roark({ bearerToken: 'My Bearer Token' }).");
60
- }
61
- const options = {
62
- bearerToken,
63
- ...opts,
64
- baseURL: baseURL || `https://api.roark.ai`,
65
- };
66
- super({
67
- baseURL: options.baseURL,
68
- baseURLOverridden: baseURL ? baseURL !== 'https://api.roark.ai' : false,
69
- timeout: options.timeout ?? 60000 /* 1 minute */,
70
- httpAgent: options.httpAgent,
71
- maxRetries: options.maxRetries,
72
- fetch: options.fetch,
73
- });
74
- _Roark_instances.add(this);
75
- this.health = new API.Health(this);
76
- this.evaluation = new API.Evaluation(this);
77
- this.call = new API.Call(this);
78
- this.metric = new API.Metric(this);
79
- this.integrations = new API.Integrations(this);
80
- this.simulation = new API.Simulation(this);
81
- this.persona = new API.Persona(this);
82
- this._options = options;
83
- this.bearerToken = bearerToken;
84
- }
85
- defaultQuery() {
86
- return this._options.defaultQuery;
87
- }
88
- defaultHeaders(opts) {
89
- return {
90
- ...super.defaultHeaders(opts),
91
- ...this._options.defaultHeaders,
92
- };
93
- }
94
- authHeaders(opts) {
95
- return { Authorization: `Bearer ${this.bearerToken}` };
96
- }
97
- stringifyQuery(query) {
98
- return qs.stringify(query, { arrayFormat: 'comma' });
99
- }
3
+ exports = module.exports = function (...args) {
4
+ return new exports.default(...args)
100
5
  }
101
- exports.Roark = Roark;
102
- _a = Roark, _Roark_instances = new WeakSet(), _Roark_baseURLOverridden = function _Roark_baseURLOverridden() {
103
- return this.baseURL !== 'https://api.roark.ai';
104
- };
105
- Roark.Roark = _a;
106
- Roark.DEFAULT_TIMEOUT = 60000; // 1 minute
107
- Roark.RoarkError = Errors.RoarkError;
108
- Roark.APIError = Errors.APIError;
109
- Roark.APIConnectionError = Errors.APIConnectionError;
110
- Roark.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
111
- Roark.APIUserAbortError = Errors.APIUserAbortError;
112
- Roark.NotFoundError = Errors.NotFoundError;
113
- Roark.ConflictError = Errors.ConflictError;
114
- Roark.RateLimitError = Errors.RateLimitError;
115
- Roark.BadRequestError = Errors.BadRequestError;
116
- Roark.AuthenticationError = Errors.AuthenticationError;
117
- Roark.InternalServerError = Errors.InternalServerError;
118
- Roark.PermissionDeniedError = Errors.PermissionDeniedError;
119
- Roark.UnprocessableEntityError = Errors.UnprocessableEntityError;
120
- Roark.toFile = Uploads.toFile;
121
- Roark.fileFromPath = Uploads.fileFromPath;
122
- Roark.Health = health_1.Health;
123
- Roark.Evaluation = evaluation_1.Evaluation;
124
- Roark.Call = call_1.Call;
125
- Roark.Metric = metric_1.Metric;
126
- Roark.Integrations = integrations_1.Integrations;
127
- Roark.Simulation = simulation_1.Simulation;
128
- Roark.Persona = persona_1.Persona;
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.UnprocessableEntityError = exports.PermissionDeniedError = exports.InternalServerError = exports.AuthenticationError = exports.BadRequestError = exports.RateLimitError = exports.ConflictError = exports.NotFoundError = exports.APIUserAbortError = exports.APIConnectionTimeoutError = exports.APIConnectionError = exports.APIError = exports.RoarkError = exports.Roark = exports.APIPromise = exports.toFile = exports.default = void 0;
8
+ var client_1 = require("./client.js");
9
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return client_1.Roark; } });
129
10
  var uploads_1 = require("./uploads.js");
130
11
  Object.defineProperty(exports, "toFile", { enumerable: true, get: function () { return uploads_1.toFile; } });
131
- Object.defineProperty(exports, "fileFromPath", { enumerable: true, get: function () { return uploads_1.fileFromPath; } });
12
+ var api_promise_1 = require("./api-promise.js");
13
+ Object.defineProperty(exports, "APIPromise", { enumerable: true, get: function () { return api_promise_1.APIPromise; } });
14
+ var client_2 = require("./client.js");
15
+ Object.defineProperty(exports, "Roark", { enumerable: true, get: function () { return client_2.Roark; } });
132
16
  var error_1 = require("./error.js");
133
17
  Object.defineProperty(exports, "RoarkError", { enumerable: true, get: function () { return error_1.RoarkError; } });
134
18
  Object.defineProperty(exports, "APIError", { enumerable: true, get: function () { return error_1.APIError; } });
@@ -143,6 +27,4 @@ Object.defineProperty(exports, "AuthenticationError", { enumerable: true, get: f
143
27
  Object.defineProperty(exports, "InternalServerError", { enumerable: true, get: function () { return error_1.InternalServerError; } });
144
28
  Object.defineProperty(exports, "PermissionDeniedError", { enumerable: true, get: function () { return error_1.PermissionDeniedError; } });
145
29
  Object.defineProperty(exports, "UnprocessableEntityError", { enumerable: true, get: function () { return error_1.UnprocessableEntityError; } });
146
- exports = module.exports = Roark;
147
- exports.default = Roark;
148
30
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtF,2DAAoC;AACpC,gDAA+B;AAC/B,mDAAkC;AAClC,sDAAqC;AACrC,0DAAyC;AACzC,8CAW0B;AAC1B,0DAUgC;AAChC,kDAA+D;AAC/D,8DAMkC;AAClC,kDAA2E;AAC3E,oDAS6B;AAC7B,0DAWgC;AAmEhC;;GAEG;AACH,MAAa,KAAM,SAAQ,IAAI,CAAC,SAAS;IAKvC;;;;;;;;;;;OAWG;IACH,YAAY,EACV,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,EACxC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,EACpD,GAAG,IAAI,KACU,EAAE;QACnB,IAAI,WAAW,KAAK,SAAS,EAAE;YAC7B,MAAM,IAAI,MAAM,CAAC,UAAU,CACzB,yMAAyM,CAC1M,CAAC;SACH;QAED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1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- var _Roark_instances, _a, _Roark_baseURLOverridden;
3
- import * as qs from "./internal/qs/index.mjs";
4
- import * as Core from "./core.mjs";
5
- import * as Errors from "./error.mjs";
6
- import * as Uploads from "./uploads.mjs";
7
- import * as API from "./resources/index.mjs";
8
- import { Call, } from "./resources/call.mjs";
9
- import { Evaluation, } from "./resources/evaluation.mjs";
10
- import { Health } from "./resources/health.mjs";
11
- import { Integrations, } from "./resources/integrations.mjs";
12
- import { Metric } from "./resources/metric.mjs";
13
- import { Persona, } from "./resources/persona.mjs";
14
- import { Simulation, } from "./resources/simulation.mjs";
15
- /**
16
- * API Client for interfacing with the Roark API.
17
- */
18
- export class Roark extends Core.APIClient {
19
- /**
20
- * API Client for interfacing with the Roark API.
21
- *
22
- * @param {string | undefined} [opts.bearerToken=process.env['ROARK_API_BEARER_TOKEN'] ?? undefined]
23
- * @param {string} [opts.baseURL=process.env['ROARK_BASE_URL'] ?? https://api.roark.ai] - Override the default base URL for the API.
24
- * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
25
- * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
26
- * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
27
- * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
28
- * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
29
- * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
30
- */
31
- constructor({ baseURL = Core.readEnv('ROARK_BASE_URL'), bearerToken = Core.readEnv('ROARK_API_BEARER_TOKEN'), ...opts } = {}) {
32
- if (bearerToken === undefined) {
33
- throw new Errors.RoarkError("The ROARK_API_BEARER_TOKEN environment variable is missing or empty; either provide it, or instantiate the Roark client with an bearerToken option, like new Roark({ bearerToken: 'My Bearer Token' }).");
34
- }
35
- const options = {
36
- bearerToken,
37
- ...opts,
38
- baseURL: baseURL || `https://api.roark.ai`,
39
- };
40
- super({
41
- baseURL: options.baseURL,
42
- baseURLOverridden: baseURL ? baseURL !== 'https://api.roark.ai' : false,
43
- timeout: options.timeout ?? 60000 /* 1 minute */,
44
- httpAgent: options.httpAgent,
45
- maxRetries: options.maxRetries,
46
- fetch: options.fetch,
47
- });
48
- _Roark_instances.add(this);
49
- this.health = new API.Health(this);
50
- this.evaluation = new API.Evaluation(this);
51
- this.call = new API.Call(this);
52
- this.metric = new API.Metric(this);
53
- this.integrations = new API.Integrations(this);
54
- this.simulation = new API.Simulation(this);
55
- this.persona = new API.Persona(this);
56
- this._options = options;
57
- this.bearerToken = bearerToken;
58
- }
59
- defaultQuery() {
60
- return this._options.defaultQuery;
61
- }
62
- defaultHeaders(opts) {
63
- return {
64
- ...super.defaultHeaders(opts),
65
- ...this._options.defaultHeaders,
66
- };
67
- }
68
- authHeaders(opts) {
69
- return { Authorization: `Bearer ${this.bearerToken}` };
70
- }
71
- stringifyQuery(query) {
72
- return qs.stringify(query, { arrayFormat: 'comma' });
73
- }
74
- }
75
- _a = Roark, _Roark_instances = new WeakSet(), _Roark_baseURLOverridden = function _Roark_baseURLOverridden() {
76
- return this.baseURL !== 'https://api.roark.ai';
77
- };
78
- Roark.Roark = _a;
79
- Roark.DEFAULT_TIMEOUT = 60000; // 1 minute
80
- Roark.RoarkError = Errors.RoarkError;
81
- Roark.APIError = Errors.APIError;
82
- Roark.APIConnectionError = Errors.APIConnectionError;
83
- Roark.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
84
- Roark.APIUserAbortError = Errors.APIUserAbortError;
85
- Roark.NotFoundError = Errors.NotFoundError;
86
- Roark.ConflictError = Errors.ConflictError;
87
- Roark.RateLimitError = Errors.RateLimitError;
88
- Roark.BadRequestError = Errors.BadRequestError;
89
- Roark.AuthenticationError = Errors.AuthenticationError;
90
- Roark.InternalServerError = Errors.InternalServerError;
91
- Roark.PermissionDeniedError = Errors.PermissionDeniedError;
92
- Roark.UnprocessableEntityError = Errors.UnprocessableEntityError;
93
- Roark.toFile = Uploads.toFile;
94
- Roark.fileFromPath = Uploads.fileFromPath;
95
- Roark.Health = Health;
96
- Roark.Evaluation = Evaluation;
97
- Roark.Call = Call;
98
- Roark.Metric = Metric;
99
- Roark.Integrations = Integrations;
100
- Roark.Simulation = Simulation;
101
- Roark.Persona = Persona;
102
- export { toFile, fileFromPath } from "./uploads.mjs";
2
+ export { Roark as default } from "./client.mjs";
3
+ export { toFile } from "./uploads.mjs";
4
+ export { APIPromise } from "./api-promise.mjs";
5
+ export { Roark } from "./client.mjs";
103
6
  export { RoarkError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.mjs";
104
- export default Roark;
105
7
  //# sourceMappingURL=index.mjs.map
package/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,KAAK,EAAE;OACP,KAAK,IAAI;OACT,KAAK,MAAM;OACX,KAAK,OAAO;OACZ,KAAK,GAAG;OACR,EACL,IAAI,GAUL;OACM,EACL,UAAU,GASX;OACM,EAAE,MAAM,EAAqB;OAC7B,EAKL,YAAY,GACb;OACM,EAAE,MAAM,EAAiC;OACzC,EACL,OAAO,GAQR;OACM,EACL,UAAU,GAUX;AAmED;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,IAAI,CAAC,SAAS;IAKvC;;;;;;;;;;;OAWG;IACH,YAAY,EACV,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,EACxC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,EACpD,GAAG,IAAI,KACU,EAAE;QACnB,IAAI,WAAW,KAAK,SAAS,EAAE;YAC7B,MAAM,IAAI,MAAM,CAAC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