@roarkanalytics/sdk 2.21.0 → 2.21.2

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 (502) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +112 -51
  3. package/api-promise.d.mts +2 -0
  4. package/api-promise.d.mts.map +1 -0
  5. package/api-promise.d.ts +2 -0
  6. package/api-promise.d.ts.map +1 -0
  7. package/api-promise.js +6 -0
  8. package/api-promise.js.map +1 -0
  9. package/api-promise.mjs +2 -0
  10. package/api-promise.mjs.map +1 -0
  11. package/client.d.mts +196 -0
  12. package/client.d.mts.map +1 -0
  13. package/client.d.ts +196 -0
  14. package/client.d.ts.map +1 -0
  15. package/client.js +472 -0
  16. package/client.js.map +1 -0
  17. package/client.mjs +468 -0
  18. package/client.mjs.map +1 -0
  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 +2 -0
  52. package/error.d.mts.map +1 -0
  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 -132
  60. package/index.d.mts.map +1 -0
  61. package/index.d.ts +5 -131
  62. package/index.d.ts.map +1 -1
  63. package/index.js +12 -130
  64. package/index.js.map +1 -1
  65. package/index.mjs +5 -103
  66. package/index.mjs.map +1 -1
  67. package/internal/builtin-types.d.mts +73 -0
  68. package/internal/builtin-types.d.mts.map +1 -0
  69. package/internal/builtin-types.d.ts +73 -0
  70. package/internal/builtin-types.d.ts.map +1 -0
  71. package/internal/builtin-types.js +4 -0
  72. package/internal/builtin-types.js.map +1 -0
  73. package/internal/builtin-types.mjs +3 -0
  74. package/internal/builtin-types.mjs.map +1 -0
  75. package/internal/detect-platform.d.mts +15 -0
  76. package/internal/detect-platform.d.mts.map +1 -0
  77. package/internal/detect-platform.d.ts +15 -0
  78. package/internal/detect-platform.d.ts.map +1 -0
  79. package/internal/detect-platform.js +162 -0
  80. package/internal/detect-platform.js.map +1 -0
  81. package/internal/detect-platform.mjs +157 -0
  82. package/internal/detect-platform.mjs.map +1 -0
  83. package/internal/errors.d.mts +3 -0
  84. package/internal/errors.d.mts.map +1 -0
  85. package/internal/errors.d.ts +3 -0
  86. package/internal/errors.d.ts.map +1 -0
  87. package/internal/errors.js +41 -0
  88. package/internal/errors.js.map +1 -0
  89. package/internal/errors.mjs +36 -0
  90. package/internal/errors.mjs.map +1 -0
  91. package/internal/headers.d.mts +20 -0
  92. package/internal/headers.d.mts.map +1 -0
  93. package/internal/headers.d.ts +20 -0
  94. package/internal/headers.d.ts.map +1 -0
  95. package/internal/headers.js +79 -0
  96. package/internal/headers.js.map +1 -0
  97. package/internal/headers.mjs +74 -0
  98. package/internal/headers.mjs.map +1 -0
  99. package/internal/parse.d.mts +12 -0
  100. package/internal/parse.d.mts.map +1 -0
  101. package/internal/parse.d.ts +12 -0
  102. package/internal/parse.d.ts.map +1 -0
  103. package/internal/parse.js +40 -0
  104. package/internal/parse.js.map +1 -0
  105. package/internal/parse.mjs +37 -0
  106. package/internal/parse.mjs.map +1 -0
  107. package/internal/qs/formats.d.mts +7 -0
  108. package/internal/qs/formats.d.mts.map +1 -0
  109. package/internal/qs/formats.d.ts +1 -0
  110. package/internal/qs/formats.d.ts.map +1 -1
  111. package/internal/qs/formats.js +4 -2
  112. package/internal/qs/formats.js.map +1 -1
  113. package/internal/qs/formats.mjs +2 -1
  114. package/internal/qs/formats.mjs.map +1 -1
  115. package/internal/qs/index.d.mts +10 -0
  116. package/internal/qs/index.d.mts.map +1 -0
  117. package/internal/qs/index.d.ts.map +1 -1
  118. package/internal/qs/stringify.d.mts +3 -0
  119. package/internal/qs/stringify.d.mts.map +1 -0
  120. package/internal/qs/stringify.d.ts.map +1 -1
  121. package/internal/qs/stringify.js +16 -19
  122. package/internal/qs/stringify.js.map +1 -1
  123. package/internal/qs/stringify.mjs +17 -19
  124. package/internal/qs/stringify.mjs.map +1 -1
  125. package/internal/qs/types.d.mts +57 -0
  126. package/internal/qs/types.d.mts.map +1 -0
  127. package/internal/qs/utils.d.mts +15 -0
  128. package/internal/qs/utils.d.mts.map +1 -0
  129. package/internal/qs/utils.d.ts +1 -0
  130. package/internal/qs/utils.d.ts.map +1 -1
  131. package/internal/qs/utils.js +22 -21
  132. package/internal/qs/utils.js.map +1 -1
  133. package/internal/qs/utils.mjs +12 -12
  134. package/internal/qs/utils.mjs.map +1 -1
  135. package/internal/request-options.d.mts +75 -0
  136. package/internal/request-options.d.mts.map +1 -0
  137. package/internal/request-options.d.ts +75 -0
  138. package/internal/request-options.d.ts.map +1 -0
  139. package/internal/request-options.js +14 -0
  140. package/internal/request-options.js.map +1 -0
  141. package/internal/request-options.mjs +10 -0
  142. package/internal/request-options.mjs.map +1 -0
  143. package/internal/shim-types.d.mts +17 -0
  144. package/internal/shim-types.d.mts.map +1 -0
  145. package/internal/shim-types.d.ts +17 -0
  146. package/internal/shim-types.d.ts.map +1 -0
  147. package/internal/shim-types.js +4 -0
  148. package/internal/shim-types.js.map +1 -0
  149. package/internal/shim-types.mjs +3 -0
  150. package/internal/shim-types.mjs.map +1 -0
  151. package/internal/shims.d.mts +20 -0
  152. package/internal/shims.d.mts.map +1 -0
  153. package/internal/shims.d.ts +20 -0
  154. package/internal/shims.d.ts.map +1 -0
  155. package/internal/shims.js +92 -0
  156. package/internal/shims.js.map +1 -0
  157. package/internal/shims.mjs +85 -0
  158. package/internal/shims.mjs.map +1 -0
  159. package/internal/to-file.d.mts +45 -0
  160. package/internal/to-file.d.mts.map +1 -0
  161. package/internal/to-file.d.ts +45 -0
  162. package/internal/to-file.d.ts.map +1 -0
  163. package/internal/to-file.js +91 -0
  164. package/internal/to-file.js.map +1 -0
  165. package/internal/to-file.mjs +88 -0
  166. package/internal/to-file.mjs.map +1 -0
  167. package/internal/tslib.js +81 -0
  168. package/internal/tslib.mjs +17 -0
  169. package/internal/types.d.mts +69 -0
  170. package/internal/types.d.mts.map +1 -0
  171. package/internal/types.d.ts +69 -0
  172. package/internal/types.d.ts.map +1 -0
  173. package/internal/types.js +4 -0
  174. package/internal/types.js.map +1 -0
  175. package/internal/types.mjs +3 -0
  176. package/internal/types.mjs.map +1 -0
  177. package/internal/uploads.d.mts +42 -0
  178. package/internal/uploads.d.mts.map +1 -0
  179. package/internal/uploads.d.ts +42 -0
  180. package/internal/uploads.d.ts.map +1 -0
  181. package/internal/uploads.js +141 -0
  182. package/internal/uploads.js.map +1 -0
  183. package/internal/uploads.mjs +131 -0
  184. package/internal/uploads.mjs.map +1 -0
  185. package/internal/utils/base64.d.mts +3 -0
  186. package/internal/utils/base64.d.mts.map +1 -0
  187. package/internal/utils/base64.d.ts +3 -0
  188. package/internal/utils/base64.d.ts.map +1 -0
  189. package/internal/utils/base64.js +38 -0
  190. package/internal/utils/base64.js.map +1 -0
  191. package/internal/utils/base64.mjs +33 -0
  192. package/internal/utils/base64.mjs.map +1 -0
  193. package/internal/utils/bytes.d.mts +4 -0
  194. package/internal/utils/bytes.d.mts.map +1 -0
  195. package/internal/utils/bytes.d.ts +4 -0
  196. package/internal/utils/bytes.d.ts.map +1 -0
  197. package/internal/utils/bytes.js +31 -0
  198. package/internal/utils/bytes.js.map +1 -0
  199. package/internal/utils/bytes.mjs +26 -0
  200. package/internal/utils/bytes.mjs.map +1 -0
  201. package/internal/utils/env.d.mts +9 -0
  202. package/internal/utils/env.d.mts.map +1 -0
  203. package/internal/utils/env.d.ts +9 -0
  204. package/internal/utils/env.d.ts.map +1 -0
  205. package/internal/utils/env.js +22 -0
  206. package/internal/utils/env.js.map +1 -0
  207. package/internal/utils/env.mjs +18 -0
  208. package/internal/utils/env.mjs.map +1 -0
  209. package/internal/utils/log.d.mts +37 -0
  210. package/internal/utils/log.d.mts.map +1 -0
  211. package/internal/utils/log.d.ts +37 -0
  212. package/internal/utils/log.d.ts.map +1 -0
  213. package/internal/utils/log.js +85 -0
  214. package/internal/utils/log.js.map +1 -0
  215. package/internal/utils/log.mjs +79 -0
  216. package/internal/utils/log.mjs.map +1 -0
  217. package/internal/utils/path.d.mts +15 -0
  218. package/internal/utils/path.d.mts.map +1 -0
  219. package/internal/utils/path.d.ts +15 -0
  220. package/internal/utils/path.d.ts.map +1 -0
  221. package/internal/utils/path.js +79 -0
  222. package/internal/utils/path.js.map +1 -0
  223. package/internal/utils/path.mjs +74 -0
  224. package/internal/utils/path.mjs.map +1 -0
  225. package/internal/utils/sleep.d.mts +2 -0
  226. package/internal/utils/sleep.d.mts.map +1 -0
  227. package/internal/utils/sleep.d.ts +2 -0
  228. package/internal/utils/sleep.d.ts.map +1 -0
  229. package/internal/utils/sleep.js +7 -0
  230. package/internal/utils/sleep.js.map +1 -0
  231. package/internal/utils/sleep.mjs +3 -0
  232. package/internal/utils/sleep.mjs.map +1 -0
  233. package/internal/utils/uuid.d.mts +5 -0
  234. package/internal/utils/uuid.d.mts.map +1 -0
  235. package/internal/utils/uuid.d.ts +5 -0
  236. package/internal/utils/uuid.d.ts.map +1 -0
  237. package/internal/utils/uuid.js +19 -0
  238. package/internal/utils/uuid.js.map +1 -0
  239. package/internal/utils/uuid.mjs +15 -0
  240. package/internal/utils/uuid.mjs.map +1 -0
  241. package/internal/utils/values.d.mts +18 -0
  242. package/internal/utils/values.d.mts.map +1 -0
  243. package/internal/utils/values.d.ts +18 -0
  244. package/internal/utils/values.d.ts.map +1 -0
  245. package/internal/utils/values.js +112 -0
  246. package/internal/utils/values.js.map +1 -0
  247. package/internal/utils/values.mjs +94 -0
  248. package/internal/utils/values.mjs.map +1 -0
  249. package/internal/utils.d.mts +7 -0
  250. package/internal/utils.d.mts.map +1 -0
  251. package/internal/utils.d.ts +7 -0
  252. package/internal/utils.d.ts.map +1 -0
  253. package/internal/utils.js +11 -0
  254. package/internal/utils.js.map +1 -0
  255. package/internal/utils.mjs +8 -0
  256. package/internal/utils.mjs.map +1 -0
  257. package/package.json +108 -73
  258. package/resource.d.mts +2 -0
  259. package/resource.d.mts.map +1 -0
  260. package/resource.d.ts +1 -5
  261. package/resource.d.ts.map +1 -1
  262. package/resource.js +3 -8
  263. package/resource.js.map +1 -1
  264. package/resource.mjs +1 -6
  265. package/resource.mjs.map +1 -1
  266. package/resources/call.d.mts +1207 -0
  267. package/resources/call.d.mts.map +1 -0
  268. package/resources/call.d.ts +9 -10
  269. package/resources/call.d.ts.map +1 -1
  270. package/resources/call.js +17 -16
  271. package/resources/call.js.map +1 -1
  272. package/resources/call.mjs +17 -16
  273. package/resources/call.mjs.map +1 -1
  274. package/resources/evaluation.d.mts +1307 -0
  275. package/resources/evaluation.d.mts.map +1 -0
  276. package/resources/evaluation.d.ts +8 -9
  277. package/resources/evaluation.d.ts.map +1 -1
  278. package/resources/evaluation.js +15 -14
  279. package/resources/evaluation.js.map +1 -1
  280. package/resources/evaluation.mjs +15 -14
  281. package/resources/evaluation.mjs.map +1 -1
  282. package/resources/health.d.mts +29 -0
  283. package/resources/health.d.mts.map +1 -0
  284. package/resources/health.d.ts +4 -3
  285. package/resources/health.d.ts.map +1 -1
  286. package/resources/health.js +1 -1
  287. package/resources/health.js.map +1 -1
  288. package/resources/health.mjs +1 -1
  289. package/resources/health.mjs.map +1 -1
  290. package/resources/index.d.mts +8 -0
  291. package/resources/index.d.mts.map +1 -0
  292. package/resources/index.d.ts.map +1 -1
  293. package/resources/integrations.d.mts +114 -0
  294. package/resources/integrations.d.mts.map +1 -0
  295. package/resources/integrations.d.ts +5 -4
  296. package/resources/integrations.d.ts.map +1 -1
  297. package/resources/integrations.js +1 -1
  298. package/resources/integrations.js.map +1 -1
  299. package/resources/integrations.mjs +1 -1
  300. package/resources/integrations.mjs.map +1 -1
  301. package/resources/metric.d.mts +75 -0
  302. package/resources/metric.d.mts.map +1 -0
  303. package/resources/metric.d.ts +4 -3
  304. package/resources/metric.d.ts.map +1 -1
  305. package/resources/metric.js +1 -1
  306. package/resources/metric.js.map +1 -1
  307. package/resources/metric.mjs +1 -1
  308. package/resources/metric.mjs.map +1 -1
  309. package/resources/persona.d.mts +528 -0
  310. package/resources/persona.d.mts.map +1 -0
  311. package/resources/persona.d.ts +8 -9
  312. package/resources/persona.d.ts.map +1 -1
  313. package/resources/persona.js +23 -13
  314. package/resources/persona.js.map +1 -1
  315. package/resources/persona.mjs +23 -13
  316. package/resources/persona.mjs.map +1 -1
  317. package/resources/simulation.d.mts +802 -0
  318. package/resources/simulation.d.mts.map +1 -0
  319. package/resources/simulation.d.ts +10 -11
  320. package/resources/simulation.d.ts.map +1 -1
  321. package/resources/simulation.js +26 -15
  322. package/resources/simulation.js.map +1 -1
  323. package/resources/simulation.mjs +26 -15
  324. package/resources/simulation.mjs.map +1 -1
  325. package/resources.d.mts +2 -0
  326. package/resources.d.mts.map +1 -0
  327. package/resources.d.ts.map +1 -1
  328. package/resources.js +2 -15
  329. package/resources.js.map +1 -1
  330. package/src/api-promise.ts +2 -0
  331. package/src/client.ts +842 -0
  332. package/src/core/README.md +3 -0
  333. package/src/core/api-promise.ts +92 -0
  334. package/src/core/error.ts +130 -0
  335. package/src/core/resource.ts +11 -0
  336. package/src/core/uploads.ts +2 -0
  337. package/src/error.ts +2 -130
  338. package/src/index.ts +5 -308
  339. package/src/internal/README.md +3 -0
  340. package/src/internal/builtin-types.ts +93 -0
  341. package/src/internal/detect-platform.ts +196 -0
  342. package/src/internal/errors.ts +33 -0
  343. package/src/internal/headers.ts +97 -0
  344. package/src/internal/parse.ts +56 -0
  345. package/src/internal/qs/formats.ts +2 -1
  346. package/src/internal/qs/stringify.ts +17 -20
  347. package/src/internal/qs/utils.ts +14 -14
  348. package/src/internal/request-options.ts +91 -0
  349. package/src/internal/shim-types.ts +26 -0
  350. package/src/internal/shims.ts +107 -0
  351. package/src/internal/to-file.ts +154 -0
  352. package/src/internal/types.ts +95 -0
  353. package/src/internal/uploads.ts +187 -0
  354. package/src/internal/utils/base64.ts +40 -0
  355. package/src/internal/utils/bytes.ts +32 -0
  356. package/src/internal/utils/env.ts +18 -0
  357. package/src/internal/utils/log.ts +126 -0
  358. package/src/internal/utils/path.ts +88 -0
  359. package/src/internal/utils/sleep.ts +3 -0
  360. package/src/internal/utils/uuid.ts +17 -0
  361. package/src/internal/utils/values.ts +105 -0
  362. package/src/internal/utils.ts +8 -0
  363. package/src/resource.ts +2 -11
  364. package/src/resources/call.ts +19 -38
  365. package/src/resources/evaluation.ts +21 -37
  366. package/src/resources/health.ts +4 -3
  367. package/src/resources/integrations.ts +7 -6
  368. package/src/resources/metric.ts +4 -3
  369. package/src/resources/persona.ts +16 -29
  370. package/src/resources/simulation.ts +22 -43
  371. package/src/tsconfig.json +2 -2
  372. package/src/uploads.ts +2 -255
  373. package/src/version.ts +1 -1
  374. package/uploads.d.mts +2 -0
  375. package/uploads.d.mts.map +1 -0
  376. package/uploads.d.ts +1 -74
  377. package/uploads.d.ts.map +1 -1
  378. package/uploads.js +3 -168
  379. package/uploads.js.map +1 -1
  380. package/uploads.mjs +1 -157
  381. package/uploads.mjs.map +1 -1
  382. package/version.d.mts +2 -0
  383. package/version.d.mts.map +1 -0
  384. package/version.d.ts +1 -1
  385. package/version.js +1 -1
  386. package/version.mjs +1 -1
  387. package/_shims/MultipartBody.d.ts +0 -9
  388. package/_shims/MultipartBody.d.ts.map +0 -1
  389. package/_shims/MultipartBody.js +0 -16
  390. package/_shims/MultipartBody.js.map +0 -1
  391. package/_shims/MultipartBody.mjs +0 -12
  392. package/_shims/MultipartBody.mjs.map +0 -1
  393. package/_shims/README.md +0 -46
  394. package/_shims/auto/runtime-bun.d.ts +0 -5
  395. package/_shims/auto/runtime-bun.d.ts.map +0 -1
  396. package/_shims/auto/runtime-bun.js +0 -21
  397. package/_shims/auto/runtime-bun.js.map +0 -1
  398. package/_shims/auto/runtime-bun.mjs +0 -2
  399. package/_shims/auto/runtime-bun.mjs.map +0 -1
  400. package/_shims/auto/runtime-node.d.ts +0 -5
  401. package/_shims/auto/runtime-node.d.ts.map +0 -1
  402. package/_shims/auto/runtime-node.js +0 -21
  403. package/_shims/auto/runtime-node.js.map +0 -1
  404. package/_shims/auto/runtime-node.mjs +0 -2
  405. package/_shims/auto/runtime-node.mjs.map +0 -1
  406. package/_shims/auto/runtime.d.ts +0 -5
  407. package/_shims/auto/runtime.d.ts.map +0 -1
  408. package/_shims/auto/runtime.js +0 -21
  409. package/_shims/auto/runtime.js.map +0 -1
  410. package/_shims/auto/runtime.mjs +0 -2
  411. package/_shims/auto/runtime.mjs.map +0 -1
  412. package/_shims/auto/types-node.d.ts +0 -5
  413. package/_shims/auto/types-node.d.ts.map +0 -1
  414. package/_shims/auto/types-node.js +0 -21
  415. package/_shims/auto/types-node.js.map +0 -1
  416. package/_shims/auto/types-node.mjs +0 -2
  417. package/_shims/auto/types-node.mjs.map +0 -1
  418. package/_shims/auto/types.d.ts +0 -101
  419. package/_shims/auto/types.js +0 -3
  420. package/_shims/auto/types.mjs +0 -3
  421. package/_shims/bun-runtime.d.ts +0 -6
  422. package/_shims/bun-runtime.d.ts.map +0 -1
  423. package/_shims/bun-runtime.js +0 -14
  424. package/_shims/bun-runtime.js.map +0 -1
  425. package/_shims/bun-runtime.mjs +0 -10
  426. package/_shims/bun-runtime.mjs.map +0 -1
  427. package/_shims/index.d.ts +0 -83
  428. package/_shims/index.js +0 -17
  429. package/_shims/index.mjs +0 -11
  430. package/_shims/manual-types.d.ts +0 -12
  431. package/_shims/manual-types.js +0 -3
  432. package/_shims/manual-types.mjs +0 -3
  433. package/_shims/node-runtime.d.ts +0 -3
  434. package/_shims/node-runtime.d.ts.map +0 -1
  435. package/_shims/node-runtime.js +0 -89
  436. package/_shims/node-runtime.js.map +0 -1
  437. package/_shims/node-runtime.mjs +0 -56
  438. package/_shims/node-runtime.mjs.map +0 -1
  439. package/_shims/node-types.d.ts +0 -42
  440. package/_shims/node-types.js +0 -3
  441. package/_shims/node-types.mjs +0 -3
  442. package/_shims/registry.d.ts +0 -37
  443. package/_shims/registry.d.ts.map +0 -1
  444. package/_shims/registry.js +0 -41
  445. package/_shims/registry.js.map +0 -1
  446. package/_shims/registry.mjs +0 -37
  447. package/_shims/registry.mjs.map +0 -1
  448. package/_shims/web-runtime.d.ts +0 -5
  449. package/_shims/web-runtime.d.ts.map +0 -1
  450. package/_shims/web-runtime.js +0 -78
  451. package/_shims/web-runtime.js.map +0 -1
  452. package/_shims/web-runtime.mjs +0 -71
  453. package/_shims/web-runtime.mjs.map +0 -1
  454. package/_shims/web-types.d.ts +0 -83
  455. package/_shims/web-types.js +0 -3
  456. package/_shims/web-types.mjs +0 -3
  457. package/core.d.ts +0 -255
  458. package/core.d.ts.map +0 -1
  459. package/core.js +0 -929
  460. package/core.js.map +0 -1
  461. package/core.mjs +0 -897
  462. package/core.mjs.map +0 -1
  463. package/shims/node.d.ts +0 -30
  464. package/shims/node.d.ts.map +0 -1
  465. package/shims/node.js +0 -31
  466. package/shims/node.js.map +0 -1
  467. package/shims/node.mjs +0 -5
  468. package/shims/node.mjs.map +0 -1
  469. package/shims/web.d.ts +0 -26
  470. package/shims/web.d.ts.map +0 -1
  471. package/shims/web.js +0 -31
  472. package/shims/web.js.map +0 -1
  473. package/shims/web.mjs +0 -5
  474. package/shims/web.mjs.map +0 -1
  475. package/src/_shims/MultipartBody.ts +0 -9
  476. package/src/_shims/README.md +0 -46
  477. package/src/_shims/auto/runtime-bun.ts +0 -4
  478. package/src/_shims/auto/runtime-node.ts +0 -4
  479. package/src/_shims/auto/runtime.ts +0 -4
  480. package/src/_shims/auto/types-node.ts +0 -4
  481. package/src/_shims/auto/types.d.ts +0 -101
  482. package/src/_shims/auto/types.js +0 -3
  483. package/src/_shims/auto/types.mjs +0 -3
  484. package/src/_shims/bun-runtime.ts +0 -14
  485. package/src/_shims/index.d.ts +0 -83
  486. package/src/_shims/index.js +0 -17
  487. package/src/_shims/index.mjs +0 -11
  488. package/src/_shims/manual-types.d.ts +0 -12
  489. package/src/_shims/manual-types.js +0 -3
  490. package/src/_shims/manual-types.mjs +0 -3
  491. package/src/_shims/node-runtime.ts +0 -81
  492. package/src/_shims/node-types.d.ts +0 -42
  493. package/src/_shims/node-types.js +0 -3
  494. package/src/_shims/node-types.mjs +0 -3
  495. package/src/_shims/registry.ts +0 -67
  496. package/src/_shims/web-runtime.ts +0 -103
  497. package/src/_shims/web-types.d.ts +0 -83
  498. package/src/_shims/web-types.js +0 -3
  499. package/src/_shims/web-types.mjs +0 -3
  500. package/src/core.ts +0 -1242
  501. package/src/shims/node.ts +0 -50
  502. package/src/shims/web.ts +0 -50
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.21.2 (2026-02-11)
4
+
5
+ Full Changelog: [v2.21.1...v2.21.2](https://github.com/roarkhq/sdk-roark-analytics-node/compare/v2.21.1...v2.21.2)
6
+
7
+ ### Chores
8
+
9
+ * **internal:** codegen related update ([6fb1d9f](https://github.com/roarkhq/sdk-roark-analytics-node/commit/6fb1d9fa50d1a5ca32c64b6a6f48e295eccbbaa9))
10
+
11
+ ## 2.21.1 (2026-02-10)
12
+
13
+ Full Changelog: [v2.21.0...v2.21.1](https://github.com/roarkhq/sdk-roark-analytics-node/compare/v2.21.0...v2.21.1)
14
+
15
+ ### Chores
16
+
17
+ * remove custom code ([ffba344](https://github.com/roarkhq/sdk-roark-analytics-node/commit/ffba3447da35dfe5e64906bda1b6290164981c4b))
18
+
3
19
  ## 2.21.0 (2026-02-10)
4
20
 
5
21
  Full Changelog: [v2.20.0...v2.21.0](https://github.com/roarkhq/sdk-roark-analytics-node/compare/v2.20.0...v2.21.0)
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Roark Node API Library
1
+ # Roark TypeScript API Library
2
2
 
3
- [![NPM version](https://img.shields.io/npm/v/@roarkanalytics/sdk.svg)](https://npmjs.org/package/@roarkanalytics/sdk) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@roarkanalytics/sdk)
3
+ [![NPM version](<https://img.shields.io/npm/v/@roarkanalytics/sdk.svg?label=npm%20(stable)>)](https://npmjs.org/package/@roarkanalytics/sdk) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@roarkanalytics/sdk)
4
4
 
5
5
  This library provides convenient access to the Roark REST API from server-side TypeScript or JavaScript.
6
6
 
@@ -8,15 +8,6 @@ The REST API documentation can be found on [docs.roark.ai](https://docs.roark.ai
8
8
 
9
9
  It is generated with [Stainless](https://www.stainless.com/).
10
10
 
11
- ## MCP Server
12
-
13
- Use the Roark MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
14
-
15
- [![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40roarkanalytics%2Fsdk-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkByb2Fya2FuYWx5dGljcy9zZGstbWNwIl0sImVudiI6eyJST0FSS19BUElfQkVBUkVSX1RPS0VOIjoiTXkgQmVhcmVyIFRva2VuIn19)
16
- [![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40roarkanalytics%2Fsdk-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40roarkanalytics%2Fsdk-mcp%22%5D%2C%22env%22%3A%7B%22ROARK_API_BEARER_TOKEN%22%3A%22My%20Bearer%20Token%22%7D%7D)
17
-
18
- > Note: You may need to set environment variables in your MCP client.
19
-
20
11
  ## Installation
21
12
 
22
13
  ```sh
@@ -139,8 +130,10 @@ Note that requests which time out will be [retried twice by default](#retries).
139
130
  ### Accessing raw Response data (e.g., headers)
140
131
 
141
132
  The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.
133
+ This method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.
142
134
 
143
135
  You can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.
136
+ Unlike `.asResponse()` this method consumes the body, returning once it is parsed.
144
137
 
145
138
  <!-- prettier-ignore -->
146
139
  ```ts
@@ -157,6 +150,59 @@ console.log(raw.headers.get('X-My-Header'));
157
150
  console.log(response.data);
158
151
  ```
159
152
 
153
+ ### Logging
154
+
155
+ > [!IMPORTANT]
156
+ > All log messages are intended for debugging only. The format and content of log messages
157
+ > may change between releases.
158
+
159
+ #### Log levels
160
+
161
+ The log level can be configured in two ways:
162
+
163
+ 1. Via the `ROARK_LOG` environment variable
164
+ 2. Using the `logLevel` client option (overrides the environment variable if set)
165
+
166
+ ```ts
167
+ import Roark from '@roarkanalytics/sdk';
168
+
169
+ const client = new Roark({
170
+ logLevel: 'debug', // Show all log messages
171
+ });
172
+ ```
173
+
174
+ Available log levels, from most to least verbose:
175
+
176
+ - `'debug'` - Show debug messages, info, warnings, and errors
177
+ - `'info'` - Show info messages, warnings, and errors
178
+ - `'warn'` - Show warnings and errors (default)
179
+ - `'error'` - Show only errors
180
+ - `'off'` - Disable all logging
181
+
182
+ At the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.
183
+ Some authentication-related headers are redacted, but sensitive data in request and response bodies
184
+ may still be visible.
185
+
186
+ #### Custom logger
187
+
188
+ By default, this library logs to `globalThis.console`. You can also provide a custom logger.
189
+ Most logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.
190
+
191
+ When providing a custom logger, the `logLevel` option still controls which messages are emitted, messages
192
+ below the configured level will not be sent to your logger.
193
+
194
+ ```ts
195
+ import Roark from '@roarkanalytics/sdk';
196
+ import pino from 'pino';
197
+
198
+ const logger = pino();
199
+
200
+ const client = new Roark({
201
+ logger: logger.child({ name: 'Roark' }),
202
+ logLevel: 'debug', // Send all messages to pino, allowing it to filter
203
+ });
204
+ ```
205
+
160
206
  ### Making custom/undocumented requests
161
207
 
162
208
  This library is typed for convenient access to the documented API. If you need to access undocumented
@@ -181,9 +227,8 @@ parameter. This library doesn't validate at runtime that the request matches the
181
227
  send will be sent as-is.
182
228
 
183
229
  ```ts
184
- client.foo.create({
185
- foo: 'my_param',
186
- bar: 12,
230
+ client.evaluation.createJob({
231
+ // ...
187
232
  // @ts-expect-error baz is not yet public
188
233
  baz: 'undocumented option',
189
234
  });
@@ -203,69 +248,85 @@ validate or strip extra properties from the response from the API.
203
248
 
204
249
  ### Customizing the fetch client
205
250
 
206
- By default, this library uses `node-fetch` in Node, and expects a global `fetch` function in other environments.
251
+ By default, this library expects a global `fetch` function is defined.
207
252
 
208
- If you would prefer to use a global, web-standards-compliant `fetch` function even in a Node environment,
209
- (for example, if you are running Node with `--experimental-fetch` or using NextJS which polyfills with `undici`),
210
- add the following import before your first import `from "Roark"`:
253
+ If you want to use a different `fetch` function, you can either polyfill the global:
211
254
 
212
255
  ```ts
213
- // Tell TypeScript and the package to use the global web fetch instead of node-fetch.
214
- // Note, despite the name, this does not add any polyfills, but expects them to be provided if needed.
215
- import '@roarkanalytics/sdk/shims/web';
216
- import Roark from '@roarkanalytics/sdk';
256
+ import fetch from 'my-fetch';
257
+
258
+ globalThis.fetch = fetch;
217
259
  ```
218
260
 
219
- To do the inverse, add `import "@roarkanalytics/sdk/shims/node"` (which does import polyfills).
220
- This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/roarkhq/sdk-roark-analytics-node/tree/main/src/_shims#readme)).
261
+ Or pass it to the client:
262
+
263
+ ```ts
264
+ import Roark from '@roarkanalytics/sdk';
265
+ import fetch from 'my-fetch';
266
+
267
+ const client = new Roark({ fetch });
268
+ ```
221
269
 
222
- ### Logging and middleware
270
+ ### Fetch options
223
271
 
224
- You may also provide a custom `fetch` function when instantiating the client,
225
- which can be used to inspect or alter the `Request` or `Response` before/after each request:
272
+ If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)
226
273
 
227
274
  ```ts
228
- import { fetch } from 'undici'; // as one example
229
275
  import Roark from '@roarkanalytics/sdk';
230
276
 
231
277
  const client = new Roark({
232
- fetch: async (url: RequestInfo, init?: RequestInit): Promise<Response> => {
233
- console.log('About to make a request', url, init);
234
- const response = await fetch(url, init);
235
- console.log('Got response', response);
236
- return response;
278
+ fetchOptions: {
279
+ // `RequestInit` options
237
280
  },
238
281
  });
239
282
  ```
240
283
 
241
- Note that if given a `DEBUG=true` environment variable, this library will log all requests and responses automatically.
242
- This is intended for debugging purposes only and may change in the future without notice.
284
+ #### Configuring proxies
243
285
 
244
- ### Configuring an HTTP(S) Agent (e.g., for proxies)
286
+ To modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy
287
+ options to requests:
245
288
 
246
- By default, this library uses a stable agent for all http/https requests to reuse TCP connections, eliminating many TCP & TLS handshakes and shaving around 100ms off most requests.
289
+ <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>
247
290
 
248
- If you would like to disable or customize this behavior, for example to use the API behind a proxy, you can pass an `httpAgent` which is used for all requests (be they http or https), for example:
291
+ ```ts
292
+ import Roark from '@roarkanalytics/sdk';
293
+ import * as undici from 'undici';
294
+
295
+ const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
296
+ const client = new Roark({
297
+ fetchOptions: {
298
+ dispatcher: proxyAgent,
299
+ },
300
+ });
301
+ ```
302
+
303
+ <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>
249
304
 
250
- <!-- prettier-ignore -->
251
305
  ```ts
252
- import http from 'http';
253
- import { HttpsProxyAgent } from 'https-proxy-agent';
306
+ import Roark from '@roarkanalytics/sdk';
254
307
 
255
- // Configure the default for all requests:
256
308
  const client = new Roark({
257
- httpAgent: new HttpsProxyAgent(process.env.PROXY_URL),
309
+ fetchOptions: {
310
+ proxy: 'http://localhost:8888',
311
+ },
258
312
  });
313
+ ```
259
314
 
260
- // Override per-request:
261
- await client.evaluation.createJob(
262
- { evaluators: ['string'] },
263
- {
264
- httpAgent: new http.Agent({ keepAlive: false }),
315
+ <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>
316
+
317
+ ```ts
318
+ import Roark from 'npm:@roarkanalytics/sdk';
319
+
320
+ const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
321
+ const client = new Roark({
322
+ fetchOptions: {
323
+ client: httpClient,
265
324
  },
266
- );
325
+ });
267
326
  ```
268
327
 
328
+ ## Frequently Asked Questions
329
+
269
330
  ## Semantic versioning
270
331
 
271
332
  This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
@@ -280,12 +341,12 @@ We are keen for your feedback; please open an [issue](https://www.github.com/roa
280
341
 
281
342
  ## Requirements
282
343
 
283
- TypeScript >= 4.5 is supported.
344
+ TypeScript >= 4.9 is supported.
284
345
 
285
346
  The following runtimes are supported:
286
347
 
287
348
  - Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)
288
- - Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
349
+ - Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
289
350
  - Deno v1.28.0 or higher.
290
351
  - Bun 1.0 or later.
291
352
  - Cloudflare Workers.
@@ -0,0 +1,2 @@
1
+ export * from "./core/api-promise.mjs";
2
+ //# sourceMappingURL=api-promise.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-promise.d.mts","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from "./core/api-promise.js";
2
+ //# sourceMappingURL=api-promise.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-promise.d.ts","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":""}
package/api-promise.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("./internal/tslib.js");
4
+ /** @deprecated Import from ./core/api-promise instead */
5
+ tslib_1.__exportStar(require("./core/api-promise.js"), exports);
6
+ //# sourceMappingURL=api-promise.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-promise.js","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AACzD,gEAAmC"}
@@ -0,0 +1,2 @@
1
+ export * from "./core/api-promise.mjs";
2
+ //# sourceMappingURL=api-promise.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-promise.mjs","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":""}
package/client.d.mts ADDED
@@ -0,0 +1,196 @@
1
+ import type { RequestInit, RequestInfo } from "./internal/builtin-types.mjs";
2
+ import type { PromiseOrValue, MergedRequestInit, FinalizedRequestInit } from "./internal/types.mjs";
3
+ export type { Logger, LogLevel } from "./internal/utils/log.mjs";
4
+ import * as Opts from "./internal/request-options.mjs";
5
+ import * as Errors from "./core/error.mjs";
6
+ import * as Uploads from "./core/uploads.mjs";
7
+ import * as API from "./resources/index.mjs";
8
+ import { APIPromise } from "./core/api-promise.mjs";
9
+ import { Call, CallCreateParams, CallCreateResponse, CallGetByIDResponse, CallListEvaluationRunsResponse, CallListMetricsParams, CallListMetricsResponse, CallListParams, CallListResponse, CallListSentimentRunsResponse } from "./resources/call.mjs";
10
+ import { Evaluation, EvaluationCreateJobParams, EvaluationCreateJobResponse, EvaluationGetEvaluatorByIDResponse, EvaluationGetJobResponse, EvaluationListEvaluatorsParams, EvaluationListEvaluatorsResponse, EvaluationListJobRunsParams, EvaluationListJobRunsResponse } from "./resources/evaluation.mjs";
11
+ import { Health, HealthGetResponse } from "./resources/health.mjs";
12
+ import { IntegrationCreateRetellCallParams, IntegrationCreateRetellCallResponse, IntegrationCreateVapiCallParams, IntegrationCreateVapiCallResponse, Integrations } from "./resources/integrations.mjs";
13
+ import { Metric, MetricListDefinitionsResponse } from "./resources/metric.mjs";
14
+ import { Persona, PersonaCreateParams, PersonaCreateResponse, PersonaGetByIDResponse, PersonaListParams, PersonaListResponse, PersonaUpdateParams, PersonaUpdateResponse } from "./resources/persona.mjs";
15
+ import { Simulation, SimulationGetRunPlanJobResponse, SimulationGetSimulationJobByIDResponse, SimulationListRunPlanJobsParams, SimulationListRunPlanJobsResponse, SimulationListScenariosParams, SimulationListScenariosResponse, SimulationLookupSimulationJobParams, SimulationLookupSimulationJobResponse, SimulationStartRunPlanJobResponse } from "./resources/simulation.mjs";
16
+ import { type Fetch } from "./internal/builtin-types.mjs";
17
+ import { HeadersLike, NullableHeaders } from "./internal/headers.mjs";
18
+ import { FinalRequestOptions, RequestOptions } from "./internal/request-options.mjs";
19
+ import { type LogLevel, type Logger } from "./internal/utils/log.mjs";
20
+ export interface ClientOptions {
21
+ /**
22
+ * JWT token for authentication
23
+ */
24
+ bearerToken?: string | undefined;
25
+ /**
26
+ * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
27
+ *
28
+ * Defaults to process.env['ROARK_BASE_URL'].
29
+ */
30
+ baseURL?: string | null | undefined;
31
+ /**
32
+ * The maximum amount of time (in milliseconds) that the client should wait for a response
33
+ * from the server before timing out a single request.
34
+ *
35
+ * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
36
+ * much longer than this timeout before the promise succeeds or fails.
37
+ *
38
+ * @unit milliseconds
39
+ */
40
+ timeout?: number | undefined;
41
+ /**
42
+ * Additional `RequestInit` options to be passed to `fetch` calls.
43
+ * Properties will be overridden by per-request `fetchOptions`.
44
+ */
45
+ fetchOptions?: MergedRequestInit | undefined;
46
+ /**
47
+ * Specify a custom `fetch` function implementation.
48
+ *
49
+ * If not provided, we expect that `fetch` is defined globally.
50
+ */
51
+ fetch?: Fetch | undefined;
52
+ /**
53
+ * The maximum number of times that the client will retry a request in case of a
54
+ * temporary failure, like a network error or a 5XX error from the server.
55
+ *
56
+ * @default 2
57
+ */
58
+ maxRetries?: number | undefined;
59
+ /**
60
+ * Default headers to include with every request to the API.
61
+ *
62
+ * These can be removed in individual requests by explicitly setting the
63
+ * header to `null` in request options.
64
+ */
65
+ defaultHeaders?: HeadersLike | undefined;
66
+ /**
67
+ * Default query parameters to include with every request to the API.
68
+ *
69
+ * These can be removed in individual requests by explicitly setting the
70
+ * param to `undefined` in request options.
71
+ */
72
+ defaultQuery?: Record<string, string | undefined> | undefined;
73
+ /**
74
+ * Set the log level.
75
+ *
76
+ * Defaults to process.env['ROARK_LOG'] or 'warn' if it isn't set.
77
+ */
78
+ logLevel?: LogLevel | undefined;
79
+ /**
80
+ * Set the logger.
81
+ *
82
+ * Defaults to globalThis.console.
83
+ */
84
+ logger?: Logger | undefined;
85
+ }
86
+ /**
87
+ * API Client for interfacing with the Roark API.
88
+ */
89
+ export declare class Roark {
90
+ #private;
91
+ bearerToken: string;
92
+ baseURL: string;
93
+ maxRetries: number;
94
+ timeout: number;
95
+ logger: Logger;
96
+ logLevel: LogLevel | undefined;
97
+ fetchOptions: MergedRequestInit | undefined;
98
+ private fetch;
99
+ protected idempotencyHeader?: string;
100
+ private _options;
101
+ /**
102
+ * API Client for interfacing with the Roark API.
103
+ *
104
+ * @param {string | undefined} [opts.bearerToken=process.env['ROARK_API_BEARER_TOKEN'] ?? undefined]
105
+ * @param {string} [opts.baseURL=process.env['ROARK_BASE_URL'] ?? https://api.roark.ai] - Override the default base URL for the API.
106
+ * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
107
+ * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
108
+ * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
109
+ * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
110
+ * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.
111
+ * @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.
112
+ */
113
+ constructor({ baseURL, bearerToken, ...opts }?: ClientOptions);
114
+ /**
115
+ * Create a new client instance re-using the same options given to the current client with optional overriding.
116
+ */
117
+ withOptions(options: Partial<ClientOptions>): this;
118
+ protected defaultQuery(): Record<string, string | undefined> | undefined;
119
+ protected validateHeaders({ values, nulls }: NullableHeaders): void;
120
+ protected authHeaders(opts: FinalRequestOptions): Promise<NullableHeaders | undefined>;
121
+ protected stringifyQuery(query: Record<string, unknown>): string;
122
+ private getUserAgent;
123
+ protected defaultIdempotencyKey(): string;
124
+ protected makeStatusError(status: number, error: Object, message: string | undefined, headers: Headers): Errors.APIError;
125
+ buildURL(path: string, query: Record<string, unknown> | null | undefined, defaultBaseURL?: string | undefined): string;
126
+ /**
127
+ * Used as a callback for mutating the given `FinalRequestOptions` object.
128
+ */
129
+ protected prepareOptions(options: FinalRequestOptions): Promise<void>;
130
+ /**
131
+ * Used as a callback for mutating the given `RequestInit` object.
132
+ *
133
+ * This is useful for cases where you want to add certain headers based off of
134
+ * the request properties, e.g. `method` or `url`.
135
+ */
136
+ protected prepareRequest(request: RequestInit, { url, options }: {
137
+ url: string;
138
+ options: FinalRequestOptions;
139
+ }): Promise<void>;
140
+ get<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
141
+ post<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
142
+ patch<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
143
+ put<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
144
+ delete<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
145
+ private methodRequest;
146
+ request<Rsp>(options: PromiseOrValue<FinalRequestOptions>, remainingRetries?: number | null): APIPromise<Rsp>;
147
+ private makeRequest;
148
+ fetchWithTimeout(url: RequestInfo, init: RequestInit | undefined, ms: number, controller: AbortController): Promise<Response>;
149
+ private shouldRetry;
150
+ private retryRequest;
151
+ private calculateDefaultRetryTimeoutMillis;
152
+ buildRequest(inputOptions: FinalRequestOptions, { retryCount }?: {
153
+ retryCount?: number;
154
+ }): Promise<{
155
+ req: FinalizedRequestInit;
156
+ url: string;
157
+ timeout: number;
158
+ }>;
159
+ private buildHeaders;
160
+ private _makeAbort;
161
+ private buildBody;
162
+ static Roark: typeof Roark;
163
+ static DEFAULT_TIMEOUT: number;
164
+ static RoarkError: typeof Errors.RoarkError;
165
+ static APIError: typeof Errors.APIError;
166
+ static APIConnectionError: typeof Errors.APIConnectionError;
167
+ static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
168
+ static APIUserAbortError: typeof Errors.APIUserAbortError;
169
+ static NotFoundError: typeof Errors.NotFoundError;
170
+ static ConflictError: typeof Errors.ConflictError;
171
+ static RateLimitError: typeof Errors.RateLimitError;
172
+ static BadRequestError: typeof Errors.BadRequestError;
173
+ static AuthenticationError: typeof Errors.AuthenticationError;
174
+ static InternalServerError: typeof Errors.InternalServerError;
175
+ static PermissionDeniedError: typeof Errors.PermissionDeniedError;
176
+ static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
177
+ static toFile: typeof Uploads.toFile;
178
+ health: API.Health;
179
+ evaluation: API.Evaluation;
180
+ call: API.Call;
181
+ metric: API.Metric;
182
+ integrations: API.Integrations;
183
+ simulation: API.Simulation;
184
+ persona: API.Persona;
185
+ }
186
+ export declare namespace Roark {
187
+ export type RequestOptions = Opts.RequestOptions;
188
+ export { Health as Health, type HealthGetResponse as HealthGetResponse };
189
+ 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, };
190
+ 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, };
191
+ export { Metric as Metric, type MetricListDefinitionsResponse as MetricListDefinitionsResponse };
192
+ export { Integrations as Integrations, type IntegrationCreateRetellCallResponse as IntegrationCreateRetellCallResponse, type IntegrationCreateVapiCallResponse as IntegrationCreateVapiCallResponse, type IntegrationCreateRetellCallParams as IntegrationCreateRetellCallParams, type IntegrationCreateVapiCallParams as IntegrationCreateVapiCallParams, };
193
+ 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, };
194
+ 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, };
195
+ }
196
+ //# sourceMappingURL=client.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.mts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAY;OAC3C,KAAK,EAAc,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE;YAIvE,EAAE,MAAM,EAAE,QAAQ,EAAE;OAKzB,KAAK,IAAI;OAGT,KAAK,MAAM;OACX,KAAK,OAAO;OACZ,KAAK,GAAG;OACR,EAAE,UAAU,EAAE;OACd,EACL,IAAI,EACJ,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,8BAA8B,EAC9B,qBAAqB,EACrB,uBAAuB,EACvB,cAAc,EACd,gBAAgB,EAChB,6BAA6B,EAC9B;OACM,EACL,UAAU,EACV,yBAAyB,EACzB,2BAA2B,E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