@tambo-ai/typescript-sdk 0.70.0 → 0.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (562) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +117 -48
  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/bin/cli +53 -0
  12. package/bin/migration-config.json +213 -0
  13. package/client.d.mts +213 -0
  14. package/client.d.mts.map +1 -0
  15. package/client.d.ts +213 -0
  16. package/client.d.ts.map +1 -0
  17. package/client.js +504 -0
  18. package/client.js.map +1 -0
  19. package/client.mjs +500 -0
  20. package/client.mjs.map +1 -0
  21. package/core/api-promise.d.mts +46 -0
  22. package/core/api-promise.d.mts.map +1 -0
  23. package/core/api-promise.d.ts +46 -0
  24. package/core/api-promise.d.ts.map +1 -0
  25. package/core/api-promise.js +74 -0
  26. package/core/api-promise.js.map +1 -0
  27. package/core/api-promise.mjs +70 -0
  28. package/core/api-promise.mjs.map +1 -0
  29. package/core/error.d.mts +46 -0
  30. package/core/error.d.mts.map +1 -0
  31. package/core/error.d.ts +46 -0
  32. package/core/error.d.ts.map +1 -0
  33. package/core/error.js +113 -0
  34. package/core/error.js.map +1 -0
  35. package/core/error.mjs +97 -0
  36. package/core/error.mjs.map +1 -0
  37. package/core/pagination.d.mts +56 -0
  38. package/core/pagination.d.mts.map +1 -0
  39. package/core/pagination.d.ts +56 -0
  40. package/core/pagination.d.ts.map +1 -0
  41. package/core/pagination.js +111 -0
  42. package/core/pagination.js.map +1 -0
  43. package/core/pagination.mjs +105 -0
  44. package/core/pagination.mjs.map +1 -0
  45. package/core/resource.d.mts +6 -0
  46. package/core/resource.d.mts.map +1 -0
  47. package/core/resource.d.ts +6 -0
  48. package/core/resource.d.ts.map +1 -0
  49. package/core/resource.js +11 -0
  50. package/core/resource.js.map +1 -0
  51. package/core/resource.mjs +7 -0
  52. package/core/resource.mjs.map +1 -0
  53. package/core/uploads.d.mts +3 -0
  54. package/core/uploads.d.mts.map +1 -0
  55. package/core/uploads.d.ts +3 -0
  56. package/core/uploads.d.ts.map +1 -0
  57. package/core/uploads.js +6 -0
  58. package/core/uploads.js.map +1 -0
  59. package/core/uploads.mjs +2 -0
  60. package/core/uploads.mjs.map +1 -0
  61. package/error.d.mts +2 -0
  62. package/error.d.mts.map +1 -0
  63. package/error.d.ts +1 -46
  64. package/error.d.ts.map +1 -1
  65. package/error.js +3 -110
  66. package/error.js.map +1 -1
  67. package/error.mjs +1 -96
  68. package/error.mjs.map +1 -1
  69. package/index.d.mts +8 -146
  70. package/index.d.mts.map +1 -0
  71. package/index.d.ts +6 -144
  72. package/index.d.ts.map +1 -1
  73. package/index.js +21 -155
  74. package/index.js.map +1 -1
  75. package/index.mjs +6 -121
  76. package/index.mjs.map +1 -1
  77. package/internal/builtin-types.d.mts +73 -0
  78. package/internal/builtin-types.d.mts.map +1 -0
  79. package/internal/builtin-types.d.ts +73 -0
  80. package/internal/builtin-types.d.ts.map +1 -0
  81. package/internal/builtin-types.js +4 -0
  82. package/internal/builtin-types.js.map +1 -0
  83. package/internal/builtin-types.mjs +3 -0
  84. package/internal/builtin-types.mjs.map +1 -0
  85. package/internal/detect-platform.d.mts +15 -0
  86. package/internal/detect-platform.d.mts.map +1 -0
  87. package/internal/detect-platform.d.ts +15 -0
  88. package/internal/detect-platform.d.ts.map +1 -0
  89. package/internal/detect-platform.js +162 -0
  90. package/internal/detect-platform.js.map +1 -0
  91. package/internal/detect-platform.mjs +157 -0
  92. package/internal/detect-platform.mjs.map +1 -0
  93. package/internal/errors.d.mts +3 -0
  94. package/internal/errors.d.mts.map +1 -0
  95. package/internal/errors.d.ts +3 -0
  96. package/internal/errors.d.ts.map +1 -0
  97. package/internal/errors.js +41 -0
  98. package/internal/errors.js.map +1 -0
  99. package/internal/errors.mjs +36 -0
  100. package/internal/errors.mjs.map +1 -0
  101. package/internal/headers.d.mts +20 -0
  102. package/internal/headers.d.mts.map +1 -0
  103. package/internal/headers.d.ts +20 -0
  104. package/internal/headers.d.ts.map +1 -0
  105. package/internal/headers.js +79 -0
  106. package/internal/headers.js.map +1 -0
  107. package/internal/headers.mjs +74 -0
  108. package/internal/headers.mjs.map +1 -0
  109. package/internal/parse.d.mts +12 -0
  110. package/internal/parse.d.mts.map +1 -0
  111. package/internal/parse.d.ts +12 -0
  112. package/internal/parse.d.ts.map +1 -0
  113. package/internal/parse.js +35 -0
  114. package/internal/parse.js.map +1 -0
  115. package/internal/parse.mjs +32 -0
  116. package/internal/parse.mjs.map +1 -0
  117. package/internal/request-options.d.mts +75 -0
  118. package/internal/request-options.d.mts.map +1 -0
  119. package/internal/request-options.d.ts +75 -0
  120. package/internal/request-options.d.ts.map +1 -0
  121. package/internal/request-options.js +14 -0
  122. package/internal/request-options.js.map +1 -0
  123. package/internal/request-options.mjs +10 -0
  124. package/internal/request-options.mjs.map +1 -0
  125. package/internal/shim-types.d.mts +17 -0
  126. package/internal/shim-types.d.mts.map +1 -0
  127. package/internal/shim-types.d.ts +17 -0
  128. package/internal/shim-types.d.ts.map +1 -0
  129. package/internal/shim-types.js +4 -0
  130. package/internal/shim-types.js.map +1 -0
  131. package/internal/shim-types.mjs +3 -0
  132. package/internal/shim-types.mjs.map +1 -0
  133. package/internal/shims.d.mts +20 -0
  134. package/internal/shims.d.mts.map +1 -0
  135. package/internal/shims.d.ts +20 -0
  136. package/internal/shims.d.ts.map +1 -0
  137. package/internal/shims.js +92 -0
  138. package/internal/shims.js.map +1 -0
  139. package/internal/shims.mjs +85 -0
  140. package/internal/shims.mjs.map +1 -0
  141. package/internal/to-file.d.mts +45 -0
  142. package/internal/to-file.d.mts.map +1 -0
  143. package/internal/to-file.d.ts +45 -0
  144. package/internal/to-file.d.ts.map +1 -0
  145. package/internal/to-file.js +91 -0
  146. package/internal/to-file.js.map +1 -0
  147. package/internal/to-file.mjs +88 -0
  148. package/internal/to-file.mjs.map +1 -0
  149. package/internal/tslib.js +81 -0
  150. package/internal/tslib.mjs +17 -0
  151. package/internal/types.d.mts +69 -0
  152. package/internal/types.d.mts.map +1 -0
  153. package/internal/types.d.ts +69 -0
  154. package/internal/types.d.ts.map +1 -0
  155. package/internal/types.js +4 -0
  156. package/internal/types.js.map +1 -0
  157. package/internal/types.mjs +3 -0
  158. package/internal/types.mjs.map +1 -0
  159. package/internal/uploads.d.mts +42 -0
  160. package/internal/uploads.d.mts.map +1 -0
  161. package/internal/uploads.d.ts +42 -0
  162. package/internal/uploads.d.ts.map +1 -0
  163. package/internal/uploads.js +141 -0
  164. package/internal/uploads.js.map +1 -0
  165. package/internal/uploads.mjs +131 -0
  166. package/internal/uploads.mjs.map +1 -0
  167. package/internal/utils/base64.d.mts +3 -0
  168. package/internal/utils/base64.d.mts.map +1 -0
  169. package/internal/utils/base64.d.ts +3 -0
  170. package/internal/utils/base64.d.ts.map +1 -0
  171. package/internal/utils/base64.js +38 -0
  172. package/internal/utils/base64.js.map +1 -0
  173. package/internal/utils/base64.mjs +33 -0
  174. package/internal/utils/base64.mjs.map +1 -0
  175. package/internal/utils/bytes.d.mts +4 -0
  176. package/internal/utils/bytes.d.mts.map +1 -0
  177. package/internal/utils/bytes.d.ts +4 -0
  178. package/internal/utils/bytes.d.ts.map +1 -0
  179. package/internal/utils/bytes.js +31 -0
  180. package/internal/utils/bytes.js.map +1 -0
  181. package/internal/utils/bytes.mjs +26 -0
  182. package/internal/utils/bytes.mjs.map +1 -0
  183. package/internal/utils/env.d.mts +9 -0
  184. package/internal/utils/env.d.mts.map +1 -0
  185. package/internal/utils/env.d.ts +9 -0
  186. package/internal/utils/env.d.ts.map +1 -0
  187. package/internal/utils/env.js +22 -0
  188. package/internal/utils/env.js.map +1 -0
  189. package/internal/utils/env.mjs +18 -0
  190. package/internal/utils/env.mjs.map +1 -0
  191. package/internal/utils/log.d.mts +37 -0
  192. package/internal/utils/log.d.mts.map +1 -0
  193. package/internal/utils/log.d.ts +37 -0
  194. package/internal/utils/log.d.ts.map +1 -0
  195. package/internal/utils/log.js +86 -0
  196. package/internal/utils/log.js.map +1 -0
  197. package/internal/utils/log.mjs +80 -0
  198. package/internal/utils/log.mjs.map +1 -0
  199. package/internal/utils/path.d.mts +15 -0
  200. package/internal/utils/path.d.mts.map +1 -0
  201. package/internal/utils/path.d.ts +15 -0
  202. package/internal/utils/path.d.ts.map +1 -0
  203. package/internal/utils/path.js +79 -0
  204. package/internal/utils/path.js.map +1 -0
  205. package/internal/utils/path.mjs +74 -0
  206. package/internal/utils/path.mjs.map +1 -0
  207. package/internal/utils/sleep.d.mts +2 -0
  208. package/internal/utils/sleep.d.mts.map +1 -0
  209. package/internal/utils/sleep.d.ts +2 -0
  210. package/internal/utils/sleep.d.ts.map +1 -0
  211. package/internal/utils/sleep.js +7 -0
  212. package/internal/utils/sleep.js.map +1 -0
  213. package/internal/utils/sleep.mjs +3 -0
  214. package/internal/utils/sleep.mjs.map +1 -0
  215. package/internal/utils/uuid.d.mts +5 -0
  216. package/internal/utils/uuid.d.mts.map +1 -0
  217. package/internal/utils/uuid.d.ts +5 -0
  218. package/internal/utils/uuid.d.ts.map +1 -0
  219. package/internal/utils/uuid.js +19 -0
  220. package/internal/utils/uuid.js.map +1 -0
  221. package/internal/utils/uuid.mjs +15 -0
  222. package/internal/utils/uuid.mjs.map +1 -0
  223. package/internal/utils/values.d.mts +18 -0
  224. package/internal/utils/values.d.mts.map +1 -0
  225. package/internal/utils/values.d.ts +18 -0
  226. package/internal/utils/values.d.ts.map +1 -0
  227. package/internal/utils/values.js +112 -0
  228. package/internal/utils/values.js.map +1 -0
  229. package/internal/utils/values.mjs +94 -0
  230. package/internal/utils/values.mjs.map +1 -0
  231. package/internal/utils.d.mts +7 -0
  232. package/internal/utils.d.mts.map +1 -0
  233. package/internal/utils.d.ts +7 -0
  234. package/internal/utils.d.ts.map +1 -0
  235. package/internal/utils.js +11 -0
  236. package/internal/utils.js.map +1 -0
  237. package/internal/utils.mjs +8 -0
  238. package/internal/utils.mjs.map +1 -0
  239. package/lib/advance-stream.d.mts +5 -0
  240. package/lib/advance-stream.d.mts.map +1 -0
  241. package/lib/advance-stream.d.ts +3 -3
  242. package/lib/advance-stream.d.ts.map +1 -1
  243. package/lib/advance-stream.js +1 -2
  244. package/lib/advance-stream.js.map +1 -1
  245. package/lib/advance-stream.mjs.map +1 -1
  246. package/package.json +123 -62
  247. package/pagination.d.mts +2 -0
  248. package/pagination.d.mts.map +1 -0
  249. package/pagination.d.ts +1 -19
  250. package/pagination.d.ts.map +1 -1
  251. package/pagination.js +3 -43
  252. package/pagination.js.map +1 -1
  253. package/pagination.mjs +1 -41
  254. package/pagination.mjs.map +1 -1
  255. package/resource.d.mts +2 -0
  256. package/resource.d.mts.map +1 -0
  257. package/resource.d.ts +1 -5
  258. package/resource.d.ts.map +1 -1
  259. package/resource.js +3 -8
  260. package/resource.js.map +1 -1
  261. package/resource.mjs +1 -6
  262. package/resource.mjs.map +1 -1
  263. package/resources/beta/auth.d.mts +103 -0
  264. package/resources/beta/auth.d.mts.map +1 -0
  265. package/resources/beta/auth.d.ts +5 -4
  266. package/resources/beta/auth.d.ts.map +1 -1
  267. package/resources/beta/auth.js +3 -2
  268. package/resources/beta/auth.js.map +1 -1
  269. package/resources/beta/auth.mjs +3 -2
  270. package/resources/beta/auth.mjs.map +1 -1
  271. package/resources/beta/beta.d.mts +22 -0
  272. package/resources/beta/beta.d.mts.map +1 -0
  273. package/resources/beta/beta.d.ts +2 -2
  274. package/resources/beta/beta.d.ts.map +1 -1
  275. package/resources/beta/beta.js +6 -29
  276. package/resources/beta/beta.js.map +1 -1
  277. package/resources/beta/beta.mjs +2 -3
  278. package/resources/beta/beta.mjs.map +1 -1
  279. package/resources/beta/index.d.mts +6 -0
  280. package/resources/beta/index.d.mts.map +1 -0
  281. package/resources/beta/index.d.ts +1 -1
  282. package/resources/beta/index.d.ts.map +1 -1
  283. package/resources/beta/index.js +1 -2
  284. package/resources/beta/index.js.map +1 -1
  285. package/resources/beta/index.mjs +1 -1
  286. package/resources/beta/index.mjs.map +1 -1
  287. package/resources/beta/projects/api-key.d.mts +43 -0
  288. package/resources/beta/projects/api-key.d.mts.map +1 -0
  289. package/resources/beta/projects/api-key.d.ts +10 -6
  290. package/resources/beta/projects/api-key.d.ts.map +1 -1
  291. package/resources/beta/projects/api-key.js +7 -5
  292. package/resources/beta/projects/api-key.js.map +1 -1
  293. package/resources/beta/projects/api-key.mjs +7 -5
  294. package/resources/beta/projects/api-key.mjs.map +1 -1
  295. package/resources/beta/projects/index.d.mts +4 -0
  296. package/resources/beta/projects/index.d.mts.map +1 -0
  297. package/resources/beta/projects/index.d.ts +2 -2
  298. package/resources/beta/projects/index.d.ts.map +1 -1
  299. package/resources/beta/projects/index.js.map +1 -1
  300. package/resources/beta/projects/index.mjs +2 -2
  301. package/resources/beta/projects/index.mjs.map +1 -1
  302. package/resources/beta/projects/projects.d.mts +71 -0
  303. package/resources/beta/projects/projects.d.mts.map +1 -0
  304. package/resources/beta/projects/projects.d.ts +10 -9
  305. package/resources/beta/projects/projects.d.ts.map +1 -1
  306. package/resources/beta/projects/projects.js +7 -28
  307. package/resources/beta/projects/projects.js.map +1 -1
  308. package/resources/beta/projects/projects.mjs +5 -4
  309. package/resources/beta/projects/projects.mjs.map +1 -1
  310. package/resources/beta/projects/provider-key.d.mts +44 -0
  311. package/resources/beta/projects/provider-key.d.mts.map +1 -0
  312. package/resources/beta/projects/provider-key.d.ts +10 -6
  313. package/resources/beta/projects/provider-key.d.ts.map +1 -1
  314. package/resources/beta/projects/provider-key.js +7 -5
  315. package/resources/beta/projects/provider-key.js.map +1 -1
  316. package/resources/beta/projects/provider-key.mjs +7 -5
  317. package/resources/beta/projects/provider-key.mjs.map +1 -1
  318. package/resources/beta/projects.d.mts +2 -0
  319. package/resources/beta/projects.d.mts.map +1 -0
  320. package/resources/beta/projects.d.ts.map +1 -1
  321. package/resources/beta/projects.js +2 -15
  322. package/resources/beta/projects.js.map +1 -1
  323. package/resources/beta/registry.d.mts +19 -0
  324. package/resources/beta/registry.d.mts.map +1 -0
  325. package/resources/beta/registry.d.ts +4 -3
  326. package/resources/beta/registry.d.ts.map +1 -1
  327. package/resources/beta/registry.js +3 -2
  328. package/resources/beta/registry.js.map +1 -1
  329. package/resources/beta/registry.mjs +3 -2
  330. package/resources/beta/registry.mjs.map +1 -1
  331. package/resources/beta/threads/index.d.mts +4 -0
  332. package/resources/beta/threads/index.d.mts.map +1 -0
  333. package/resources/beta/threads/index.d.ts +3 -3
  334. package/resources/beta/threads/index.d.ts.map +1 -1
  335. package/resources/beta/threads/index.js +1 -2
  336. package/resources/beta/threads/index.js.map +1 -1
  337. package/resources/beta/threads/index.mjs +1 -1
  338. package/resources/beta/threads/index.mjs.map +1 -1
  339. package/resources/beta/threads/messages.d.mts +108 -0
  340. package/resources/beta/threads/messages.d.mts.map +1 -0
  341. package/resources/beta/threads/messages.d.ts +22 -14
  342. package/resources/beta/threads/messages.d.ts.map +1 -1
  343. package/resources/beta/threads/messages.js +23 -18
  344. package/resources/beta/threads/messages.js.map +1 -1
  345. package/resources/beta/threads/messages.mjs +23 -18
  346. package/resources/beta/threads/messages.mjs.map +1 -1
  347. package/resources/beta/threads/suggestions.d.mts +92 -0
  348. package/resources/beta/threads/suggestions.d.mts.map +1 -0
  349. package/resources/beta/threads/suggestions.d.ts +20 -9
  350. package/resources/beta/threads/suggestions.d.ts.map +1 -1
  351. package/resources/beta/threads/suggestions.js +10 -7
  352. package/resources/beta/threads/suggestions.js.map +1 -1
  353. package/resources/beta/threads/suggestions.mjs +10 -7
  354. package/resources/beta/threads/suggestions.mjs.map +1 -1
  355. package/resources/beta/threads/threads.d.mts +383 -0
  356. package/resources/beta/threads/threads.d.mts.map +1 -0
  357. package/resources/beta/threads/threads.d.ts +20 -23
  358. package/resources/beta/threads/threads.d.ts.map +1 -1
  359. package/resources/beta/threads/threads.js +48 -54
  360. package/resources/beta/threads/threads.js.map +1 -1
  361. package/resources/beta/threads/threads.mjs +44 -27
  362. package/resources/beta/threads/threads.mjs.map +1 -1
  363. package/resources/beta/threads.d.mts +2 -0
  364. package/resources/beta/threads.d.mts.map +1 -0
  365. package/resources/beta/threads.d.ts.map +1 -1
  366. package/resources/beta/threads.js +2 -15
  367. package/resources/beta/threads.js.map +1 -1
  368. package/resources/beta.d.mts +2 -0
  369. package/resources/beta.d.mts.map +1 -0
  370. package/resources/beta.d.ts.map +1 -1
  371. package/resources/beta.js +2 -15
  372. package/resources/beta.js.map +1 -1
  373. package/resources/index.d.mts +3 -0
  374. package/resources/index.d.mts.map +1 -0
  375. package/resources/index.d.ts.map +1 -1
  376. package/resources/index.js +2 -15
  377. package/resources/index.js.map +1 -1
  378. package/resources/shared.d.mts +46 -0
  379. package/resources/shared.d.mts.map +1 -0
  380. package/resources.d.mts +2 -0
  381. package/resources.d.mts.map +1 -0
  382. package/resources.d.ts.map +1 -1
  383. package/resources.js +2 -15
  384. package/resources.js.map +1 -1
  385. package/src/api-promise.ts +2 -0
  386. package/src/client.ts +818 -0
  387. package/src/core/README.md +3 -0
  388. package/src/core/api-promise.ts +92 -0
  389. package/src/core/error.ts +130 -0
  390. package/src/core/pagination.ts +174 -0
  391. package/src/core/resource.ts +11 -0
  392. package/src/core/uploads.ts +2 -0
  393. package/src/error.ts +2 -130
  394. package/src/index.ts +12 -263
  395. package/src/internal/README.md +3 -0
  396. package/src/internal/builtin-types.ts +93 -0
  397. package/src/internal/detect-platform.ts +196 -0
  398. package/src/internal/errors.ts +33 -0
  399. package/src/internal/headers.ts +97 -0
  400. package/src/internal/parse.ts +50 -0
  401. package/src/internal/request-options.ts +91 -0
  402. package/src/internal/shim-types.ts +26 -0
  403. package/src/internal/shims.ts +107 -0
  404. package/src/internal/to-file.ts +154 -0
  405. package/src/internal/types.ts +95 -0
  406. package/src/internal/uploads.ts +187 -0
  407. package/src/internal/utils/base64.ts +40 -0
  408. package/src/internal/utils/bytes.ts +32 -0
  409. package/src/internal/utils/env.ts +18 -0
  410. package/src/internal/utils/log.ts +127 -0
  411. package/src/internal/utils/path.ts +88 -0
  412. package/src/internal/utils/sleep.ts +3 -0
  413. package/src/internal/utils/uuid.ts +17 -0
  414. package/src/internal/utils/values.ts +105 -0
  415. package/src/internal/utils.ts +8 -0
  416. package/src/lib/advance-stream.ts +5 -6
  417. package/src/pagination.ts +2 -73
  418. package/src/resource.ts +2 -11
  419. package/src/resources/beta/auth.ts +7 -8
  420. package/src/resources/beta/beta.ts +2 -3
  421. package/src/resources/beta/index.ts +1 -1
  422. package/src/resources/beta/projects/api-key.ts +23 -8
  423. package/src/resources/beta/projects/index.ts +12 -2
  424. package/src/resources/beta/projects/projects.ts +18 -9
  425. package/src/resources/beta/projects/provider-key.ts +18 -10
  426. package/src/resources/beta/registry.ts +6 -4
  427. package/src/resources/beta/threads/index.ts +3 -1
  428. package/src/resources/beta/threads/messages.ts +38 -33
  429. package/src/resources/beta/threads/suggestions.ts +33 -17
  430. package/src/resources/beta/threads/threads.ts +40 -62
  431. package/src/tsconfig.json +2 -1
  432. package/src/uploads.ts +2 -255
  433. package/src/version.ts +1 -1
  434. package/uploads.d.mts +2 -0
  435. package/uploads.d.mts.map +1 -0
  436. package/uploads.d.ts +1 -74
  437. package/uploads.d.ts.map +1 -1
  438. package/uploads.js +3 -168
  439. package/uploads.js.map +1 -1
  440. package/uploads.mjs +1 -157
  441. package/uploads.mjs.map +1 -1
  442. package/version.d.mts +2 -0
  443. package/version.d.mts.map +1 -0
  444. package/version.d.ts +1 -1
  445. package/version.js +1 -1
  446. package/version.mjs +1 -1
  447. package/_shims/MultipartBody.d.ts +0 -9
  448. package/_shims/MultipartBody.d.ts.map +0 -1
  449. package/_shims/MultipartBody.js +0 -16
  450. package/_shims/MultipartBody.js.map +0 -1
  451. package/_shims/MultipartBody.mjs +0 -12
  452. package/_shims/MultipartBody.mjs.map +0 -1
  453. package/_shims/README.md +0 -46
  454. package/_shims/auto/runtime-bun.d.ts +0 -5
  455. package/_shims/auto/runtime-bun.d.ts.map +0 -1
  456. package/_shims/auto/runtime-bun.js +0 -21
  457. package/_shims/auto/runtime-bun.js.map +0 -1
  458. package/_shims/auto/runtime-bun.mjs +0 -2
  459. package/_shims/auto/runtime-bun.mjs.map +0 -1
  460. package/_shims/auto/runtime-node.d.ts +0 -5
  461. package/_shims/auto/runtime-node.d.ts.map +0 -1
  462. package/_shims/auto/runtime-node.js +0 -21
  463. package/_shims/auto/runtime-node.js.map +0 -1
  464. package/_shims/auto/runtime-node.mjs +0 -2
  465. package/_shims/auto/runtime-node.mjs.map +0 -1
  466. package/_shims/auto/runtime.d.ts +0 -5
  467. package/_shims/auto/runtime.d.ts.map +0 -1
  468. package/_shims/auto/runtime.js +0 -21
  469. package/_shims/auto/runtime.js.map +0 -1
  470. package/_shims/auto/runtime.mjs +0 -2
  471. package/_shims/auto/runtime.mjs.map +0 -1
  472. package/_shims/auto/types-node.d.ts +0 -5
  473. package/_shims/auto/types-node.d.ts.map +0 -1
  474. package/_shims/auto/types-node.js +0 -21
  475. package/_shims/auto/types-node.js.map +0 -1
  476. package/_shims/auto/types-node.mjs +0 -2
  477. package/_shims/auto/types-node.mjs.map +0 -1
  478. package/_shims/auto/types.d.ts +0 -101
  479. package/_shims/auto/types.js +0 -3
  480. package/_shims/auto/types.mjs +0 -3
  481. package/_shims/bun-runtime.d.ts +0 -6
  482. package/_shims/bun-runtime.d.ts.map +0 -1
  483. package/_shims/bun-runtime.js +0 -14
  484. package/_shims/bun-runtime.js.map +0 -1
  485. package/_shims/bun-runtime.mjs +0 -10
  486. package/_shims/bun-runtime.mjs.map +0 -1
  487. package/_shims/index.d.ts +0 -83
  488. package/_shims/index.js +0 -17
  489. package/_shims/index.mjs +0 -11
  490. package/_shims/manual-types.d.ts +0 -12
  491. package/_shims/manual-types.js +0 -3
  492. package/_shims/manual-types.mjs +0 -3
  493. package/_shims/node-runtime.d.ts +0 -3
  494. package/_shims/node-runtime.d.ts.map +0 -1
  495. package/_shims/node-runtime.js +0 -89
  496. package/_shims/node-runtime.js.map +0 -1
  497. package/_shims/node-runtime.mjs +0 -56
  498. package/_shims/node-runtime.mjs.map +0 -1
  499. package/_shims/node-types.d.ts +0 -42
  500. package/_shims/node-types.js +0 -3
  501. package/_shims/node-types.mjs +0 -3
  502. package/_shims/registry.d.ts +0 -37
  503. package/_shims/registry.d.ts.map +0 -1
  504. package/_shims/registry.js +0 -41
  505. package/_shims/registry.js.map +0 -1
  506. package/_shims/registry.mjs +0 -37
  507. package/_shims/registry.mjs.map +0 -1
  508. package/_shims/web-runtime.d.ts +0 -5
  509. package/_shims/web-runtime.d.ts.map +0 -1
  510. package/_shims/web-runtime.js +0 -78
  511. package/_shims/web-runtime.js.map +0 -1
  512. package/_shims/web-runtime.mjs +0 -71
  513. package/_shims/web-runtime.mjs.map +0 -1
  514. package/_shims/web-types.d.ts +0 -83
  515. package/_shims/web-types.js +0 -3
  516. package/_shims/web-types.mjs +0 -3
  517. package/core.d.ts +0 -255
  518. package/core.d.ts.map +0 -1
  519. package/core.js +0 -924
  520. package/core.js.map +0 -1
  521. package/core.mjs +0 -892
  522. package/core.mjs.map +0 -1
  523. package/shims/node.d.ts +0 -30
  524. package/shims/node.d.ts.map +0 -1
  525. package/shims/node.js +0 -31
  526. package/shims/node.js.map +0 -1
  527. package/shims/node.mjs +0 -5
  528. package/shims/node.mjs.map +0 -1
  529. package/shims/web.d.ts +0 -26
  530. package/shims/web.d.ts.map +0 -1
  531. package/shims/web.js +0 -31
  532. package/shims/web.js.map +0 -1
  533. package/shims/web.mjs +0 -5
  534. package/shims/web.mjs.map +0 -1
  535. package/src/_shims/MultipartBody.ts +0 -9
  536. package/src/_shims/README.md +0 -46
  537. package/src/_shims/auto/runtime-bun.ts +0 -4
  538. package/src/_shims/auto/runtime-node.ts +0 -4
  539. package/src/_shims/auto/runtime.ts +0 -4
  540. package/src/_shims/auto/types-node.ts +0 -4
  541. package/src/_shims/auto/types.d.ts +0 -101
  542. package/src/_shims/auto/types.js +0 -3
  543. package/src/_shims/auto/types.mjs +0 -3
  544. package/src/_shims/bun-runtime.ts +0 -14
  545. package/src/_shims/index.d.ts +0 -83
  546. package/src/_shims/index.js +0 -17
  547. package/src/_shims/index.mjs +0 -11
  548. package/src/_shims/manual-types.d.ts +0 -12
  549. package/src/_shims/manual-types.js +0 -3
  550. package/src/_shims/manual-types.mjs +0 -3
  551. package/src/_shims/node-runtime.ts +0 -81
  552. package/src/_shims/node-types.d.ts +0 -42
  553. package/src/_shims/node-types.js +0 -3
  554. package/src/_shims/node-types.mjs +0 -3
  555. package/src/_shims/registry.ts +0 -67
  556. package/src/_shims/web-runtime.ts +0 -103
  557. package/src/_shims/web-types.d.ts +0 -83
  558. package/src/_shims/web-types.js +0 -3
  559. package/src/_shims/web-types.mjs +0 -3
  560. package/src/core.ts +0 -1236
  561. package/src/shims/node.ts +0 -50
  562. package/src/shims/web.ts +0 -50
package/src/pagination.ts CHANGED
@@ -1,73 +1,2 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { AbstractPage, Response, APIClient, FinalRequestOptions, PageInfo } from './core';
4
-
5
- export interface OffsetAndLimitResponse<Item> {
6
- items: Array<Item>;
7
-
8
- total: number;
9
-
10
- count: number;
11
- }
12
-
13
- export interface OffsetAndLimitParams {
14
- offset?: number;
15
-
16
- limit?: number;
17
- }
18
-
19
- export class OffsetAndLimit<Item> extends AbstractPage<Item> implements OffsetAndLimitResponse<Item> {
20
- items: Array<Item>;
21
-
22
- total: number;
23
-
24
- count: number;
25
-
26
- constructor(
27
- client: APIClient,
28
- response: Response,
29
- body: OffsetAndLimitResponse<Item>,
30
- options: FinalRequestOptions,
31
- ) {
32
- super(client, response, body, options);
33
-
34
- this.items = body.items || [];
35
- this.total = body.total || 0;
36
- this.count = body.count || 0;
37
- }
38
-
39
- getPaginatedItems(): Item[] {
40
- return this.items ?? [];
41
- }
42
-
43
- // @deprecated Please use `nextPageInfo()` instead
44
- nextPageParams(): Partial<OffsetAndLimitParams> | null {
45
- const info = this.nextPageInfo();
46
- if (!info) return null;
47
- if ('params' in info) return info.params;
48
- const params = Object.fromEntries(info.url.searchParams);
49
- if (!Object.keys(params).length) return null;
50
- return params;
51
- }
52
-
53
- nextPageInfo(): PageInfo | null {
54
- const offset = (this.options.query as OffsetAndLimitParams).offset ?? 0;
55
- if (!offset) {
56
- return null;
57
- }
58
-
59
- const length = this.getPaginatedItems().length;
60
- const currentCount = offset + length;
61
-
62
- const totalCount = this.total;
63
- if (!totalCount) {
64
- return null;
65
- }
66
-
67
- if (currentCount < totalCount) {
68
- return { params: { offset: currentCount } };
69
- }
70
-
71
- return null;
72
- }
73
- }
1
+ /** @deprecated Import from ./core/pagination instead */
2
+ export * from './core/pagination';
package/src/resource.ts CHANGED
@@ -1,11 +1,2 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import type { TamboAI } from './index';
4
-
5
- export abstract class APIResource {
6
- protected _client: TamboAI;
7
-
8
- constructor(client: TamboAI) {
9
- this._client = client;
10
- }
11
- }
1
+ /** @deprecated Import from ./core/resource instead */
2
+ export * from './core/resource';
@@ -1,7 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../resource';
4
- import * as Core from '../../core';
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { buildHeaders } from '../../internal/headers';
6
+ import { RequestOptions } from '../../internal/request-options';
5
7
 
6
8
  export class Auth extends APIResource {
7
9
  /**
@@ -15,10 +17,7 @@ export class Auth extends APIResource {
15
17
  * });
16
18
  * ```
17
19
  */
18
- getMcpToken(
19
- body: AuthGetMcpTokenParams,
20
- options?: Core.RequestOptions,
21
- ): Core.APIPromise<AuthGetMcpTokenResponse> {
20
+ getMcpToken(body: AuthGetMcpTokenParams, options?: RequestOptions): APIPromise<AuthGetMcpTokenResponse> {
22
21
  return this._client.post('/auth/mcp-access-token', { body, ...options });
23
22
  }
24
23
 
@@ -39,11 +38,11 @@ export class Auth extends APIResource {
39
38
  * });
40
39
  * ```
41
40
  */
42
- getToken(body: AuthGetTokenParams, options?: Core.RequestOptions): Core.APIPromise<AuthGetTokenResponse> {
41
+ getToken(body: AuthGetTokenParams, options?: RequestOptions): APIPromise<AuthGetTokenResponse> {
43
42
  return this._client.post('/oauth/token', {
44
43
  body,
45
44
  ...options,
46
- headers: { 'Content-Type': 'application/x-www-form-urlencoded', ...options?.headers },
45
+ headers: buildHeaders([{ 'Content-Type': 'application/x-www-form-urlencoded' }, options?.headers]),
47
46
  });
48
47
  }
49
48
  }
@@ -1,6 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../resource';
3
+ import { APIResource } from '../../core/resource';
4
4
  import * as AuthAPI from './auth';
5
5
  import {
6
6
  Auth,
@@ -48,7 +48,6 @@ export class Beta extends APIResource {
48
48
  Beta.Registry = Registry;
49
49
  Beta.Projects = Projects;
50
50
  Beta.Threads = Threads;
51
- Beta.ThreadsOffsetAndLimit = ThreadsOffsetAndLimit;
52
51
  Beta.Auth = Auth;
53
52
 
54
53
  export declare namespace Beta {
@@ -70,7 +69,7 @@ export declare namespace Beta {
70
69
  type ThreadRetrieveResponse as ThreadRetrieveResponse,
71
70
  type ThreadAdvanceResponse as ThreadAdvanceResponse,
72
71
  type ThreadAdvanceByIDResponse as ThreadAdvanceByIDResponse,
73
- ThreadsOffsetAndLimit as ThreadsOffsetAndLimit,
72
+ type ThreadsOffsetAndLimit as ThreadsOffsetAndLimit,
74
73
  type ThreadCreateParams as ThreadCreateParams,
75
74
  type ThreadRetrieveParams as ThreadRetrieveParams,
76
75
  type ThreadUpdateParams as ThreadUpdateParams,
@@ -16,7 +16,6 @@ export {
16
16
  } from './projects/index';
17
17
  export { Registry, type RegistryRetrieveResponse } from './registry';
18
18
  export {
19
- ThreadsOffsetAndLimit,
20
19
  Threads,
21
20
  type ChatCompletionContentPart,
22
21
  type ComponentDecisionV2,
@@ -32,4 +31,5 @@ export {
32
31
  type ThreadAdvanceParams,
33
32
  type ThreadAdvanceByIDParams,
34
33
  type ThreadGenerateNameParams,
34
+ type ThreadsOffsetAndLimit,
35
35
  } from './threads/index';
@@ -1,7 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../../resource';
4
- import * as Core from '../../../core';
3
+ import { APIResource } from '../../../core/resource';
4
+ import { APIPromise } from '../../../core/api-promise';
5
+ import { RequestOptions } from '../../../internal/request-options';
6
+ import { path } from '../../../internal/utils/path';
5
7
 
6
8
  export class APIKey extends APIResource {
7
9
  /**
@@ -12,21 +14,26 @@ export class APIKey extends APIResource {
12
14
  * );
13
15
  * ```
14
16
  */
15
- list(id: string, options?: Core.RequestOptions): Core.APIPromise<APIKeyListResponse> {
16
- return this._client.get(`/projects/${id}/api-keys`, options);
17
+ list(id: string, options?: RequestOptions): APIPromise<APIKeyListResponse> {
18
+ return this._client.get(path`/projects/${id}/api-keys`, options);
17
19
  }
18
20
 
19
21
  /**
20
22
  * @example
21
23
  * ```ts
22
24
  * const apiKey = await client.beta.projects.apiKey.delete(
23
- * 'id',
24
25
  * 'apiKeyId',
26
+ * { id: 'id' },
25
27
  * );
26
28
  * ```
27
29
  */
28
- delete(id: string, apiKeyId: string, options?: Core.RequestOptions): Core.APIPromise<APIKeyDeleteResponse> {
29
- return this._client.delete(`/projects/${id}/api-key/${apiKeyId}`, options);
30
+ delete(
31
+ apiKeyID: string,
32
+ params: APIKeyDeleteParams,
33
+ options?: RequestOptions,
34
+ ): APIPromise<APIKeyDeleteResponse> {
35
+ const { id } = params;
36
+ return this._client.delete(path`/projects/${id}/api-key/${apiKeyID}`, options);
30
37
  }
31
38
  }
32
39
 
@@ -50,6 +57,14 @@ export namespace APIKeyListResponse {
50
57
 
51
58
  export type APIKeyDeleteResponse = boolean;
52
59
 
60
+ export interface APIKeyDeleteParams {
61
+ id: string;
62
+ }
63
+
53
64
  export declare namespace APIKey {
54
- export { type APIKeyListResponse as APIKeyListResponse, type APIKeyDeleteResponse as APIKeyDeleteResponse };
65
+ export {
66
+ type APIKeyListResponse as APIKeyListResponse,
67
+ type APIKeyDeleteResponse as APIKeyDeleteResponse,
68
+ type APIKeyDeleteParams as APIKeyDeleteParams,
69
+ };
55
70
  }
@@ -1,10 +1,20 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- export { APIKey, type APIKeyListResponse, type APIKeyDeleteResponse } from './api-key';
3
+ export {
4
+ APIKey,
5
+ type APIKeyListResponse,
6
+ type APIKeyDeleteResponse,
7
+ type APIKeyDeleteParams,
8
+ } from './api-key';
4
9
  export {
5
10
  Projects,
6
11
  type ProjectRetrieveResponse,
7
12
  type ProjectDeleteResponse,
8
13
  type ProjectGetCurrentResponse,
9
14
  } from './projects';
10
- export { ProviderKey, type ProviderKeyListResponse, type ProviderKeyDeleteResponse } from './provider-key';
15
+ export {
16
+ ProviderKey,
17
+ type ProviderKeyListResponse,
18
+ type ProviderKeyDeleteResponse,
19
+ type ProviderKeyDeleteParams,
20
+ } from './provider-key';
@@ -1,11 +1,18 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../../resource';
4
- import * as Core from '../../../core';
3
+ import { APIResource } from '../../../core/resource';
5
4
  import * as APIKeyAPI from './api-key';
6
- import { APIKey, APIKeyDeleteResponse, APIKeyListResponse } from './api-key';
5
+ import { APIKey, APIKeyDeleteParams, APIKeyDeleteResponse, APIKeyListResponse } from './api-key';
7
6
  import * as ProviderKeyAPI from './provider-key';
8
- import { ProviderKey, ProviderKeyDeleteResponse, ProviderKeyListResponse } from './provider-key';
7
+ import {
8
+ ProviderKey,
9
+ ProviderKeyDeleteParams,
10
+ ProviderKeyDeleteResponse,
11
+ ProviderKeyListResponse,
12
+ } from './provider-key';
13
+ import { APIPromise } from '../../../core/api-promise';
14
+ import { RequestOptions } from '../../../internal/request-options';
15
+ import { path } from '../../../internal/utils/path';
9
16
 
10
17
  export class Projects extends APIResource {
11
18
  apiKey: APIKeyAPI.APIKey = new APIKeyAPI.APIKey(this._client);
@@ -17,8 +24,8 @@ export class Projects extends APIResource {
17
24
  * const project = await client.beta.projects.retrieve('id');
18
25
  * ```
19
26
  */
20
- retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<ProjectRetrieveResponse> {
21
- return this._client.get(`/projects/${id}`, options);
27
+ retrieve(id: string, options?: RequestOptions): APIPromise<ProjectRetrieveResponse> {
28
+ return this._client.get(path`/projects/${id}`, options);
22
29
  }
23
30
 
24
31
  /**
@@ -27,8 +34,8 @@ export class Projects extends APIResource {
27
34
  * const project = await client.beta.projects.delete('id');
28
35
  * ```
29
36
  */
30
- delete(id: string, options?: Core.RequestOptions): Core.APIPromise<ProjectDeleteResponse> {
31
- return this._client.delete(`/projects/${id}`, options);
37
+ delete(id: string, options?: RequestOptions): APIPromise<ProjectDeleteResponse> {
38
+ return this._client.delete(path`/projects/${id}`, options);
32
39
  }
33
40
 
34
41
  /**
@@ -37,7 +44,7 @@ export class Projects extends APIResource {
37
44
  * const response = await client.beta.projects.getCurrent();
38
45
  * ```
39
46
  */
40
- getCurrent(options?: Core.RequestOptions): Core.APIPromise<ProjectGetCurrentResponse> {
47
+ getCurrent(options?: RequestOptions): APIPromise<ProjectGetCurrentResponse> {
41
48
  return this._client.get('/projects', options);
42
49
  }
43
50
  }
@@ -118,11 +125,13 @@ export declare namespace Projects {
118
125
  APIKey as APIKey,
119
126
  type APIKeyListResponse as APIKeyListResponse,
120
127
  type APIKeyDeleteResponse as APIKeyDeleteResponse,
128
+ type APIKeyDeleteParams as APIKeyDeleteParams,
121
129
  };
122
130
 
123
131
  export {
124
132
  ProviderKey as ProviderKey,
125
133
  type ProviderKeyListResponse as ProviderKeyListResponse,
126
134
  type ProviderKeyDeleteResponse as ProviderKeyDeleteResponse,
135
+ type ProviderKeyDeleteParams as ProviderKeyDeleteParams,
127
136
  };
128
137
  }
@@ -1,7 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../../resource';
4
- import * as Core from '../../../core';
3
+ import { APIResource } from '../../../core/resource';
4
+ import { APIPromise } from '../../../core/api-promise';
5
+ import { RequestOptions } from '../../../internal/request-options';
6
+ import { path } from '../../../internal/utils/path';
5
7
 
6
8
  export class ProviderKey extends APIResource {
7
9
  /**
@@ -11,8 +13,8 @@ export class ProviderKey extends APIResource {
11
13
  * await client.beta.projects.providerKey.list('id');
12
14
  * ```
13
15
  */
14
- list(id: string, options?: Core.RequestOptions): Core.APIPromise<ProviderKeyListResponse> {
15
- return this._client.get(`/projects/${id}/provider-keys`, options);
16
+ list(id: string, options?: RequestOptions): APIPromise<ProviderKeyListResponse> {
17
+ return this._client.get(path`/projects/${id}/provider-keys`, options);
16
18
  }
17
19
 
18
20
  /**
@@ -20,17 +22,18 @@ export class ProviderKey extends APIResource {
20
22
  * ```ts
21
23
  * const providerKey =
22
24
  * await client.beta.projects.providerKey.delete(
23
- * 'id',
24
25
  * 'providerKeyId',
26
+ * { id: 'id' },
25
27
  * );
26
28
  * ```
27
29
  */
28
30
  delete(
29
- id: string,
30
- providerKeyId: string,
31
- options?: Core.RequestOptions,
32
- ): Core.APIPromise<ProviderKeyDeleteResponse> {
33
- return this._client.delete(`/projects/${id}/provider-key/${providerKeyId}`, options);
31
+ providerKeyID: string,
32
+ params: ProviderKeyDeleteParams,
33
+ options?: RequestOptions,
34
+ ): APIPromise<ProviderKeyDeleteResponse> {
35
+ const { id } = params;
36
+ return this._client.delete(path`/projects/${id}/provider-key/${providerKeyID}`, options);
34
37
  }
35
38
  }
36
39
 
@@ -54,9 +57,14 @@ export interface ProviderKeyDeleteResponse {
54
57
  name: string;
55
58
  }
56
59
 
60
+ export interface ProviderKeyDeleteParams {
61
+ id: string;
62
+ }
63
+
57
64
  export declare namespace ProviderKey {
58
65
  export {
59
66
  type ProviderKeyListResponse as ProviderKeyListResponse,
60
67
  type ProviderKeyDeleteResponse as ProviderKeyDeleteResponse,
68
+ type ProviderKeyDeleteParams as ProviderKeyDeleteParams,
61
69
  };
62
70
  }
@@ -1,7 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../resource';
4
- import * as Core from '../../core';
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { RequestOptions } from '../../internal/request-options';
6
+ import { path } from '../../internal/utils/path';
5
7
 
6
8
  export class Registry extends APIResource {
7
9
  /**
@@ -12,8 +14,8 @@ export class Registry extends APIResource {
12
14
  * );
13
15
  * ```
14
16
  */
15
- retrieve(componentname: string, options?: Core.RequestOptions): Core.APIPromise<unknown> {
16
- return this._client.get(`/registry/${componentname}`, options);
17
+ retrieve(componentname: string, options?: RequestOptions): APIPromise<unknown> {
18
+ return this._client.get(path`/registry/${componentname}`, options);
17
19
  }
18
20
  }
19
21
 
@@ -6,6 +6,7 @@ export {
6
6
  type MessageListResponse,
7
7
  type MessageCreateParams,
8
8
  type MessageListParams,
9
+ type MessageDeleteParams,
9
10
  type MessageUpdateComponentStateParams,
10
11
  } from './messages';
11
12
  export {
@@ -14,10 +15,10 @@ export {
14
15
  type SuggestionsGenerate,
15
16
  type SuggestionListResponse,
16
17
  type SuggestionGenerateResponse,
18
+ type SuggestionListParams,
17
19
  type SuggestionGenerateParams,
18
20
  } from './suggestions';
19
21
  export {
20
- ThreadsOffsetAndLimit,
21
22
  Threads,
22
23
  type ChatCompletionContentPart,
23
24
  type ComponentDecisionV2,
@@ -33,4 +34,5 @@ export {
33
34
  type ThreadAdvanceParams,
34
35
  type ThreadAdvanceByIDParams,
35
36
  type ThreadGenerateNameParams,
37
+ type ThreadsOffsetAndLimit,
36
38
  } from './threads';
@@ -1,10 +1,12 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../../resource';
4
- import { isRequestOptions } from '../../../core';
5
- import * as Core from '../../../core';
3
+ import { APIResource } from '../../../core/resource';
6
4
  import * as Shared from '../../shared';
7
5
  import * as ThreadsAPI from './threads';
6
+ import { APIPromise } from '../../../core/api-promise';
7
+ import { buildHeaders } from '../../../internal/headers';
8
+ import { RequestOptions } from '../../../internal/request-options';
9
+ import { path } from '../../../internal/utils/path';
8
10
 
9
11
  export class Messages extends APIResource {
10
12
  /**
@@ -16,8 +18,8 @@ export class Messages extends APIResource {
16
18
  * );
17
19
  * ```
18
20
  */
19
- create(id: string, body: MessageCreateParams, options?: Core.RequestOptions): Core.APIPromise<unknown> {
20
- return this._client.post(`/threads/${id}/messages`, { body, ...options });
21
+ create(id: string, body: MessageCreateParams, options?: RequestOptions): APIPromise<unknown> {
22
+ return this._client.post(path`/threads/${id}/messages`, { body, ...options });
21
23
  }
22
24
 
23
25
  /**
@@ -29,34 +31,25 @@ export class Messages extends APIResource {
29
31
  */
30
32
  list(
31
33
  id: string,
32
- query?: MessageListParams,
33
- options?: Core.RequestOptions,
34
- ): Core.APIPromise<MessageListResponse>;
35
- list(id: string, options?: Core.RequestOptions): Core.APIPromise<MessageListResponse>;
36
- list(
37
- id: string,
38
- query: MessageListParams | Core.RequestOptions = {},
39
- options?: Core.RequestOptions,
40
- ): Core.APIPromise<MessageListResponse> {
41
- if (isRequestOptions(query)) {
42
- return this.list(id, {}, query);
43
- }
44
- return this._client.get(`/threads/${id}/messages`, { query, ...options });
34
+ query: MessageListParams | null | undefined = {},
35
+ options?: RequestOptions,
36
+ ): APIPromise<MessageListResponse> {
37
+ return this._client.get(path`/threads/${id}/messages`, { query, ...options });
45
38
  }
46
39
 
47
40
  /**
48
41
  * @example
49
42
  * ```ts
50
- * await client.beta.threads.messages.delete(
51
- * 'id',
52
- * 'messageId',
53
- * );
43
+ * await client.beta.threads.messages.delete('messageId', {
44
+ * id: 'id',
45
+ * });
54
46
  * ```
55
47
  */
56
- delete(id: string, messageId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
57
- return this._client.delete(`/threads/${id}/messages/${messageId}`, {
48
+ delete(messageID: string, params: MessageDeleteParams, options?: RequestOptions): APIPromise<void> {
49
+ const { id } = params;
50
+ return this._client.delete(path`/threads/${id}/messages/${messageID}`, {
58
51
  ...options,
59
- headers: { Accept: '*/*', ...options?.headers },
52
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
60
53
  });
61
54
  }
62
55
 
@@ -65,19 +58,18 @@ export class Messages extends APIResource {
65
58
  * ```ts
66
59
  * const threadMessage =
67
60
  * await client.beta.threads.messages.updateComponentState(
68
- * 'id',
69
61
  * 'messageId',
70
- * { state: { foo: 'bar' } },
62
+ * { id: 'id', state: { foo: 'bar' } },
71
63
  * );
72
64
  * ```
73
65
  */
74
66
  updateComponentState(
75
- id: string,
76
- messageId: string,
77
- body: MessageUpdateComponentStateParams,
78
- options?: Core.RequestOptions,
79
- ): Core.APIPromise<ThreadsAPI.ThreadMessage> {
80
- return this._client.put(`/threads/${id}/messages/${messageId}/component-state`, { body, ...options });
67
+ messageID: string,
68
+ params: MessageUpdateComponentStateParams,
69
+ options?: RequestOptions,
70
+ ): APIPromise<ThreadsAPI.ThreadMessage> {
71
+ const { id, ...body } = params;
72
+ return this._client.put(path`/threads/${id}/messages/${messageID}/component-state`, { body, ...options });
81
73
  }
82
74
  }
83
75
 
@@ -134,7 +126,19 @@ export interface MessageListParams {
134
126
  includeInternal?: boolean;
135
127
  }
136
128
 
129
+ export interface MessageDeleteParams {
130
+ id: string;
131
+ }
132
+
137
133
  export interface MessageUpdateComponentStateParams {
134
+ /**
135
+ * Path param:
136
+ */
137
+ id: string;
138
+
139
+ /**
140
+ * Body param:
141
+ */
138
142
  state: { [key: string]: unknown };
139
143
  }
140
144
 
@@ -144,6 +148,7 @@ export declare namespace Messages {
144
148
  type MessageListResponse as MessageListResponse,
145
149
  type MessageCreateParams as MessageCreateParams,
146
150
  type MessageListParams as MessageListParams,
151
+ type MessageDeleteParams as MessageDeleteParams,
147
152
  type MessageUpdateComponentStateParams as MessageUpdateComponentStateParams,
148
153
  };
149
154
  }
@@ -1,8 +1,10 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../../resource';
4
- import * as Core from '../../../core';
3
+ import { APIResource } from '../../../core/resource';
5
4
  import * as Shared from '../../shared';
5
+ import { APIPromise } from '../../../core/api-promise';
6
+ import { RequestOptions } from '../../../internal/request-options';
7
+ import { path } from '../../../internal/utils/path';
6
8
 
7
9
  export class Suggestions extends APIResource {
8
10
  /**
@@ -12,17 +14,18 @@ export class Suggestions extends APIResource {
12
14
  * ```ts
13
15
  * const suggestions =
14
16
  * await client.beta.threads.suggestions.list(
15
- * 'thread_123456789',
16
17
  * 'msg_123456789',
18
+ * { id: 'thread_123456789' },
17
19
  * );
18
20
  * ```
19
21
  */
20
22
  list(
21
- id: string,
22
- messageId: string,
23
- options?: Core.RequestOptions,
24
- ): Core.APIPromise<SuggestionListResponse> {
25
- return this._client.get(`/threads/${id}/messages/${messageId}/suggestions`, options);
23
+ messageID: string,
24
+ params: SuggestionListParams,
25
+ options?: RequestOptions,
26
+ ): APIPromise<SuggestionListResponse> {
27
+ const { id } = params;
28
+ return this._client.get(path`/threads/${id}/messages/${messageID}/suggestions`, options);
26
29
  }
27
30
 
28
31
  /**
@@ -32,18 +35,18 @@ export class Suggestions extends APIResource {
32
35
  * ```ts
33
36
  * const suggestions =
34
37
  * await client.beta.threads.suggestions.generate(
35
- * 'thread_123456789',
36
38
  * 'msg_123456789',
39
+ * { id: 'thread_123456789' },
37
40
  * );
38
41
  * ```
39
42
  */
40
43
  generate(
41
- id: string,
42
- messageId: string,
43
- body: SuggestionGenerateParams,
44
- options?: Core.RequestOptions,
45
- ): Core.APIPromise<SuggestionGenerateResponse> {
46
- return this._client.post(`/threads/${id}/messages/${messageId}/suggestions`, { body, ...options });
44
+ messageID: string,
45
+ params: SuggestionGenerateParams,
46
+ options?: RequestOptions,
47
+ ): APIPromise<SuggestionGenerateResponse> {
48
+ const { id, ...body } = params;
49
+ return this._client.post(path`/threads/${id}/messages/${messageID}/suggestions`, { body, ...options });
47
50
  }
48
51
  }
49
52
 
@@ -90,14 +93,26 @@ export type SuggestionListResponse = Array<Suggestion>;
90
93
 
91
94
  export type SuggestionGenerateResponse = Array<Suggestion>;
92
95
 
96
+ export interface SuggestionListParams {
97
+ /**
98
+ * ID of the thread to get suggestions for
99
+ */
100
+ id: string;
101
+ }
102
+
93
103
  export interface SuggestionGenerateParams {
94
104
  /**
95
- * Available components that can be used with this suggestion
105
+ * Path param: ID of the thread to generate suggestions for
106
+ */
107
+ id: string;
108
+
109
+ /**
110
+ * Body param: Available components that can be used with this suggestion
96
111
  */
97
112
  availableComponents?: Array<Shared.AvailableComponent>;
98
113
 
99
114
  /**
100
- * Maximum number of suggestions to generate
115
+ * Body param: Maximum number of suggestions to generate
101
116
  */
102
117
  maxSuggestions?: number;
103
118
  }
@@ -108,6 +123,7 @@ export declare namespace Suggestions {
108
123
  type SuggestionsGenerate as SuggestionsGenerate,
109
124
  type SuggestionListResponse as SuggestionListResponse,
110
125
  type SuggestionGenerateResponse as SuggestionGenerateResponse,
126
+ type SuggestionListParams as SuggestionListParams,
111
127
  type SuggestionGenerateParams as SuggestionGenerateParams,
112
128
  };
113
129
  }