@lorikeetai/node-sdk 1.4.0 → 2.0.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 (640) hide show
  1. package/CHANGELOG.md +55 -713
  2. package/LICENSE +1 -1
  3. package/README.md +125 -49
  4. package/api-promise.d.mts +2 -0
  5. package/api-promise.d.mts.map +1 -0
  6. package/api-promise.d.ts +2 -0
  7. package/api-promise.d.ts.map +1 -0
  8. package/api-promise.js +6 -0
  9. package/api-promise.js.map +1 -0
  10. package/api-promise.mjs +2 -0
  11. package/api-promise.mjs.map +1 -0
  12. package/bin/cli +53 -0
  13. package/bin/migration-config.json +50 -0
  14. package/client.d.mts +197 -0
  15. package/client.d.mts.map +1 -0
  16. package/client.d.ts +197 -0
  17. package/client.d.ts.map +1 -0
  18. package/client.js +504 -0
  19. package/client.js.map +1 -0
  20. package/client.mjs +500 -0
  21. package/client.mjs.map +1 -0
  22. package/core/api-promise.d.mts +46 -0
  23. package/core/api-promise.d.mts.map +1 -0
  24. package/core/api-promise.d.ts +46 -0
  25. package/core/api-promise.d.ts.map +1 -0
  26. package/core/api-promise.js +74 -0
  27. package/core/api-promise.js.map +1 -0
  28. package/core/api-promise.mjs +70 -0
  29. package/core/api-promise.mjs.map +1 -0
  30. package/core/error.d.mts +46 -0
  31. package/core/error.d.mts.map +1 -0
  32. package/core/error.d.ts +46 -0
  33. package/core/error.d.ts.map +1 -0
  34. package/core/error.js +113 -0
  35. package/core/error.js.map +1 -0
  36. package/core/error.mjs +97 -0
  37. package/core/error.mjs.map +1 -0
  38. package/core/resource.d.mts +6 -0
  39. package/core/resource.d.mts.map +1 -0
  40. package/core/resource.d.ts +6 -0
  41. package/core/resource.d.ts.map +1 -0
  42. package/core/resource.js +11 -0
  43. package/core/resource.js.map +1 -0
  44. package/core/resource.mjs +7 -0
  45. package/core/resource.mjs.map +1 -0
  46. package/core/uploads.d.mts +3 -0
  47. package/core/uploads.d.mts.map +1 -0
  48. package/core/uploads.d.ts +3 -0
  49. package/core/uploads.d.ts.map +1 -0
  50. package/core/uploads.js +6 -0
  51. package/core/uploads.js.map +1 -0
  52. package/core/uploads.mjs +2 -0
  53. package/core/uploads.mjs.map +1 -0
  54. package/error.d.mts +2 -0
  55. package/error.d.mts.map +1 -0
  56. package/error.d.ts +1 -46
  57. package/error.d.ts.map +1 -1
  58. package/error.js +3 -110
  59. package/error.js.map +1 -1
  60. package/error.mjs +1 -96
  61. package/error.mjs.map +1 -1
  62. package/index.d.mts +7 -144
  63. package/index.d.mts.map +1 -0
  64. package/index.d.ts +6 -143
  65. package/index.d.ts.map +1 -1
  66. package/index.js +14 -157
  67. package/index.js.map +1 -1
  68. package/index.mjs +6 -129
  69. package/index.mjs.map +1 -1
  70. package/internal/builtin-types.d.mts +73 -0
  71. package/internal/builtin-types.d.mts.map +1 -0
  72. package/internal/builtin-types.d.ts +73 -0
  73. package/internal/builtin-types.d.ts.map +1 -0
  74. package/internal/builtin-types.js +4 -0
  75. package/internal/builtin-types.js.map +1 -0
  76. package/{src/resources/oauth.ts → internal/builtin-types.mjs} +2 -2
  77. package/internal/builtin-types.mjs.map +1 -0
  78. package/internal/detect-platform.d.mts +15 -0
  79. package/internal/detect-platform.d.mts.map +1 -0
  80. package/internal/detect-platform.d.ts +15 -0
  81. package/internal/detect-platform.d.ts.map +1 -0
  82. package/internal/detect-platform.js +162 -0
  83. package/internal/detect-platform.js.map +1 -0
  84. package/internal/detect-platform.mjs +157 -0
  85. package/internal/detect-platform.mjs.map +1 -0
  86. package/internal/errors.d.mts +3 -0
  87. package/internal/errors.d.mts.map +1 -0
  88. package/internal/errors.d.ts +3 -0
  89. package/internal/errors.d.ts.map +1 -0
  90. package/internal/errors.js +41 -0
  91. package/internal/errors.js.map +1 -0
  92. package/internal/errors.mjs +36 -0
  93. package/internal/errors.mjs.map +1 -0
  94. package/internal/headers.d.mts +20 -0
  95. package/internal/headers.d.mts.map +1 -0
  96. package/internal/headers.d.ts +20 -0
  97. package/internal/headers.d.ts.map +1 -0
  98. package/internal/headers.js +79 -0
  99. package/internal/headers.js.map +1 -0
  100. package/internal/headers.mjs +74 -0
  101. package/internal/headers.mjs.map +1 -0
  102. package/internal/parse.d.mts +12 -0
  103. package/internal/parse.d.mts.map +1 -0
  104. package/internal/parse.d.ts +12 -0
  105. package/internal/parse.d.ts.map +1 -0
  106. package/internal/parse.js +40 -0
  107. package/internal/parse.js.map +1 -0
  108. package/internal/parse.mjs +37 -0
  109. package/internal/parse.mjs.map +1 -0
  110. package/internal/request-options.d.mts +75 -0
  111. package/internal/request-options.d.mts.map +1 -0
  112. package/internal/request-options.d.ts +75 -0
  113. package/internal/request-options.d.ts.map +1 -0
  114. package/internal/request-options.js +14 -0
  115. package/internal/request-options.js.map +1 -0
  116. package/internal/request-options.mjs +10 -0
  117. package/internal/request-options.mjs.map +1 -0
  118. package/internal/shim-types.d.mts +17 -0
  119. package/internal/shim-types.d.mts.map +1 -0
  120. package/internal/shim-types.d.ts +17 -0
  121. package/internal/shim-types.d.ts.map +1 -0
  122. package/internal/shim-types.js +4 -0
  123. package/internal/shim-types.js.map +1 -0
  124. package/{resources/top-level.mjs → internal/shim-types.mjs} +1 -1
  125. package/internal/shim-types.mjs.map +1 -0
  126. package/internal/shims.d.mts +20 -0
  127. package/internal/shims.d.mts.map +1 -0
  128. package/internal/shims.d.ts +20 -0
  129. package/internal/shims.d.ts.map +1 -0
  130. package/internal/shims.js +92 -0
  131. package/internal/shims.js.map +1 -0
  132. package/internal/shims.mjs +85 -0
  133. package/internal/shims.mjs.map +1 -0
  134. package/internal/to-file.d.mts +45 -0
  135. package/internal/to-file.d.mts.map +1 -0
  136. package/internal/to-file.d.ts +45 -0
  137. package/internal/to-file.d.ts.map +1 -0
  138. package/internal/to-file.js +92 -0
  139. package/internal/to-file.js.map +1 -0
  140. package/internal/to-file.mjs +89 -0
  141. package/internal/to-file.mjs.map +1 -0
  142. package/internal/tslib.js +81 -0
  143. package/internal/tslib.mjs +17 -0
  144. package/internal/types.d.mts +69 -0
  145. package/internal/types.d.mts.map +1 -0
  146. package/internal/types.d.ts +69 -0
  147. package/internal/types.d.ts.map +1 -0
  148. package/{resources/top-level.js → internal/types.js} +1 -1
  149. package/internal/types.js.map +1 -0
  150. package/{src/resources/top-level.ts → internal/types.mjs} +1 -1
  151. package/internal/types.mjs.map +1 -0
  152. package/internal/uploads.d.mts +42 -0
  153. package/internal/uploads.d.mts.map +1 -0
  154. package/internal/uploads.d.ts +42 -0
  155. package/internal/uploads.d.ts.map +1 -0
  156. package/internal/uploads.js +141 -0
  157. package/internal/uploads.js.map +1 -0
  158. package/internal/uploads.mjs +131 -0
  159. package/internal/uploads.mjs.map +1 -0
  160. package/internal/utils/base64.d.mts +3 -0
  161. package/internal/utils/base64.d.mts.map +1 -0
  162. package/internal/utils/base64.d.ts +3 -0
  163. package/internal/utils/base64.d.ts.map +1 -0
  164. package/internal/utils/base64.js +38 -0
  165. package/internal/utils/base64.js.map +1 -0
  166. package/internal/utils/base64.mjs +33 -0
  167. package/internal/utils/base64.mjs.map +1 -0
  168. package/internal/utils/bytes.d.mts +4 -0
  169. package/internal/utils/bytes.d.mts.map +1 -0
  170. package/internal/utils/bytes.d.ts +4 -0
  171. package/internal/utils/bytes.d.ts.map +1 -0
  172. package/internal/utils/bytes.js +31 -0
  173. package/internal/utils/bytes.js.map +1 -0
  174. package/internal/utils/bytes.mjs +26 -0
  175. package/internal/utils/bytes.mjs.map +1 -0
  176. package/internal/utils/env.d.mts +9 -0
  177. package/internal/utils/env.d.mts.map +1 -0
  178. package/internal/utils/env.d.ts +9 -0
  179. package/internal/utils/env.d.ts.map +1 -0
  180. package/internal/utils/env.js +22 -0
  181. package/internal/utils/env.js.map +1 -0
  182. package/internal/utils/env.mjs +18 -0
  183. package/internal/utils/env.mjs.map +1 -0
  184. package/internal/utils/log.d.mts +37 -0
  185. package/internal/utils/log.d.mts.map +1 -0
  186. package/internal/utils/log.d.ts +37 -0
  187. package/internal/utils/log.d.ts.map +1 -0
  188. package/internal/utils/log.js +86 -0
  189. package/internal/utils/log.js.map +1 -0
  190. package/internal/utils/log.mjs +80 -0
  191. package/internal/utils/log.mjs.map +1 -0
  192. package/internal/utils/path.d.mts +15 -0
  193. package/internal/utils/path.d.mts.map +1 -0
  194. package/internal/utils/path.d.ts +15 -0
  195. package/internal/utils/path.d.ts.map +1 -0
  196. package/internal/utils/path.js +79 -0
  197. package/internal/utils/path.js.map +1 -0
  198. package/internal/utils/path.mjs +74 -0
  199. package/internal/utils/path.mjs.map +1 -0
  200. package/internal/utils/sleep.d.mts +2 -0
  201. package/internal/utils/sleep.d.mts.map +1 -0
  202. package/internal/utils/sleep.d.ts +2 -0
  203. package/internal/utils/sleep.d.ts.map +1 -0
  204. package/internal/utils/sleep.js +7 -0
  205. package/internal/utils/sleep.js.map +1 -0
  206. package/internal/utils/sleep.mjs +3 -0
  207. package/internal/utils/sleep.mjs.map +1 -0
  208. package/internal/utils/uuid.d.mts +5 -0
  209. package/internal/utils/uuid.d.mts.map +1 -0
  210. package/internal/utils/uuid.d.ts +5 -0
  211. package/internal/utils/uuid.d.ts.map +1 -0
  212. package/internal/utils/uuid.js +19 -0
  213. package/internal/utils/uuid.js.map +1 -0
  214. package/internal/utils/uuid.mjs +15 -0
  215. package/internal/utils/uuid.mjs.map +1 -0
  216. package/internal/utils/values.d.mts +18 -0
  217. package/internal/utils/values.d.mts.map +1 -0
  218. package/internal/utils/values.d.ts +18 -0
  219. package/internal/utils/values.d.ts.map +1 -0
  220. package/internal/utils/values.js +112 -0
  221. package/internal/utils/values.js.map +1 -0
  222. package/internal/utils/values.mjs +94 -0
  223. package/internal/utils/values.mjs.map +1 -0
  224. package/internal/utils.d.mts +7 -0
  225. package/internal/utils.d.mts.map +1 -0
  226. package/internal/utils.d.ts +7 -0
  227. package/internal/utils.d.ts.map +1 -0
  228. package/internal/utils.js +11 -0
  229. package/internal/utils.js.map +1 -0
  230. package/internal/utils.mjs +8 -0
  231. package/internal/utils.mjs.map +1 -0
  232. package/lib/generate-signature.d.mts +7 -0
  233. package/lib/generate-signature.d.mts.map +1 -0
  234. package/lib/generate-signature.d.ts +1 -1
  235. package/lib/generate-signature.d.ts.map +1 -1
  236. package/lib/generate-signature.js +3 -3
  237. package/lib/generate-signature.js.map +1 -1
  238. package/lib/generate-signature.mjs +1 -1
  239. package/lib/generate-signature.mjs.map +1 -1
  240. package/lib/poll-until.d.mts +20 -0
  241. package/lib/poll-until.d.mts.map +1 -0
  242. package/lib/poll-until.d.ts.map +1 -1
  243. package/lib/promise.d.mts +55 -0
  244. package/lib/promise.d.mts.map +1 -0
  245. package/package.json +125 -74
  246. package/resource.d.mts +2 -0
  247. package/resource.d.mts.map +1 -0
  248. package/resource.d.ts +1 -5
  249. package/resource.d.ts.map +1 -1
  250. package/resource.js +3 -8
  251. package/resource.js.map +1 -1
  252. package/resource.mjs +1 -6
  253. package/resource.mjs.map +1 -1
  254. package/resources/api-keys.d.mts +130 -0
  255. package/resources/api-keys.d.mts.map +1 -0
  256. package/resources/api-keys.d.ts +130 -0
  257. package/resources/api-keys.d.ts.map +1 -0
  258. package/resources/api-keys.js +63 -0
  259. package/resources/api-keys.js.map +1 -0
  260. package/resources/api-keys.mjs +59 -0
  261. package/resources/api-keys.mjs.map +1 -0
  262. package/resources/conversation/chat.d.mts +312 -0
  263. package/resources/conversation/chat.d.mts.map +1 -0
  264. package/resources/conversation/chat.d.ts +60 -78
  265. package/resources/conversation/chat.d.ts.map +1 -1
  266. package/resources/conversation/chat.js +14 -48
  267. package/resources/conversation/chat.js.map +1 -1
  268. package/resources/conversation/chat.mjs +14 -48
  269. package/resources/conversation/chat.mjs.map +1 -1
  270. package/resources/conversation/conversation.d.mts +77 -0
  271. package/resources/conversation/conversation.d.mts.map +1 -0
  272. package/resources/conversation/conversation.d.ts +2 -59
  273. package/resources/conversation/conversation.d.ts.map +1 -1
  274. package/resources/conversation/conversation.js +5 -63
  275. package/resources/conversation/conversation.js.map +1 -1
  276. package/resources/conversation/conversation.mjs +1 -37
  277. package/resources/conversation/conversation.mjs.map +1 -1
  278. package/resources/conversation/email.d.mts +257 -0
  279. package/resources/conversation/email.d.mts.map +1 -0
  280. package/resources/conversation/email.d.ts +25 -9
  281. package/resources/conversation/email.d.ts.map +1 -1
  282. package/resources/conversation/email.js +6 -6
  283. package/resources/conversation/email.js.map +1 -1
  284. package/resources/conversation/email.mjs +6 -6
  285. package/resources/conversation/email.mjs.map +1 -1
  286. package/resources/conversation/index.d.mts +5 -0
  287. package/resources/conversation/index.d.mts.map +1 -0
  288. package/resources/conversation/index.d.ts +2 -2
  289. package/resources/conversation/index.d.ts.map +1 -1
  290. package/resources/conversation/index.js.map +1 -1
  291. package/resources/conversation/index.mjs +1 -1
  292. package/resources/conversation/index.mjs.map +1 -1
  293. package/resources/conversation/voice.d.mts +45 -0
  294. package/resources/conversation/voice.d.mts.map +1 -0
  295. package/resources/conversation/voice.d.ts +7 -4
  296. package/resources/conversation/voice.d.ts.map +1 -1
  297. package/resources/conversation/voice.js +3 -2
  298. package/resources/conversation/voice.js.map +1 -1
  299. package/resources/conversation/voice.mjs +3 -2
  300. package/resources/conversation/voice.mjs.map +1 -1
  301. package/resources/conversation.d.mts +2 -0
  302. package/resources/conversation.d.mts.map +1 -0
  303. package/resources/conversation.d.ts.map +1 -1
  304. package/resources/conversation.js +2 -15
  305. package/resources/conversation.js.map +1 -1
  306. package/resources/customer/customer.d.mts +333 -0
  307. package/resources/customer/customer.d.mts.map +1 -0
  308. package/resources/customer/customer.d.ts +43 -10
  309. package/resources/customer/customer.d.ts.map +1 -1
  310. package/resources/customer/customer.js +9 -32
  311. package/resources/customer/customer.js.map +1 -1
  312. package/resources/customer/customer.mjs +6 -7
  313. package/resources/customer/customer.mjs.map +1 -1
  314. package/resources/customer/index.d.mts +4 -0
  315. package/resources/customer/index.d.mts.map +1 -0
  316. package/resources/customer/index.d.ts +1 -1
  317. package/resources/customer/index.d.ts.map +1 -1
  318. package/resources/customer/index.js.map +1 -1
  319. package/resources/customer/index.mjs.map +1 -1
  320. package/resources/customer/profile.d.mts +30 -0
  321. package/resources/customer/profile.d.mts.map +1 -0
  322. package/resources/customer/profile.d.ts +7 -48
  323. package/resources/customer/profile.d.ts.map +1 -1
  324. package/resources/customer/profile.js +3 -2
  325. package/resources/customer/profile.js.map +1 -1
  326. package/resources/customer/profile.mjs +3 -2
  327. package/resources/customer/profile.mjs.map +1 -1
  328. package/resources/customer/remote.d.mts +164 -0
  329. package/resources/customer/remote.d.mts.map +1 -0
  330. package/resources/customer/remote.d.ts +17 -4
  331. package/resources/customer/remote.d.ts.map +1 -1
  332. package/resources/customer/remote.js +6 -5
  333. package/resources/customer/remote.js.map +1 -1
  334. package/resources/customer/remote.mjs +6 -5
  335. package/resources/customer/remote.mjs.map +1 -1
  336. package/resources/customer.d.mts +2 -0
  337. package/resources/customer.d.mts.map +1 -0
  338. package/resources/customer.d.ts.map +1 -1
  339. package/resources/customer.js +2 -15
  340. package/resources/customer.js.map +1 -1
  341. package/resources/index.d.mts +5 -0
  342. package/resources/index.d.mts.map +1 -0
  343. package/resources/index.d.ts +4 -8
  344. package/resources/index.d.ts.map +1 -1
  345. package/resources/index.js +3 -11
  346. package/resources/index.js.map +1 -1
  347. package/resources/index.mjs +1 -5
  348. package/resources/index.mjs.map +1 -1
  349. package/resources/ingest.d.mts +27 -0
  350. package/resources/ingest.d.mts.map +1 -0
  351. package/resources/ingest.d.ts +15 -10
  352. package/resources/ingest.d.ts.map +1 -1
  353. package/resources/ingest.js +11 -11
  354. package/resources/ingest.js.map +1 -1
  355. package/resources/ingest.mjs +11 -11
  356. package/resources/ingest.mjs.map +1 -1
  357. package/resources.d.mts +2 -0
  358. package/resources.d.mts.map +1 -0
  359. package/resources.d.ts.map +1 -1
  360. package/resources.js +2 -15
  361. package/resources.js.map +1 -1
  362. package/src/api-promise.ts +2 -0
  363. package/src/client.ts +835 -0
  364. package/src/core/README.md +3 -0
  365. package/src/core/api-promise.ts +92 -0
  366. package/src/core/error.ts +130 -0
  367. package/src/core/resource.ts +11 -0
  368. package/src/core/uploads.ts +2 -0
  369. package/src/error.ts +2 -130
  370. package/src/index.ts +6 -297
  371. package/src/internal/README.md +3 -0
  372. package/src/internal/builtin-types.ts +93 -0
  373. package/src/internal/detect-platform.ts +196 -0
  374. package/src/internal/errors.ts +33 -0
  375. package/src/internal/headers.ts +97 -0
  376. package/src/internal/parse.ts +56 -0
  377. package/src/internal/request-options.ts +91 -0
  378. package/src/internal/shim-types.ts +26 -0
  379. package/src/internal/shims.ts +107 -0
  380. package/src/internal/to-file.ts +156 -0
  381. package/src/internal/types.ts +95 -0
  382. package/src/internal/uploads.ts +187 -0
  383. package/src/internal/utils/base64.ts +40 -0
  384. package/src/internal/utils/bytes.ts +32 -0
  385. package/src/internal/utils/env.ts +18 -0
  386. package/src/internal/utils/log.ts +127 -0
  387. package/src/internal/utils/path.ts +88 -0
  388. package/src/internal/utils/sleep.ts +3 -0
  389. package/src/internal/utils/uuid.ts +17 -0
  390. package/src/internal/utils/values.ts +105 -0
  391. package/src/internal/utils.ts +8 -0
  392. package/src/lib/generate-signature.ts +2 -2
  393. package/src/resource.ts +2 -11
  394. package/src/resources/api-keys.ts +171 -0
  395. package/src/resources/conversation/chat.ts +76 -96
  396. package/src/resources/conversation/conversation.ts +1 -91
  397. package/src/resources/conversation/email.ts +29 -13
  398. package/src/resources/conversation/index.ts +6 -10
  399. package/src/resources/conversation/voice.ts +9 -5
  400. package/src/resources/customer/customer.ts +58 -12
  401. package/src/resources/customer/index.ts +1 -0
  402. package/src/resources/customer/profile.ts +9 -62
  403. package/src/resources/customer/remote.ts +25 -8
  404. package/src/resources/index.ts +9 -10
  405. package/src/resources/ingest.ts +26 -24
  406. package/src/tsconfig.json +2 -2
  407. package/src/uploads.ts +2 -256
  408. package/src/version.ts +1 -1
  409. package/uploads.d.mts +2 -0
  410. package/uploads.d.mts.map +1 -0
  411. package/uploads.d.ts +1 -74
  412. package/uploads.d.ts.map +1 -1
  413. package/uploads.js +3 -167
  414. package/uploads.js.map +1 -1
  415. package/uploads.mjs +1 -156
  416. package/uploads.mjs.map +1 -1
  417. package/version.d.mts +2 -0
  418. package/version.d.mts.map +1 -0
  419. package/version.d.ts +1 -1
  420. package/version.js +1 -1
  421. package/version.mjs +1 -1
  422. package/_shims/MultipartBody.d.ts +0 -9
  423. package/_shims/MultipartBody.d.ts.map +0 -1
  424. package/_shims/MultipartBody.js +0 -16
  425. package/_shims/MultipartBody.js.map +0 -1
  426. package/_shims/MultipartBody.mjs +0 -12
  427. package/_shims/MultipartBody.mjs.map +0 -1
  428. package/_shims/README.md +0 -46
  429. package/_shims/auto/runtime-bun.d.ts +0 -5
  430. package/_shims/auto/runtime-bun.d.ts.map +0 -1
  431. package/_shims/auto/runtime-bun.js +0 -21
  432. package/_shims/auto/runtime-bun.js.map +0 -1
  433. package/_shims/auto/runtime-bun.mjs +0 -2
  434. package/_shims/auto/runtime-bun.mjs.map +0 -1
  435. package/_shims/auto/runtime-node.d.ts +0 -5
  436. package/_shims/auto/runtime-node.d.ts.map +0 -1
  437. package/_shims/auto/runtime-node.js +0 -21
  438. package/_shims/auto/runtime-node.js.map +0 -1
  439. package/_shims/auto/runtime-node.mjs +0 -2
  440. package/_shims/auto/runtime-node.mjs.map +0 -1
  441. package/_shims/auto/runtime.d.ts +0 -5
  442. package/_shims/auto/runtime.d.ts.map +0 -1
  443. package/_shims/auto/runtime.js +0 -21
  444. package/_shims/auto/runtime.js.map +0 -1
  445. package/_shims/auto/runtime.mjs +0 -2
  446. package/_shims/auto/runtime.mjs.map +0 -1
  447. package/_shims/auto/types-node.d.ts +0 -5
  448. package/_shims/auto/types-node.d.ts.map +0 -1
  449. package/_shims/auto/types-node.js +0 -21
  450. package/_shims/auto/types-node.js.map +0 -1
  451. package/_shims/auto/types-node.mjs +0 -2
  452. package/_shims/auto/types-node.mjs.map +0 -1
  453. package/_shims/auto/types.d.ts +0 -101
  454. package/_shims/auto/types.js +0 -3
  455. package/_shims/auto/types.mjs +0 -3
  456. package/_shims/bun-runtime.d.ts +0 -6
  457. package/_shims/bun-runtime.d.ts.map +0 -1
  458. package/_shims/bun-runtime.js +0 -13
  459. package/_shims/bun-runtime.js.map +0 -1
  460. package/_shims/bun-runtime.mjs +0 -10
  461. package/_shims/bun-runtime.mjs.map +0 -1
  462. package/_shims/index.d.ts +0 -83
  463. package/_shims/index.js +0 -17
  464. package/_shims/index.mjs +0 -11
  465. package/_shims/manual-types.d.ts +0 -12
  466. package/_shims/manual-types.js +0 -3
  467. package/_shims/manual-types.mjs +0 -3
  468. package/_shims/node-runtime.d.ts +0 -3
  469. package/_shims/node-runtime.d.ts.map +0 -1
  470. package/_shims/node-runtime.js +0 -88
  471. package/_shims/node-runtime.js.map +0 -1
  472. package/_shims/node-runtime.mjs +0 -56
  473. package/_shims/node-runtime.mjs.map +0 -1
  474. package/_shims/node-types.d.ts +0 -42
  475. package/_shims/node-types.js +0 -3
  476. package/_shims/node-types.mjs +0 -3
  477. package/_shims/registry.d.ts +0 -37
  478. package/_shims/registry.d.ts.map +0 -1
  479. package/_shims/registry.js +0 -41
  480. package/_shims/registry.js.map +0 -1
  481. package/_shims/registry.mjs +0 -37
  482. package/_shims/registry.mjs.map +0 -1
  483. package/_shims/web-runtime.d.ts +0 -5
  484. package/_shims/web-runtime.d.ts.map +0 -1
  485. package/_shims/web-runtime.js +0 -77
  486. package/_shims/web-runtime.js.map +0 -1
  487. package/_shims/web-runtime.mjs +0 -71
  488. package/_shims/web-runtime.mjs.map +0 -1
  489. package/_shims/web-types.d.ts +0 -83
  490. package/_shims/web-types.js +0 -3
  491. package/_shims/web-types.mjs +0 -3
  492. package/core.d.ts +0 -253
  493. package/core.d.ts.map +0 -1
  494. package/core.js +0 -924
  495. package/core.js.map +0 -1
  496. package/core.mjs +0 -892
  497. package/core.mjs.map +0 -1
  498. package/internal/qs/formats.d.ts +0 -6
  499. package/internal/qs/formats.d.ts.map +0 -1
  500. package/internal/qs/formats.js +0 -11
  501. package/internal/qs/formats.js.map +0 -1
  502. package/internal/qs/formats.mjs +0 -8
  503. package/internal/qs/formats.mjs.map +0 -1
  504. package/internal/qs/index.d.ts +0 -10
  505. package/internal/qs/index.d.ts.map +0 -1
  506. package/internal/qs/index.js +0 -14
  507. package/internal/qs/index.js.map +0 -1
  508. package/internal/qs/index.mjs +0 -10
  509. package/internal/qs/index.mjs.map +0 -1
  510. package/internal/qs/stringify.d.ts +0 -3
  511. package/internal/qs/stringify.d.ts.map +0 -1
  512. package/internal/qs/stringify.js +0 -279
  513. package/internal/qs/stringify.js.map +0 -1
  514. package/internal/qs/stringify.mjs +0 -276
  515. package/internal/qs/stringify.mjs.map +0 -1
  516. package/internal/qs/types.d.ts +0 -57
  517. package/internal/qs/types.d.ts.map +0 -1
  518. package/internal/qs/types.js +0 -3
  519. package/internal/qs/types.js.map +0 -1
  520. package/internal/qs/types.mjs +0 -2
  521. package/internal/qs/types.mjs.map +0 -1
  522. package/internal/qs/utils.d.ts +0 -14
  523. package/internal/qs/utils.d.ts.map +0 -1
  524. package/internal/qs/utils.js +0 -229
  525. package/internal/qs/utils.js.map +0 -1
  526. package/internal/qs/utils.mjs +0 -217
  527. package/internal/qs/utils.mjs.map +0 -1
  528. package/resources/file.d.ts +0 -7
  529. package/resources/file.d.ts.map +0 -1
  530. package/resources/file.js +0 -21
  531. package/resources/file.js.map +0 -1
  532. package/resources/file.mjs +0 -17
  533. package/resources/file.mjs.map +0 -1
  534. package/resources/oauth/authorization.d.ts +0 -6
  535. package/resources/oauth/authorization.d.ts.map +0 -1
  536. package/resources/oauth/authorization.js +0 -15
  537. package/resources/oauth/authorization.js.map +0 -1
  538. package/resources/oauth/authorization.mjs +0 -11
  539. package/resources/oauth/authorization.mjs.map +0 -1
  540. package/resources/oauth/index.d.ts +0 -3
  541. package/resources/oauth/index.d.ts.map +0 -1
  542. package/resources/oauth/index.js +0 -9
  543. package/resources/oauth/index.js.map +0 -1
  544. package/resources/oauth/index.mjs +0 -4
  545. package/resources/oauth/index.mjs.map +0 -1
  546. package/resources/oauth/oauth.d.ts +0 -24
  547. package/resources/oauth/oauth.d.ts.map +0 -1
  548. package/resources/oauth/oauth.js +0 -65
  549. package/resources/oauth/oauth.js.map +0 -1
  550. package/resources/oauth/oauth.mjs +0 -38
  551. package/resources/oauth/oauth.mjs.map +0 -1
  552. package/resources/oauth.d.ts +0 -2
  553. package/resources/oauth.d.ts.map +0 -1
  554. package/resources/oauth.js +0 -19
  555. package/resources/oauth.js.map +0 -1
  556. package/resources/oauth.mjs +0 -3
  557. package/resources/oauth.mjs.map +0 -1
  558. package/resources/suggestion.d.ts +0 -7
  559. package/resources/suggestion.d.ts.map +0 -1
  560. package/resources/suggestion.js +0 -21
  561. package/resources/suggestion.js.map +0 -1
  562. package/resources/suggestion.mjs +0 -17
  563. package/resources/suggestion.mjs.map +0 -1
  564. package/resources/ticket.d.ts +0 -14
  565. package/resources/ticket.d.ts.map +0 -1
  566. package/resources/ticket.js +0 -16
  567. package/resources/ticket.js.map +0 -1
  568. package/resources/ticket.mjs +0 -12
  569. package/resources/ticket.mjs.map +0 -1
  570. package/resources/top-level.d.ts +0 -2
  571. package/resources/top-level.d.ts.map +0 -1
  572. package/resources/top-level.js.map +0 -1
  573. package/resources/top-level.mjs.map +0 -1
  574. package/resources/webhooks.d.ts +0 -6
  575. package/resources/webhooks.d.ts.map +0 -1
  576. package/resources/webhooks.js +0 -15
  577. package/resources/webhooks.js.map +0 -1
  578. package/resources/webhooks.mjs +0 -11
  579. package/resources/webhooks.mjs.map +0 -1
  580. package/resources/workflow.d.ts +0 -8
  581. package/resources/workflow.d.ts.map +0 -1
  582. package/resources/workflow.js +0 -21
  583. package/resources/workflow.js.map +0 -1
  584. package/resources/workflow.mjs +0 -17
  585. package/resources/workflow.mjs.map +0 -1
  586. package/shims/node.d.ts +0 -26
  587. package/shims/node.d.ts.map +0 -1
  588. package/shims/node.js +0 -6
  589. package/shims/node.js.map +0 -1
  590. package/shims/node.mjs +0 -4
  591. package/shims/node.mjs.map +0 -1
  592. package/shims/web.d.ts +0 -26
  593. package/shims/web.d.ts.map +0 -1
  594. package/shims/web.js +0 -6
  595. package/shims/web.js.map +0 -1
  596. package/shims/web.mjs +0 -4
  597. package/shims/web.mjs.map +0 -1
  598. package/src/_shims/MultipartBody.ts +0 -9
  599. package/src/_shims/README.md +0 -46
  600. package/src/_shims/auto/runtime-bun.ts +0 -4
  601. package/src/_shims/auto/runtime-node.ts +0 -4
  602. package/src/_shims/auto/runtime.ts +0 -4
  603. package/src/_shims/auto/types-node.ts +0 -4
  604. package/src/_shims/auto/types.d.ts +0 -101
  605. package/src/_shims/auto/types.js +0 -3
  606. package/src/_shims/auto/types.mjs +0 -3
  607. package/src/_shims/bun-runtime.ts +0 -14
  608. package/src/_shims/index.d.ts +0 -83
  609. package/src/_shims/index.js +0 -17
  610. package/src/_shims/index.mjs +0 -11
  611. package/src/_shims/manual-types.d.ts +0 -12
  612. package/src/_shims/manual-types.js +0 -3
  613. package/src/_shims/manual-types.mjs +0 -3
  614. package/src/_shims/node-runtime.ts +0 -81
  615. package/src/_shims/node-types.d.ts +0 -42
  616. package/src/_shims/node-types.js +0 -3
  617. package/src/_shims/node-types.mjs +0 -3
  618. package/src/_shims/registry.ts +0 -67
  619. package/src/_shims/web-runtime.ts +0 -103
  620. package/src/_shims/web-types.d.ts +0 -83
  621. package/src/_shims/web-types.js +0 -3
  622. package/src/_shims/web-types.mjs +0 -3
  623. package/src/core.ts +0 -1236
  624. package/src/internal/qs/LICENSE.md +0 -13
  625. package/src/internal/qs/README.md +0 -3
  626. package/src/internal/qs/formats.ts +0 -9
  627. package/src/internal/qs/index.ts +0 -13
  628. package/src/internal/qs/stringify.ts +0 -388
  629. package/src/internal/qs/types.ts +0 -71
  630. package/src/internal/qs/utils.ts +0 -265
  631. package/src/resources/file.ts +0 -20
  632. package/src/resources/oauth/authorization.ts +0 -13
  633. package/src/resources/oauth/index.ts +0 -4
  634. package/src/resources/oauth/oauth.ts +0 -63
  635. package/src/resources/suggestion.ts +0 -20
  636. package/src/resources/ticket.ts +0 -30
  637. package/src/resources/webhooks.ts +0 -13
  638. package/src/resources/workflow.ts +0 -21
  639. package/src/shims/node.ts +0 -50
  640. package/src/shims/web.ts +0 -50
@@ -0,0 +1,257 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import * as ConversationAPI from "./conversation.mjs";
3
+ import { APIPromise } from "../../core/api-promise.mjs";
4
+ import { RequestOptions } from "../../internal/request-options.mjs";
5
+ export declare class Email extends APIResource {
6
+ /**
7
+ * @example
8
+ * ```ts
9
+ * const response = await client.conversation.email.generate({
10
+ * attachments: [
11
+ * {
12
+ * name: 'example.jpg',
13
+ * type: 'image/jpeg',
14
+ * url: 'https://example.com/example.jpg',
15
+ * },
16
+ * ],
17
+ * conversationId: 'conversationId',
18
+ * message: 'message',
19
+ * });
20
+ * ```
21
+ */
22
+ generate(body: EmailGenerateParams, options?: RequestOptions): APIPromise<EmailGenerateResponse>;
23
+ /**
24
+ * @example
25
+ * ```ts
26
+ * const email = await client.conversation.email.get({
27
+ * conversationId: 'conversationId',
28
+ * });
29
+ * ```
30
+ */
31
+ get(query: EmailGetParams, options?: RequestOptions): APIPromise<EmailGetResponse>;
32
+ /**
33
+ * @example
34
+ * ```ts
35
+ * const response = await client.conversation.email.start({
36
+ * customerId: 'customerId',
37
+ * publicKey: 'publicKey',
38
+ * });
39
+ * ```
40
+ */
41
+ start(body: EmailStartParams, options?: RequestOptions): APIPromise<EmailStartResponse>;
42
+ /**
43
+ * Poll until the conversation has a bot response ready.
44
+ *
45
+ * Stops when `latestMessageType` is `BOT_RESPONSE` or `PENDING_RESPONSE`,
46
+ * or when `status` is `Escalated` or `Error`.
47
+ */
48
+ poll(query: EmailGetParams, options?: RequestOptions): APIPromise<EmailGetResponse>;
49
+ }
50
+ export interface EmailGenerateResponse {
51
+ /**
52
+ * The ID of the conversation
53
+ */
54
+ conversationId: string;
55
+ /**
56
+ * The timestamp of the when the conversation was created in our system.
57
+ */
58
+ createdAt: string;
59
+ /**
60
+ * The events that have occurred in the conversation. Can be used for deriving more
61
+ * information about the conversation.
62
+ */
63
+ events: Array<ConversationAPI.TicketEvent>;
64
+ /**
65
+ * The latest message type - useful for polling
66
+ */
67
+ latestMessageType: 'CUSTOMER' | 'BOT_RESPONSE' | 'PENDING_RESPONSE' | 'DRAFT_RESPONSE' | null;
68
+ /**
69
+ * The url of the conversation in the Lorikeet dashboard
70
+ */
71
+ link: string;
72
+ /**
73
+ * The full list of messages. This endpoint supports markdown.
74
+ */
75
+ messages: Array<ConversationAPI.TicketMessageDto>;
76
+ /**
77
+ * The status of the conversation
78
+ */
79
+ status: 'Unprocessed' | 'Processing' | 'Unhandled' | 'Responded' | 'Error' | 'Escalated' | 'Processed';
80
+ /**
81
+ * The tags of the conversation
82
+ */
83
+ tags: Array<string>;
84
+ /**
85
+ * The timestamp of when the ticket was last updated in our system.
86
+ */
87
+ updatedAt: string;
88
+ }
89
+ export interface EmailGetResponse {
90
+ /**
91
+ * The ID of the conversation
92
+ */
93
+ conversationId: string;
94
+ /**
95
+ * The timestamp of the when the conversation was created in our system.
96
+ */
97
+ createdAt: string;
98
+ /**
99
+ * The events that have occurred in the conversation. Can be used for deriving more
100
+ * information about the conversation.
101
+ */
102
+ events: Array<ConversationAPI.TicketEvent>;
103
+ /**
104
+ * The latest message type - useful for polling
105
+ */
106
+ latestMessageType: 'CUSTOMER' | 'BOT_RESPONSE' | 'PENDING_RESPONSE' | 'DRAFT_RESPONSE' | null;
107
+ /**
108
+ * The url of the conversation in the Lorikeet dashboard
109
+ */
110
+ link: string;
111
+ /**
112
+ * The full list of messages. This endpoint supports markdown.
113
+ */
114
+ messages: Array<ConversationAPI.TicketMessageDto>;
115
+ /**
116
+ * The status of the conversation
117
+ */
118
+ status: 'Unprocessed' | 'Processing' | 'Unhandled' | 'Responded' | 'Error' | 'Escalated' | 'Processed';
119
+ /**
120
+ * The tags of the conversation
121
+ */
122
+ tags: Array<string>;
123
+ /**
124
+ * The timestamp of when the ticket was last updated in our system.
125
+ */
126
+ updatedAt: string;
127
+ }
128
+ export interface EmailStartResponse {
129
+ /**
130
+ * The ID of the conversation
131
+ */
132
+ conversationId: string;
133
+ /**
134
+ * The timestamp of the when the conversation was created in our system.
135
+ */
136
+ createdAt: string;
137
+ /**
138
+ * The events that have occurred in the conversation. Can be used for deriving more
139
+ * information about the conversation.
140
+ */
141
+ events: Array<ConversationAPI.TicketEvent>;
142
+ /**
143
+ * The url of the conversation in the Lorikeet dashboard
144
+ */
145
+ link: string;
146
+ /**
147
+ * The status of the conversation
148
+ */
149
+ status: 'Unprocessed' | 'Processing' | 'Unhandled' | 'Responded' | 'Error' | 'Escalated' | 'Processed';
150
+ /**
151
+ * The tags of the conversation
152
+ */
153
+ tags: Array<string>;
154
+ }
155
+ export interface EmailGenerateParams {
156
+ /**
157
+ * Attachments to be sent with the message
158
+ */
159
+ attachments: Array<ConversationAPI.AttachmentDto>;
160
+ /**
161
+ * The ID of the conversation
162
+ */
163
+ conversationId: string;
164
+ /**
165
+ * The message to be sent to the user (customer or agent). This endpoint supports
166
+ * markdown.
167
+ */
168
+ message: string;
169
+ /**
170
+ * Any additional customer information, that has changed in the course of the
171
+ * conversation. Required if the message is sent by the customer to the agent. Must
172
+ * be omitted if the message is sent by the agent to the customer.
173
+ */
174
+ customer?: EmailGenerateParams.Customer;
175
+ /**
176
+ * The variables to be passed to the conversation - this can be used by workflows
177
+ */
178
+ variables?: {
179
+ [key: string]: unknown;
180
+ };
181
+ }
182
+ export declare namespace EmailGenerateParams {
183
+ /**
184
+ * Any additional customer information, that has changed in the course of the
185
+ * conversation. Required if the message is sent by the customer to the agent. Must
186
+ * be omitted if the message is sent by the agent to the customer.
187
+ */
188
+ interface Customer {
189
+ /**
190
+ * The URL of the customer avatar
191
+ */
192
+ avatarUrl?: string;
193
+ /**
194
+ * The display name of the customer
195
+ */
196
+ displayName?: string;
197
+ /**
198
+ * The email of the customer
199
+ */
200
+ email?: string;
201
+ /**
202
+ * The first name of the customer
203
+ */
204
+ firstName?: string;
205
+ /**
206
+ * The last name of the customer
207
+ */
208
+ lastName?: string;
209
+ /**
210
+ * The phone number of the customer (in international / E.164 format)
211
+ */
212
+ phoneNumber?: string;
213
+ /**
214
+ * The id of the customer in the ticketing system. For the SDK this needs to be
215
+ * stable and unique
216
+ */
217
+ remoteId?: string;
218
+ /**
219
+ * The id of the customer in your own primary database or a unique identifier, for
220
+ * example a cookie
221
+ */
222
+ subscriberCustomerId?: string;
223
+ /**
224
+ * A token that can be used to authenticate the customer in the your system, like a
225
+ * JWT
226
+ */
227
+ subscriberToken?: string;
228
+ }
229
+ }
230
+ export interface EmailGetParams {
231
+ /**
232
+ * The ID of the conversation you need to poll.
233
+ */
234
+ conversationId: string;
235
+ }
236
+ export interface EmailStartParams {
237
+ /**
238
+ * The ID of the customer. If omitted, a new customer will be created.
239
+ */
240
+ customerId: string;
241
+ /**
242
+ * The public key associated with this agent
243
+ */
244
+ publicKey: string;
245
+ /**
246
+ * The subject of the conversation.
247
+ */
248
+ subject?: string;
249
+ /**
250
+ * The UUID of the workflow to trigger.
251
+ */
252
+ workflowId?: string;
253
+ }
254
+ export declare namespace Email {
255
+ export { type EmailGenerateResponse as EmailGenerateResponse, type EmailGetResponse as EmailGetResponse, type EmailStartResponse as EmailStartResponse, type EmailGenerateParams as EmailGenerateParams, type EmailGetParams as EmailGetParams, type EmailStartParams as EmailStartParams, };
256
+ }
257
+ //# sourceMappingURL=email.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.d.mts","sourceRoot":"","sources":["../../src/resources/conversation/email.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,eAAe;OACpB,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,IAAI,EAAE,mBAAmB,EAAE,O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;IACnC;;;;OAIG;IACH,UAAiB,QAAQ;QACvB;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,QAAQ,CAAC,EAAE,MAAM,CAAC;QAElB;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB;;;WAGG;QACH,QAAQ,CAAC,EAAE,MAAM,CAAC;QAElB;;;WAGG;QACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAE9B;;;WAGG;QACH,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B;CACF;AAED,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -1,6 +1,7 @@
1
- import { APIResource } from "../../resource.js";
2
- import * as Core from "../../core.js";
1
+ import { APIResource } from "../../core/resource.js";
3
2
  import * as ConversationAPI from "./conversation.js";
3
+ import { APIPromise } from "../../core/api-promise.js";
4
+ import { RequestOptions } from "../../internal/request-options.js";
4
5
  export declare class Email extends APIResource {
5
6
  /**
6
7
  * @example
@@ -18,7 +19,7 @@ export declare class Email extends APIResource {
18
19
  * });
19
20
  * ```
20
21
  */
21
- generate(body: EmailGenerateParams, options?: Core.RequestOptions): Core.APIPromise<EmailGenerateResponse>;
22
+ generate(body: EmailGenerateParams, options?: RequestOptions): APIPromise<EmailGenerateResponse>;
22
23
  /**
23
24
  * @example
24
25
  * ```ts
@@ -27,7 +28,7 @@ export declare class Email extends APIResource {
27
28
  * });
28
29
  * ```
29
30
  */
30
- get(query: EmailGetParams, options?: Core.RequestOptions): Core.APIPromise<EmailGetResponse>;
31
+ get(query: EmailGetParams, options?: RequestOptions): APIPromise<EmailGetResponse>;
31
32
  /**
32
33
  * @example
33
34
  * ```ts
@@ -37,13 +38,14 @@ export declare class Email extends APIResource {
37
38
  * });
38
39
  * ```
39
40
  */
40
- start(body: EmailStartParams, options?: Core.RequestOptions): Core.APIPromise<EmailStartResponse>;
41
+ start(body: EmailStartParams, options?: RequestOptions): APIPromise<EmailStartResponse>;
41
42
  /**
42
- * __chat.get__
43
+ * Poll until the conversation has a bot response ready.
43
44
  *
44
- * Polls until it returns a BOT chat message for a conversation.
45
+ * Stops when `latestMessageType` is `BOT_RESPONSE` or `PENDING_RESPONSE`,
46
+ * or when `status` is `Escalated` or `Error`.
45
47
  */
46
- poll(query: EmailGetParams, options?: Core.RequestOptions): Core.APIPromise<EmailGetResponse>;
48
+ poll(query: EmailGetParams, options?: RequestOptions): APIPromise<EmailGetResponse>;
47
49
  }
48
50
  export interface EmailGenerateResponse {
49
51
  /**
@@ -170,6 +172,12 @@ export interface EmailGenerateParams {
170
172
  * be omitted if the message is sent by the agent to the customer.
171
173
  */
172
174
  customer?: EmailGenerateParams.Customer;
175
+ /**
176
+ * The variables to be passed to the conversation - this can be used by workflows
177
+ */
178
+ variables?: {
179
+ [key: string]: unknown;
180
+ };
173
181
  }
174
182
  export declare namespace EmailGenerateParams {
175
183
  /**
@@ -198,6 +206,10 @@ export declare namespace EmailGenerateParams {
198
206
  * The last name of the customer
199
207
  */
200
208
  lastName?: string;
209
+ /**
210
+ * The phone number of the customer (in international / E.164 format)
211
+ */
212
+ phoneNumber?: string;
201
213
  /**
202
214
  * The id of the customer in the ticketing system. For the SDK this needs to be
203
215
  * stable and unique
@@ -231,9 +243,13 @@ export interface EmailStartParams {
231
243
  */
232
244
  publicKey: string;
233
245
  /**
234
- * The timestamp of the when the conversation was created in our system.
246
+ * The subject of the conversation.
235
247
  */
236
248
  subject?: string;
249
+ /**
250
+ * The UUID of the workflow to trigger.
251
+ */
252
+ workflowId?: string;
237
253
  }
238
254
  export declare namespace Email {
239
255
  export { type EmailGenerateResponse as EmailGenerateResponse, type EmailGetResponse as EmailGetResponse, type EmailStartResponse as EmailStartResponse, type EmailGenerateParams as EmailGenerateParams, type EmailGetParams as EmailGetParams, type EmailStartParams as EmailStartParams, };
@@ -1 +1 @@
1
- {"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../src/resources/conversation/email.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,OAAO,KAAK,eAAe,MAAM,gBAAgB,CAAC;AAElD,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,qBAAqB,CAAC;IAI1G;;;;;;;OAOG;IACH,GAAG,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC;IAI5F;;;;;;;;OAQG;IACH,KAAK,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG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C;QAErB;;;WAGG;QACH,QAAQ,CAAC,EAAE,MAAM,CAAC;QAElB;;;WAGG;QACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAE9B;;;WAGG;QACH,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B;CACF;AAED,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -2,8 +2,8 @@
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Email = void 0;
5
- const resource_1 = require("../../resource.js");
6
- const poll_until_1 = require("@lorikeetai/node-sdk/lib/poll-until");
5
+ const resource_1 = require("../../core/resource.js");
6
+ const poll_until_1 = require("../../lib/poll-until.js");
7
7
  class Email extends resource_1.APIResource {
8
8
  /**
9
9
  * @example
@@ -48,16 +48,16 @@ class Email extends resource_1.APIResource {
48
48
  return this._client.post('/v1/conversation/email/create', { body, ...options });
49
49
  }
50
50
  /**
51
- * __chat.get__
51
+ * Poll until the conversation has a bot response ready.
52
52
  *
53
- * Polls until it returns a BOT chat message for a conversation.
53
+ * Stops when `latestMessageType` is `BOT_RESPONSE` or `PENDING_RESPONSE`,
54
+ * or when `status` is `Escalated` or `Error`.
54
55
  */
55
56
  poll(query, options) {
56
- return (0, poll_until_1.pollUntil)(() => this._client.get('/v1/conversation/chat/message', { query, ...options }), {
57
+ return (0, poll_until_1.pollUntil)(() => this._client.get('/v1/conversation/email/message', { query, ...options }), {
57
58
  timeout: options?.timeout || 180000,
58
59
  interval: 2000,
59
60
  condition: (conversation) => {
60
- // Don't poll if the conversation is escalated or in error
61
61
  if (conversation.status === 'Escalated' || conversation.status === 'Error') {
62
62
  return true;
63
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"email.js","sourceRoot":"","sources":["../../src/resources/conversation/email.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAE7C,oEAAgE;AAGhE,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,IAAyB,EAAE,OAA6B;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gCAAgC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;IAED;;;;;;;OAOG;IACH,GAAG,CAAC,KAAqB,EAAE,OAA6B;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,IAAsB,EAAE,OAA6B;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;IAED;;;;OAIG;IACH,IAAI,CAAC,KAAqB,EAAE,OAA6B;QACvD,OAAO,IAAA,sBAAS,EACd,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,EAAE,KAAK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AKG;IACH,IAAI,CAAC,KAAqB,EAAE,OAAwB;QAClD,OAAO,IAAA,sBAAS,EACd,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,EAC/E;YACE,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,MAAO;YACpC,QAAQ,EAAE,IAAK;YACf,SAAS,EAAE,CAAC,YAAY,EAAE,EAAE;gBAC1B,IAAI,YAAY,CAAC,MAAM,KAAK,WAAW,IAAI,YAAY,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;oBAC3E,OAAO,IAAI,CAAC;gBACd,CAAC;gBAED,IACE,YAAY,CAAC,iBAAiB,KAAK,cAAc;oBACjD,YAAY,CAAC,iBAAiB,KAAK,kBAAkB,EACrD,CAAC;oBACD,OAAO,IAAI,CAAC;gBACd,CAAC;gBAED,OAAO,KAAK,CAAC;YACf,CAAC;SACF,CAC8B,CAAC;IACpC,CAAC;CACF;AA3ED,sBA2EC"}
@@ -1,6 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../../resource.mjs";
3
- import { pollUntil } from '@lorikeetai/node-sdk/lib/poll-until';
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import { pollUntil } from "../../lib/poll-until.mjs";
4
4
  export class Email extends APIResource {
5
5
  /**
6
6
  * @example
@@ -45,16 +45,16 @@ export class Email extends APIResource {
45
45
  return this._client.post('/v1/conversation/email/create', { body, ...options });
46
46
  }
47
47
  /**
48
- * __chat.get__
48
+ * Poll until the conversation has a bot response ready.
49
49
  *
50
- * Polls until it returns a BOT chat message for a conversation.
50
+ * Stops when `latestMessageType` is `BOT_RESPONSE` or `PENDING_RESPONSE`,
51
+ * or when `status` is `Escalated` or `Error`.
51
52
  */
52
53
  poll(query, options) {
53
- return pollUntil(() => this._client.get('/v1/conversation/chat/message', { query, ...options }), {
54
+ return pollUntil(() => this._client.get('/v1/conversation/email/message', { query, ...options }), {
54
55
  timeout: options?.timeout || 180000,
55
56
  interval: 2000,
56
57
  condition: (conversation) => {
57
- // Don't poll if the conversation is escalated or in error
58
58
  if (conversation.status === 'Escalated' || conversation.status === 'Error') {
59
59
  return true;
60
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"email.mjs","sourceRoot":"","sources":["../../src/resources/conversation/email.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,SAAS,EAAE,MAAM,qCAAqC;AAG/D,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,IAAyB,EAAE,OAA6B;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gCAAgC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;IAED;;;;;;;OAOG;IACH,GAAG,CAAC,KAAqB,EAAE,OAA6B;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,IAAsB,EAAE,OAA6B;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;IAED;;;;OAIG;IACH,IAAI,CAAC,KAAqB,EAAE,OAA6B;QACvD,OAAO,SAAS,CACd,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,EAC9E;YACE,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,MAAO;YACpC,QAAQ,EAAE,IAAK;YACf,SAAS,EAAE,CAAC,Y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EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,EAC/E;YACE,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,MAAO;YACpC,QAAQ,EAAE,IAAK;YACf,SAAS,EAAE,CAAC,YAAY,EAAE,EAAE;gBAC1B,IAAI,YAAY,CAAC,MAAM,KAAK,WAAW,IAAI,YAAY,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;oBAC3E,OAAO,IAAI,CAAC;gBACd,CAAC;gBAED,IACE,YAAY,CAAC,iBAAiB,KAAK,cAAc;oBACjD,YAAY,CAAC,iBAAiB,KAAK,kBAAkB,EACrD,CAAC;oBACD,OAAO,IAAI,CAAC;gBACd,CAAC;gBAED,OAAO,KAAK,CAAC;YACf,CAAC;SACF,CAC8B,CAAC;IACpC,CAAC;CACF"}
@@ -0,0 +1,5 @@
1
+ export { Chat, type ChatGenerateResponse, type ChatGetResponse, type ChatStartResponse, type ChatGenerateParams, type ChatGetParams, type ChatStartParams, type ChatStreamParams, type ChatStreamEvent, type ChatStreamNewMessageEvent, type ChatStreamMessageChunkEvent, type ChatStreamMessageCompleteEvent, } from "./chat.mjs";
2
+ export { Conversation, type AttachmentDto, type TicketEvent, type TicketMessageDto } from "./conversation.mjs";
3
+ export { Email, type EmailGenerateResponse, type EmailGetResponse, type EmailStartResponse, type EmailGenerateParams, type EmailGetParams, type EmailStartParams, } from "./email.mjs";
4
+ export { Voice, type VoiceOutboundParams } from "./voice.mjs";
5
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/conversation/index.ts"],"names":[],"mappings":"OAEO,EACL,IAAI,EACJ,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,8BAA8B,GACpC;OACM,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE;OAC7E,EACL,KAAK,EACL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB;OACM,EAAE,KAAK,EAAE,KAAK,mBAAmB,EAAE"}
@@ -1,5 +1,5 @@
1
- export { Chat, type ChatGenerateResponse, type ChatGetResponse, type ChatStartResponse, type ChatGenerateParams, type ChatGetParams, type ChatStartParams, } from "./chat.js";
2
- export { Conversation, type AttachmentDto, type TicketEvent, type TicketMessageDto, type ConversationCreateResponse, type ConversationRetrieveTranscriptResponse, type ConversationCreateParams, type ConversationRetrieveTranscriptParams, } from "./conversation.js";
1
+ export { Chat, type ChatGenerateResponse, type ChatGetResponse, type ChatStartResponse, type ChatGenerateParams, type ChatGetParams, type ChatStartParams, type ChatStreamParams, type ChatStreamEvent, type ChatStreamNewMessageEvent, type ChatStreamMessageChunkEvent, type ChatStreamMessageCompleteEvent, } from "./chat.js";
2
+ export { Conversation, type AttachmentDto, type TicketEvent, type TicketMessageDto } from "./conversation.js";
3
3
  export { Email, type EmailGenerateResponse, type EmailGetResponse, type EmailStartResponse, type EmailGenerateParams, type EmailGetParams, type EmailStartParams, } from "./email.js";
4
4
  export { Voice, type VoiceOutboundParams } from "./voice.js";
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/conversation/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,IAAI,EACJ,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,eAAe,GACrB,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,sCAAsC,EAC3C,KAAK,wBAAwB,EAC7B,KAAK,oCAAoC,GAC1C,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,EACL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,KAAK,EAAE,KAAK,mBAAmB,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/conversation/index.ts"],"names":[],"mappings":"OAEO,EACL,IAAI,EACJ,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,8BAA8B,GACpC;OACM,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE;OAC7E,EACL,KAAK,EACL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB;OACM,EAAE,KAAK,EAAE,KAAK,mBAAmB,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/conversation/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kCAQgB;AAPd,4FAAA,IAAI,OAAA;AAQN,kDASwB;AARtB,4GAAA,YAAY,OAAA;AASd,oCAQiB;AAPf,8FAAA,KAAK,OAAA;AAQP,oCAA0D;AAAjD,8FAAA,KAAK,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/conversation/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kCAagB;AAZd,4FAAA,IAAI,OAAA;AAaN,kDAA2G;AAAlG,4GAAA,YAAY,OAAA;AACrB,oCAQiB;AAPf,8FAAA,KAAK,OAAA;AAQP,oCAA0D;AAAjD,8FAAA,KAAK,OAAA"}
@@ -1,6 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  export { Chat, } from "./chat.mjs";
3
- export { Conversation, } from "./conversation.mjs";
3
+ export { Conversation } from "./conversation.mjs";
4
4
  export { Email, } from "./email.mjs";
5
5
  export { Voice } from "./voice.mjs";
6
6
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/conversation/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,IAAI,GAOL;OACM,EACL,YAAY,GAQb;OACM,EACL,KAAK,GAON;OACM,EAAE,KAAK,EAA4B"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/conversation/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,IAAI,GAYL;OACM,EAAE,YAAY,EAA+D;OAC7E,EACL,KAAK,GAON;OACM,EAAE,KAAK,EAA4B"}
@@ -0,0 +1,45 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import { APIPromise } from "../../core/api-promise.mjs";
3
+ import { RequestOptions } from "../../internal/request-options.mjs";
4
+ export declare class Voice extends APIResource {
5
+ /**
6
+ * @example
7
+ * ```ts
8
+ * await client.conversation.voice.outbound({
9
+ * phoneNumber: '+61400000000',
10
+ * });
11
+ * ```
12
+ */
13
+ outbound(body: VoiceOutboundParams, options?: RequestOptions): APIPromise<void>;
14
+ }
15
+ export interface VoiceOutboundParams {
16
+ /**
17
+ * The phone number to call in E.164 format. If a customer ID is not provided, the
18
+ * customer will be looked up by phone number. If no customer is found, a new
19
+ * customer will be created.
20
+ */
21
+ phoneNumber: string;
22
+ /**
23
+ * The ID of the brand to make the call from
24
+ */
25
+ brandId?: string;
26
+ /**
27
+ * The ID of the customer to call. If not provided, the customer will be looked up
28
+ * by phone number. If no customer is found, a new customer will be created.
29
+ */
30
+ customerId?: string;
31
+ /**
32
+ * Input data to pass to workflows. Should include values for input fields defined
33
+ * by both the chosen opening workflow and - if configured - the voicemail detected
34
+ * workflow.
35
+ */
36
+ inputData?: unknown;
37
+ /**
38
+ * The ID of the workflow to use for the call
39
+ */
40
+ workflowId?: string;
41
+ }
42
+ export declare namespace Voice {
43
+ export { type VoiceOutboundParams as VoiceOutboundParams };
44
+ }
45
+ //# sourceMappingURL=voice.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voice.d.mts","sourceRoot":"","sources":["../../src/resources/conversation/voice.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAEzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAOhF;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,KAAK,mBAAmB,IAAI,mBAAmB,EAAE,CAAC;CAC5D"}
@@ -1,5 +1,6 @@
1
- import { APIResource } from "../../resource.js";
2
- import * as Core from "../../core.js";
1
+ import { APIResource } from "../../core/resource.js";
2
+ import { APIPromise } from "../../core/api-promise.js";
3
+ import { RequestOptions } from "../../internal/request-options.js";
3
4
  export declare class Voice extends APIResource {
4
5
  /**
5
6
  * @example
@@ -9,7 +10,7 @@ export declare class Voice extends APIResource {
9
10
  * });
10
11
  * ```
11
12
  */
12
- outbound(body: VoiceOutboundParams, options?: Core.RequestOptions): Core.APIPromise<void>;
13
+ outbound(body: VoiceOutboundParams, options?: RequestOptions): APIPromise<void>;
13
14
  }
14
15
  export interface VoiceOutboundParams {
15
16
  /**
@@ -28,7 +29,9 @@ export interface VoiceOutboundParams {
28
29
  */
29
30
  customerId?: string;
30
31
  /**
31
- * The input data to pass to the workflow. Only used if a workflow is specified.
32
+ * Input data to pass to workflows. Should include values for input fields defined
33
+ * by both the chosen opening workflow and - if configured - the voicemail detected
34
+ * workflow.
32
35
  */
33
36
  inputData?: unknown;
34
37
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"voice.d.ts","sourceRoot":"","sources":["../../src/resources/conversation/voice.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;CAO1F;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,KAAK,mBAAmB,IAAI,mBAAmB,EAAE,CAAC;CAC5D"}
1
+ {"version":3,"file":"voice.d.ts","sourceRoot":"","sources":["../../src/resources/conversation/voice.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAEzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAOhF;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,KAAK,mBAAmB,IAAI,mBAAmB,EAAE,CAAC;CAC5D"}
@@ -2,7 +2,8 @@
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Voice = void 0;
5
- const resource_1 = require("../../resource.js");
5
+ const resource_1 = require("../../core/resource.js");
6
+ const headers_1 = require("../../internal/headers.js");
6
7
  class Voice extends resource_1.APIResource {
7
8
  /**
8
9
  * @example
@@ -16,7 +17,7 @@ class Voice extends resource_1.APIResource {
16
17
  return this._client.post('/v1/conversation/voice/outbound', {
17
18
  body,
18
19
  ...options,
19
- headers: { Accept: '*/*', ...options?.headers },
20
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
20
21
  });
21
22
  }
22
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"voice.js","sourceRoot":"","sources":["../../src/resources/conversation/voice.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAG7C,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAyB,EAAE,OAA6B;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iCAAiC,EAAE;YAC1D,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF;AAhBD,sBAgBC"}
1
+ {"version":3,"file":"voice.js","sourceRoot":"","sources":["../../src/resources/conversation/voice.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAElD,uDAAsD;AAGtD,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAyB,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iCAAiC,EAAE;YAC1D,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AAhBD,sBAgBC"}
@@ -1,5 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../../resource.mjs";
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import { buildHeaders } from "../../internal/headers.mjs";
3
4
  export class Voice extends APIResource {
4
5
  /**
5
6
  * @example
@@ -13,7 +14,7 @@ export class Voice extends APIResource {
13
14
  return this._client.post('/v1/conversation/voice/outbound', {
14
15
  body,
15
16
  ...options,
16
- headers: { Accept: '*/*', ...options?.headers },
17
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
17
18
  });
18
19
  }
19
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"voice.mjs","sourceRoot":"","sources":["../../src/resources/conversation/voice.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAyB,EAAE,OAA6B;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iCAAiC,EAAE;YAC1D,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF"}
1
+ {"version":3,"file":"voice.mjs","sourceRoot":"","sources":["../../src/resources/conversation/voice.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,YAAY,EAAE;AAGvB,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAyB,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iCAAiC,EAAE;YAC1D,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export * from "./conversation/index.mjs";
2
+ //# sourceMappingURL=conversation.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation.d.mts","sourceRoot":"","sources":["../src/resources/conversation.ts"],"names":[],"mappings":""}