@zavudev/sdk 0.55.0 → 0.57.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 (371) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/client.d.mts +25 -13
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +25 -13
  5. package/client.d.ts.map +1 -1
  6. package/client.js +15 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +15 -3
  9. package/client.mjs.map +1 -1
  10. package/internal/qs/formats.d.mts +7 -0
  11. package/internal/qs/formats.d.mts.map +1 -0
  12. package/internal/qs/formats.d.ts +7 -0
  13. package/internal/qs/formats.d.ts.map +1 -0
  14. package/internal/qs/formats.js +13 -0
  15. package/internal/qs/formats.js.map +1 -0
  16. package/internal/qs/formats.mjs +9 -0
  17. package/internal/qs/formats.mjs.map +1 -0
  18. package/internal/qs/index.d.mts +10 -0
  19. package/internal/qs/index.d.mts.map +1 -0
  20. package/internal/qs/index.d.ts +10 -0
  21. package/internal/qs/index.d.ts.map +1 -0
  22. package/internal/qs/index.js +14 -0
  23. package/internal/qs/index.js.map +1 -0
  24. package/internal/qs/index.mjs +10 -0
  25. package/internal/qs/index.mjs.map +1 -0
  26. package/internal/qs/stringify.d.mts +3 -0
  27. package/internal/qs/stringify.d.mts.map +1 -0
  28. package/internal/qs/stringify.d.ts +3 -0
  29. package/internal/qs/stringify.d.ts.map +1 -0
  30. package/internal/qs/stringify.js +277 -0
  31. package/internal/qs/stringify.js.map +1 -0
  32. package/internal/qs/stringify.mjs +274 -0
  33. package/internal/qs/stringify.mjs.map +1 -0
  34. package/internal/qs/types.d.mts +57 -0
  35. package/internal/qs/types.d.mts.map +1 -0
  36. package/internal/qs/types.d.ts +57 -0
  37. package/internal/qs/types.d.ts.map +1 -0
  38. package/internal/qs/types.js +3 -0
  39. package/internal/qs/types.js.map +1 -0
  40. package/internal/qs/types.mjs +2 -0
  41. package/internal/qs/types.mjs.map +1 -0
  42. package/internal/qs/utils.d.mts +15 -0
  43. package/internal/qs/utils.d.mts.map +1 -0
  44. package/internal/qs/utils.d.ts +15 -0
  45. package/internal/qs/utils.d.ts.map +1 -0
  46. package/internal/qs/utils.js +230 -0
  47. package/internal/qs/utils.js.map +1 -0
  48. package/internal/qs/utils.mjs +217 -0
  49. package/internal/qs/utils.mjs.map +1 -0
  50. package/internal/tslib.js +17 -17
  51. package/internal/utils/query.d.mts +0 -3
  52. package/internal/utils/query.d.mts.map +1 -1
  53. package/internal/utils/query.d.ts +0 -3
  54. package/internal/utils/query.d.ts.map +1 -1
  55. package/internal/utils/query.js +3 -16
  56. package/internal/utils/query.js.map +1 -1
  57. package/internal/utils/query.mjs +2 -16
  58. package/internal/utils/query.mjs.map +1 -1
  59. package/package.json +1 -1
  60. package/resources/agent-templates.d.mts +97 -0
  61. package/resources/agent-templates.d.mts.map +1 -0
  62. package/resources/agent-templates.d.ts +97 -0
  63. package/resources/agent-templates.d.ts.map +1 -0
  64. package/resources/agent-templates.js +39 -0
  65. package/resources/agent-templates.js.map +1 -0
  66. package/resources/agent-templates.mjs +35 -0
  67. package/resources/agent-templates.mjs.map +1 -0
  68. package/resources/agents/agents.d.mts +462 -0
  69. package/resources/agents/agents.d.mts.map +1 -0
  70. package/resources/agents/agents.d.ts +462 -0
  71. package/resources/agents/agents.d.ts.map +1 -0
  72. package/resources/agents/agents.js +129 -0
  73. package/resources/agents/agents.js.map +1 -0
  74. package/resources/agents/agents.mjs +124 -0
  75. package/resources/agents/agents.mjs.map +1 -0
  76. package/resources/agents/index.d.mts +3 -0
  77. package/resources/agents/index.d.mts.map +1 -0
  78. package/resources/agents/index.d.ts +3 -0
  79. package/resources/agents/index.d.ts.map +1 -0
  80. package/resources/agents/index.js +9 -0
  81. package/resources/agents/index.js.map +1 -0
  82. package/resources/agents/index.mjs +4 -0
  83. package/resources/agents/index.mjs.map +1 -0
  84. package/resources/agents/senders.d.mts +54 -0
  85. package/resources/agents/senders.d.mts.map +1 -0
  86. package/resources/agents/senders.d.ts +54 -0
  87. package/resources/agents/senders.d.ts.map +1 -0
  88. package/resources/agents/senders.js +45 -0
  89. package/resources/agents/senders.js.map +1 -0
  90. package/resources/agents/senders.mjs +41 -0
  91. package/resources/agents/senders.mjs.map +1 -0
  92. package/resources/agents.d.mts +2 -0
  93. package/resources/agents.d.mts.map +1 -0
  94. package/resources/agents.d.ts +2 -0
  95. package/resources/agents.d.ts.map +1 -0
  96. package/resources/agents.js +6 -0
  97. package/resources/agents.js.map +1 -0
  98. package/resources/agents.mjs +3 -0
  99. package/resources/agents.mjs.map +1 -0
  100. package/resources/broadcasts/broadcasts.d.mts +16 -9
  101. package/resources/broadcasts/broadcasts.d.mts.map +1 -1
  102. package/resources/broadcasts/broadcasts.d.ts +16 -9
  103. package/resources/broadcasts/broadcasts.d.ts.map +1 -1
  104. package/resources/broadcasts/broadcasts.js +16 -9
  105. package/resources/broadcasts/broadcasts.js.map +1 -1
  106. package/resources/broadcasts/broadcasts.mjs +16 -9
  107. package/resources/broadcasts/broadcasts.mjs.map +1 -1
  108. package/resources/calls.d.mts +539 -0
  109. package/resources/calls.d.mts.map +1 -0
  110. package/resources/calls.d.ts +539 -0
  111. package/resources/calls.d.ts.map +1 -0
  112. package/resources/calls.js +85 -0
  113. package/resources/calls.js.map +1 -0
  114. package/resources/calls.mjs +81 -0
  115. package/resources/calls.mjs.map +1 -0
  116. package/resources/contacts/contacts.d.mts +32 -13
  117. package/resources/contacts/contacts.d.mts.map +1 -1
  118. package/resources/contacts/contacts.d.ts +32 -13
  119. package/resources/contacts/contacts.d.ts.map +1 -1
  120. package/resources/contacts/contacts.js +0 -14
  121. package/resources/contacts/contacts.js.map +1 -1
  122. package/resources/contacts/contacts.mjs +0 -14
  123. package/resources/contacts/contacts.mjs.map +1 -1
  124. package/resources/conversations.d.mts +360 -0
  125. package/resources/conversations.d.mts.map +1 -0
  126. package/resources/conversations.d.ts +360 -0
  127. package/resources/conversations.d.ts.map +1 -0
  128. package/resources/conversations.js +47 -0
  129. package/resources/conversations.js.map +1 -0
  130. package/resources/conversations.mjs +43 -0
  131. package/resources/conversations.mjs.map +1 -0
  132. package/resources/email-domains.d.mts +260 -0
  133. package/resources/email-domains.d.mts.map +1 -0
  134. package/resources/email-domains.d.ts +260 -0
  135. package/resources/email-domains.d.ts.map +1 -0
  136. package/resources/email-domains.js +77 -0
  137. package/resources/email-domains.js.map +1 -0
  138. package/resources/email-domains.mjs +73 -0
  139. package/resources/email-domains.mjs.map +1 -0
  140. package/resources/functions/functions.d.mts +122 -1
  141. package/resources/functions/functions.d.mts.map +1 -1
  142. package/resources/functions/functions.d.ts +122 -1
  143. package/resources/functions/functions.d.ts.map +1 -1
  144. package/resources/functions/functions.js +53 -0
  145. package/resources/functions/functions.js.map +1 -1
  146. package/resources/functions/functions.mjs +53 -0
  147. package/resources/functions/functions.mjs.map +1 -1
  148. package/resources/functions/git-link.d.mts +295 -0
  149. package/resources/functions/git-link.d.mts.map +1 -0
  150. package/resources/functions/git-link.d.ts +295 -0
  151. package/resources/functions/git-link.d.ts.map +1 -0
  152. package/resources/functions/git-link.js +97 -0
  153. package/resources/functions/git-link.js.map +1 -0
  154. package/resources/functions/git-link.mjs +93 -0
  155. package/resources/functions/git-link.mjs.map +1 -0
  156. package/resources/functions/index.d.mts +3 -1
  157. package/resources/functions/index.d.mts.map +1 -1
  158. package/resources/functions/index.d.ts +3 -1
  159. package/resources/functions/index.d.ts.map +1 -1
  160. package/resources/functions/index.js +5 -1
  161. package/resources/functions/index.js.map +1 -1
  162. package/resources/functions/index.mjs +2 -0
  163. package/resources/functions/index.mjs.map +1 -1
  164. package/resources/functions/triggers.d.mts +164 -0
  165. package/resources/functions/triggers.d.mts.map +1 -0
  166. package/resources/functions/triggers.d.ts +164 -0
  167. package/resources/functions/triggers.d.ts.map +1 -0
  168. package/resources/functions/triggers.js +74 -0
  169. package/resources/functions/triggers.js.map +1 -0
  170. package/resources/functions/triggers.mjs +70 -0
  171. package/resources/functions/triggers.mjs.map +1 -0
  172. package/resources/index.d.mts +10 -5
  173. package/resources/index.d.mts.map +1 -1
  174. package/resources/index.d.ts +10 -5
  175. package/resources/index.d.ts.map +1 -1
  176. package/resources/index.js +11 -1
  177. package/resources/index.js.map +1 -1
  178. package/resources/index.mjs +5 -0
  179. package/resources/index.mjs.map +1 -1
  180. package/resources/introspect.d.mts +74 -1
  181. package/resources/introspect.d.mts.map +1 -1
  182. package/resources/introspect.d.ts +74 -1
  183. package/resources/introspect.d.ts.map +1 -1
  184. package/resources/introspect.js +22 -0
  185. package/resources/introspect.js.map +1 -1
  186. package/resources/introspect.mjs +22 -0
  187. package/resources/introspect.mjs.map +1 -1
  188. package/resources/messages.d.mts +89 -1
  189. package/resources/messages.d.mts.map +1 -1
  190. package/resources/messages.d.ts +89 -1
  191. package/resources/messages.d.ts.map +1 -1
  192. package/resources/messages.js +48 -0
  193. package/resources/messages.js.map +1 -1
  194. package/resources/messages.mjs +48 -0
  195. package/resources/messages.mjs.map +1 -1
  196. package/resources/number-10dlc/brands.d.mts +10 -5
  197. package/resources/number-10dlc/brands.d.mts.map +1 -1
  198. package/resources/number-10dlc/brands.d.ts +10 -5
  199. package/resources/number-10dlc/brands.d.ts.map +1 -1
  200. package/resources/number-10dlc/brands.js +10 -5
  201. package/resources/number-10dlc/brands.js.map +1 -1
  202. package/resources/number-10dlc/brands.mjs +10 -5
  203. package/resources/number-10dlc/brands.mjs.map +1 -1
  204. package/resources/number-10dlc/campaigns/campaigns.d.mts +8 -7
  205. package/resources/number-10dlc/campaigns/campaigns.d.mts.map +1 -1
  206. package/resources/number-10dlc/campaigns/campaigns.d.ts +8 -7
  207. package/resources/number-10dlc/campaigns/campaigns.d.ts.map +1 -1
  208. package/resources/number-10dlc/campaigns/campaigns.js +8 -7
  209. package/resources/number-10dlc/campaigns/campaigns.js.map +1 -1
  210. package/resources/number-10dlc/campaigns/campaigns.mjs +8 -7
  211. package/resources/number-10dlc/campaigns/campaigns.mjs.map +1 -1
  212. package/resources/phone-numbers.d.mts +6 -1
  213. package/resources/phone-numbers.d.mts.map +1 -1
  214. package/resources/phone-numbers.d.ts +6 -1
  215. package/resources/phone-numbers.d.ts.map +1 -1
  216. package/resources/senders/agent/agent.d.mts +4 -3
  217. package/resources/senders/agent/agent.d.mts.map +1 -1
  218. package/resources/senders/agent/agent.d.ts +4 -3
  219. package/resources/senders/agent/agent.d.ts.map +1 -1
  220. package/resources/senders/agent/agent.js +2 -2
  221. package/resources/senders/agent/agent.js.map +1 -1
  222. package/resources/senders/agent/agent.mjs +2 -2
  223. package/resources/senders/agent/agent.mjs.map +1 -1
  224. package/resources/senders/agent/index.d.mts +2 -2
  225. package/resources/senders/agent/index.d.mts.map +1 -1
  226. package/resources/senders/agent/index.d.ts +2 -2
  227. package/resources/senders/agent/index.d.ts.map +1 -1
  228. package/resources/senders/agent/index.js +2 -2
  229. package/resources/senders/agent/index.js.map +1 -1
  230. package/resources/senders/agent/index.mjs +1 -1
  231. package/resources/senders/agent/index.mjs.map +1 -1
  232. package/resources/senders/agent/knowledge-bases/documents.d.mts +56 -1
  233. package/resources/senders/agent/knowledge-bases/documents.d.mts.map +1 -1
  234. package/resources/senders/agent/knowledge-bases/documents.d.ts +56 -1
  235. package/resources/senders/agent/knowledge-bases/documents.d.ts.map +1 -1
  236. package/resources/senders/agent/knowledge-bases/documents.js +33 -0
  237. package/resources/senders/agent/knowledge-bases/documents.js.map +1 -1
  238. package/resources/senders/agent/knowledge-bases/documents.mjs +33 -0
  239. package/resources/senders/agent/knowledge-bases/documents.mjs.map +1 -1
  240. package/resources/senders/agent/knowledge-bases/index.d.mts +1 -1
  241. package/resources/senders/agent/knowledge-bases/index.d.mts.map +1 -1
  242. package/resources/senders/agent/knowledge-bases/index.d.ts +1 -1
  243. package/resources/senders/agent/knowledge-bases/index.d.ts.map +1 -1
  244. package/resources/senders/agent/knowledge-bases/index.js.map +1 -1
  245. package/resources/senders/agent/knowledge-bases/index.mjs.map +1 -1
  246. package/resources/senders/agent/knowledge-bases/knowledge-bases.d.mts +2 -2
  247. package/resources/senders/agent/knowledge-bases/knowledge-bases.d.mts.map +1 -1
  248. package/resources/senders/agent/knowledge-bases/knowledge-bases.d.ts +2 -2
  249. package/resources/senders/agent/knowledge-bases/knowledge-bases.d.ts.map +1 -1
  250. package/resources/senders/agent/knowledge-bases/knowledge-bases.js.map +1 -1
  251. package/resources/senders/agent/knowledge-bases/knowledge-bases.mjs.map +1 -1
  252. package/resources/senders/agent/tools/index.d.mts +3 -0
  253. package/resources/senders/agent/tools/index.d.mts.map +1 -0
  254. package/resources/senders/agent/tools/index.d.ts +3 -0
  255. package/resources/senders/agent/tools/index.d.ts.map +1 -0
  256. package/resources/senders/agent/tools/index.js +9 -0
  257. package/resources/senders/agent/tools/index.js.map +1 -0
  258. package/resources/senders/agent/tools/index.mjs +4 -0
  259. package/resources/senders/agent/tools/index.mjs.map +1 -0
  260. package/resources/senders/agent/tools/tools.d.mts +338 -0
  261. package/resources/senders/agent/tools/tools.d.mts.map +1 -0
  262. package/resources/senders/agent/tools/tools.d.ts +338 -0
  263. package/resources/senders/agent/tools/tools.d.ts.map +1 -0
  264. package/resources/senders/agent/tools/tools.js +163 -0
  265. package/resources/senders/agent/tools/tools.js.map +1 -0
  266. package/resources/senders/agent/tools/tools.mjs +158 -0
  267. package/resources/senders/agent/tools/tools.mjs.map +1 -0
  268. package/resources/senders/agent/tools/webhook.d.mts +28 -0
  269. package/resources/senders/agent/tools/webhook.d.mts.map +1 -0
  270. package/resources/senders/agent/tools/webhook.d.ts +28 -0
  271. package/resources/senders/agent/tools/webhook.d.ts.map +1 -0
  272. package/resources/senders/agent/tools/webhook.js +28 -0
  273. package/resources/senders/agent/tools/webhook.js.map +1 -0
  274. package/resources/senders/agent/tools/webhook.mjs +24 -0
  275. package/resources/senders/agent/tools/webhook.mjs.map +1 -0
  276. package/resources/senders/agent/tools.d.mts +1 -270
  277. package/resources/senders/agent/tools.d.mts.map +1 -1
  278. package/resources/senders/agent/tools.d.ts +1 -270
  279. package/resources/senders/agent/tools.d.ts.map +1 -1
  280. package/resources/senders/agent/tools.js +2 -131
  281. package/resources/senders/agent/tools.js.map +1 -1
  282. package/resources/senders/agent/tools.mjs +1 -129
  283. package/resources/senders/agent/tools.mjs.map +1 -1
  284. package/resources/senders/index.d.mts +2 -1
  285. package/resources/senders/index.d.mts.map +1 -1
  286. package/resources/senders/index.d.ts +2 -1
  287. package/resources/senders/index.d.ts.map +1 -1
  288. package/resources/senders/index.js +3 -1
  289. package/resources/senders/index.js.map +1 -1
  290. package/resources/senders/index.mjs +1 -0
  291. package/resources/senders/index.mjs.map +1 -1
  292. package/resources/senders/senders.d.mts +4 -0
  293. package/resources/senders/senders.d.mts.map +1 -1
  294. package/resources/senders/senders.d.ts +4 -0
  295. package/resources/senders/senders.d.ts.map +1 -1
  296. package/resources/senders/senders.js +4 -0
  297. package/resources/senders/senders.js.map +1 -1
  298. package/resources/senders/senders.mjs +4 -0
  299. package/resources/senders/senders.mjs.map +1 -1
  300. package/resources/senders/telegram.d.mts +48 -0
  301. package/resources/senders/telegram.d.mts.map +1 -0
  302. package/resources/senders/telegram.d.ts +48 -0
  303. package/resources/senders/telegram.d.ts.map +1 -0
  304. package/resources/senders/telegram.js +41 -0
  305. package/resources/senders/telegram.js.map +1 -0
  306. package/resources/senders/telegram.mjs +37 -0
  307. package/resources/senders/telegram.mjs.map +1 -0
  308. package/resources/templates.d.mts +66 -1
  309. package/resources/templates.d.mts.map +1 -1
  310. package/resources/templates.d.ts +66 -1
  311. package/resources/templates.d.ts.map +1 -1
  312. package/resources/templates.js +31 -0
  313. package/resources/templates.js.map +1 -1
  314. package/resources/templates.mjs +31 -0
  315. package/resources/templates.mjs.map +1 -1
  316. package/resources/urls.d.mts +24 -1
  317. package/resources/urls.d.mts.map +1 -1
  318. package/resources/urls.d.ts +24 -1
  319. package/resources/urls.d.ts.map +1 -1
  320. package/resources/urls.js +15 -0
  321. package/resources/urls.js.map +1 -1
  322. package/resources/urls.mjs +15 -0
  323. package/resources/urls.mjs.map +1 -1
  324. package/src/client.ts +129 -3
  325. package/src/internal/qs/LICENSE.md +13 -0
  326. package/src/internal/qs/README.md +3 -0
  327. package/src/internal/qs/formats.ts +10 -0
  328. package/src/internal/qs/index.ts +13 -0
  329. package/src/internal/qs/stringify.ts +385 -0
  330. package/src/internal/qs/types.ts +71 -0
  331. package/src/internal/qs/utils.ts +265 -0
  332. package/src/internal/utils/query.ts +2 -18
  333. package/src/resources/agent-templates.ts +128 -0
  334. package/src/resources/agents/agents.ts +603 -0
  335. package/src/resources/agents/index.ts +21 -0
  336. package/src/resources/agents/senders.ts +79 -0
  337. package/src/resources/agents.ts +3 -0
  338. package/src/resources/broadcasts/broadcasts.ts +16 -9
  339. package/src/resources/calls.ts +647 -0
  340. package/src/resources/contacts/contacts.ts +35 -20
  341. package/src/resources/conversations.ts +472 -0
  342. package/src/resources/email-domains.ts +337 -0
  343. package/src/resources/functions/functions.ts +202 -0
  344. package/src/resources/functions/git-link.ts +398 -0
  345. package/src/resources/functions/index.ts +22 -0
  346. package/src/resources/functions/triggers.ts +227 -0
  347. package/src/resources/index.ts +57 -0
  348. package/src/resources/introspect.ts +105 -0
  349. package/src/resources/messages.ts +102 -0
  350. package/src/resources/number-10dlc/brands.ts +10 -5
  351. package/src/resources/number-10dlc/campaigns/campaigns.ts +8 -7
  352. package/src/resources/phone-numbers.ts +6 -1
  353. package/src/resources/senders/agent/agent.ts +23 -17
  354. package/src/resources/senders/agent/index.ts +4 -1
  355. package/src/resources/senders/agent/knowledge-bases/documents.ts +89 -0
  356. package/src/resources/senders/agent/knowledge-bases/index.ts +4 -0
  357. package/src/resources/senders/agent/knowledge-bases/knowledge-bases.ts +8 -0
  358. package/src/resources/senders/agent/tools/index.ts +21 -0
  359. package/src/resources/senders/agent/tools/tools.ts +460 -0
  360. package/src/resources/senders/agent/tools/webhook.ts +40 -0
  361. package/src/resources/senders/agent/tools.ts +1 -364
  362. package/src/resources/senders/index.ts +2 -0
  363. package/src/resources/senders/senders.ts +10 -0
  364. package/src/resources/senders/telegram.ts +73 -0
  365. package/src/resources/templates.ts +80 -0
  366. package/src/resources/urls.ts +35 -0
  367. package/src/version.ts +1 -1
  368. package/version.d.mts +1 -1
  369. package/version.d.ts +1 -1
  370. package/version.js +1 -1
  371. package/version.mjs +1 -1
@@ -153,15 +153,22 @@ export class Broadcasts extends APIResource {
153
153
  /**
154
154
  * Start sending the broadcast immediately or schedule for later.
155
155
  *
156
- * **Verification is required to send, except on WhatsApp.** On every channel other
157
- * than `whatsapp`, the team must have completed both identity verification (KYC)
158
- * and business verification (KYB); passing one is not enough. A `whatsapp`
159
- * broadcast requires neither: it can only be built on a template, and Meta vets
160
- * the business and the content when it approves that template, so an unapproved
161
- * template is refused instead. `smart` is not exempt — it can route a contact to
162
- * SMS or email. Drafts can be created, edited and kept without any check. Every
163
- * send path — dashboard, API and CLI alike — enforces the same rule, returning
164
- * `403` with code `kyc_required` or `kyb_required` for whichever is outstanding.
156
+ * **The account must be past the unverified level to send, except on WhatsApp.**
157
+ * An account that has verified nothing is refused with `403` and code
158
+ * `kyc_required` on every channel other than `whatsapp`. Any one of these lifts
159
+ * it: identity verification (KYC), a saved payment method, a settled deposit, or a
160
+ * paid plan. Business verification (KYB) is not required to broadcast; it gates
161
+ * 10DLC registration only. A `whatsapp` broadcast is exempt: it can only be built
162
+ * on a template, and Meta vets the business and the content when it approves that
163
+ * template, so an unapproved template is refused instead. `smart` is not exempt,
164
+ * since it can route a contact to SMS or email. Drafts can be created, edited and
165
+ * kept without any check. Every send path (dashboard, API and CLI) enforces the
166
+ * same rule.
167
+ *
168
+ * **Daily ceilings apply per recipient.** Each message a broadcast sends counts
169
+ * against the channel's daily ceiling (see `POST /v1/messages`). Once the ceiling
170
+ * is reached, the remaining recipients are marked `failed` with `errorCode`
171
+ * `DAILY_LIMIT_EXCEEDED`; they are not retried the next day.
165
172
  *
166
173
  * **Review depends on the channel, and cannot be bypassed.** A draft is submitted
167
174
  * to automated content review here; it does not go straight out. A WhatsApp
@@ -1 +1 @@
1
- {"version":3,"file":"broadcasts.mjs","sourceRoot":"","sources":["../../src/resources/broadcasts/broadcasts.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,WAAW,uBAAmB;AAC1C,OAAO,EAKL,QAAQ,GACT,uBAAmB;AAEpB,OAAO,EAAE,MAAM,EAAkC,kCAA8B;AAC/E,OAAO,EAAE,YAAY,EAAE,mCAA+B;AAEtD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD,MAAM,OAAO,UAAW,SAAQ,WAAW;IAA3C;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA0M1E,CAAC;IAxMC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAA2B,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,WAAmB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,kBAAkB,WAAW,EAAE,EAAE,OAAO,CAAC,CAAC;IACxE,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CACJ,WAAmB,EACnB,IAA2B,EAC3B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,kBAAkB,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAA,M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;;;;;;;;OAWG;IACH,UAAU,CACR,WAAmB,EACnB,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,kBAAkB,WAAW,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChG,CAAC;IAED;;;;;;;;;;OAUG;IACH,WAAW,CAAC,WAAmB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,kBAAkB,WAAW,eAAe,EAAE,OAAO,CAAC,CAAC;IACtF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,IAAI,CACF,WAAmB,EACnB,OAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,kBAAkB,WAAW,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3F,CAAC;CACF;AAqaD,UAAU,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
@@ -0,0 +1,539 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import { APIPromise } from "../core/api-promise.mjs";
3
+ import { Cursor, type CursorParams, PagePromise } from "../core/pagination.mjs";
4
+ import { RequestOptions } from "../internal/request-options.mjs";
5
+ export declare class Calls extends APIResource {
6
+ /**
7
+ * Place an outbound voice call answered by the voice agent configured on the
8
+ * sender. Zavu dials the recipient and runs the conversation through its managed
9
+ * voice pipeline (speech recognition, the agent's LLM, and speech synthesis, with
10
+ * real-time interruption handling).
11
+ *
12
+ * **Requirements:**
13
+ *
14
+ * - The Voice Agents feature must be enabled for your team (otherwise `403`).
15
+ * - An account that has verified nothing may only call the phone numbers the
16
+ * project has verified (`403` with code `destination_not_verified`, and
17
+ * `details.verifiedNumbers` lists them), and at most 5 calls a day (`429` with
18
+ * code `daily_limit_exceeded`). A number is verified from the dashboard's
19
+ * Sandbox screen by sending the pre-filled WhatsApp message from that phone; the
20
+ * same verification covers SMS and calls. Verify your identity, add a payment
21
+ * method, settle a deposit or subscribe to call any destination. That raises the
22
+ * ceiling to 50 calls a day on Free; paid plans have no daily call ceiling. Full
23
+ * reference: https://docs.zavu.dev/concepts/sending-limits
24
+ * - The sender's agent must have `voice.enabled` set to `true`.
25
+ * - Not available with test-mode API keys.
26
+ *
27
+ * **Billing:** Voice calls are billed per minute of connected time plus telephony,
28
+ * deducted from your prepaid balance. A short-duration estimate is reserved when
29
+ * the call is placed; you are charged for the actual duration when the call ends.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const call = await client.calls.create({
34
+ * to: '+56912345678',
35
+ * });
36
+ * ```
37
+ */
38
+ create(body: CallCreateParams, options?: RequestOptions): APIPromise<CallCreateResponse>;
39
+ /**
40
+ * Retrieve a single voice call, including its full transcript once the
41
+ * conversation has produced turns.
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * const call = await client.calls.retrieve('callId');
46
+ * ```
47
+ */
48
+ retrieve(callID: string, options?: RequestOptions): APIPromise<CallRetrieveResponse>;
49
+ /**
50
+ * List voice calls for this project, most recent first. Transcripts are omitted
51
+ * from the list; fetch a single call to get its transcript.
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * // Automatically fetches more pages as needed.
56
+ * for await (const callListResponse of client.calls.list()) {
57
+ * // ...
58
+ * }
59
+ * ```
60
+ */
61
+ list(query?: CallListParams | null | undefined, options?: RequestOptions): PagePromise<CallListResponsesCursor, CallListResponse>;
62
+ /**
63
+ * End an active voice call. The call must still be ringing or in progress. Not
64
+ * available with test-mode API keys.
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * const response = await client.calls.hangup('callId');
69
+ * ```
70
+ */
71
+ hangup(callID: string, options?: RequestOptions): APIPromise<CallHangupResponse>;
72
+ }
73
+ export type CallListResponsesCursor = Cursor<CallListResponse>;
74
+ export interface CallCreateResponse {
75
+ call: CallCreateResponse.Call;
76
+ }
77
+ export declare namespace CallCreateResponse {
78
+ interface Call {
79
+ id: string;
80
+ createdAt: string;
81
+ /**
82
+ * Whether the call was placed by Zavu (outbound) or received from a caller
83
+ * (inbound).
84
+ */
85
+ direction: 'inbound' | 'outbound';
86
+ /**
87
+ * Caller phone number in E.164 format. Your sender's number for outbound calls;
88
+ * the caller's number for inbound calls.
89
+ */
90
+ from: string;
91
+ /**
92
+ * Lifecycle status of a voice call.
93
+ *
94
+ * - `queued`: outbound call created, not yet dialing.
95
+ * - `ringing`: dialing (outbound) or received and ringing (inbound).
96
+ * - `in_progress`: answered, the agent is connected.
97
+ * - `completed`: ended after a conversation.
98
+ * - `failed`: could not be completed.
99
+ * - `busy`: the line was busy.
100
+ * - `no_answer`: rang but was not answered.
101
+ * - `canceled`: canceled before it was answered.
102
+ */
103
+ status: 'queued' | 'ringing' | 'in_progress' | 'completed' | 'failed' | 'busy' | 'no_answer' | 'canceled';
104
+ /**
105
+ * Callee phone number in E.164 format.
106
+ */
107
+ to: string;
108
+ /**
109
+ * When the call was answered.
110
+ */
111
+ answeredAt?: string | null;
112
+ /**
113
+ * Total cost of the call in USD, combining the managed voice pipeline per-minute
114
+ * charge and telephony. Available once the call has ended.
115
+ */
116
+ cost?: number | null;
117
+ /**
118
+ * Billable talk time in seconds, measured from answer to hangup.
119
+ */
120
+ durationSeconds?: number | null;
121
+ /**
122
+ * When the call ended.
123
+ */
124
+ endedAt?: string | null;
125
+ /**
126
+ * Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`).
127
+ * Present once the call is no longer active.
128
+ */
129
+ endReason?: string | null;
130
+ /**
131
+ * Arbitrary metadata you attached when creating the call.
132
+ */
133
+ metadata?: {
134
+ [key: string]: string;
135
+ };
136
+ /**
137
+ * Ordered transcript of the call. Included when retrieving a single call; omitted
138
+ * from list responses.
139
+ */
140
+ transcript?: Array<Call.Transcript>;
141
+ /**
142
+ * Number of conversation turns exchanged during the call.
143
+ */
144
+ turnCount?: number | null;
145
+ updatedAt?: string;
146
+ }
147
+ namespace Call {
148
+ /**
149
+ * A single turn in a voice call transcript.
150
+ */
151
+ interface Transcript {
152
+ /**
153
+ * Who produced the turn. `tool` records a tool call the agent made during the
154
+ * conversation.
155
+ */
156
+ role: 'user' | 'assistant' | 'tool';
157
+ /**
158
+ * Ordinal position of the turn within the call, starting at 0.
159
+ */
160
+ seq: number;
161
+ /**
162
+ * Transcribed speech for `user` and `assistant` turns, or a JSON summary of the
163
+ * tool call for `tool` turns.
164
+ */
165
+ text: string;
166
+ /**
167
+ * When the turn ended.
168
+ */
169
+ endedAt?: string | null;
170
+ /**
171
+ * When the turn started.
172
+ */
173
+ startedAt?: string | null;
174
+ }
175
+ }
176
+ }
177
+ export interface CallRetrieveResponse {
178
+ call: CallRetrieveResponse.Call;
179
+ }
180
+ export declare namespace CallRetrieveResponse {
181
+ interface Call {
182
+ id: string;
183
+ createdAt: string;
184
+ /**
185
+ * Whether the call was placed by Zavu (outbound) or received from a caller
186
+ * (inbound).
187
+ */
188
+ direction: 'inbound' | 'outbound';
189
+ /**
190
+ * Caller phone number in E.164 format. Your sender's number for outbound calls;
191
+ * the caller's number for inbound calls.
192
+ */
193
+ from: string;
194
+ /**
195
+ * Lifecycle status of a voice call.
196
+ *
197
+ * - `queued`: outbound call created, not yet dialing.
198
+ * - `ringing`: dialing (outbound) or received and ringing (inbound).
199
+ * - `in_progress`: answered, the agent is connected.
200
+ * - `completed`: ended after a conversation.
201
+ * - `failed`: could not be completed.
202
+ * - `busy`: the line was busy.
203
+ * - `no_answer`: rang but was not answered.
204
+ * - `canceled`: canceled before it was answered.
205
+ */
206
+ status: 'queued' | 'ringing' | 'in_progress' | 'completed' | 'failed' | 'busy' | 'no_answer' | 'canceled';
207
+ /**
208
+ * Callee phone number in E.164 format.
209
+ */
210
+ to: string;
211
+ /**
212
+ * When the call was answered.
213
+ */
214
+ answeredAt?: string | null;
215
+ /**
216
+ * Total cost of the call in USD, combining the managed voice pipeline per-minute
217
+ * charge and telephony. Available once the call has ended.
218
+ */
219
+ cost?: number | null;
220
+ /**
221
+ * Billable talk time in seconds, measured from answer to hangup.
222
+ */
223
+ durationSeconds?: number | null;
224
+ /**
225
+ * When the call ended.
226
+ */
227
+ endedAt?: string | null;
228
+ /**
229
+ * Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`).
230
+ * Present once the call is no longer active.
231
+ */
232
+ endReason?: string | null;
233
+ /**
234
+ * Arbitrary metadata you attached when creating the call.
235
+ */
236
+ metadata?: {
237
+ [key: string]: string;
238
+ };
239
+ /**
240
+ * Ordered transcript of the call. Included when retrieving a single call; omitted
241
+ * from list responses.
242
+ */
243
+ transcript?: Array<Call.Transcript>;
244
+ /**
245
+ * Number of conversation turns exchanged during the call.
246
+ */
247
+ turnCount?: number | null;
248
+ updatedAt?: string;
249
+ }
250
+ namespace Call {
251
+ /**
252
+ * A single turn in a voice call transcript.
253
+ */
254
+ interface Transcript {
255
+ /**
256
+ * Who produced the turn. `tool` records a tool call the agent made during the
257
+ * conversation.
258
+ */
259
+ role: 'user' | 'assistant' | 'tool';
260
+ /**
261
+ * Ordinal position of the turn within the call, starting at 0.
262
+ */
263
+ seq: number;
264
+ /**
265
+ * Transcribed speech for `user` and `assistant` turns, or a JSON summary of the
266
+ * tool call for `tool` turns.
267
+ */
268
+ text: string;
269
+ /**
270
+ * When the turn ended.
271
+ */
272
+ endedAt?: string | null;
273
+ /**
274
+ * When the turn started.
275
+ */
276
+ startedAt?: string | null;
277
+ }
278
+ }
279
+ }
280
+ export interface CallListResponse {
281
+ id: string;
282
+ createdAt: string;
283
+ /**
284
+ * Whether the call was placed by Zavu (outbound) or received from a caller
285
+ * (inbound).
286
+ */
287
+ direction: 'inbound' | 'outbound';
288
+ /**
289
+ * Caller phone number in E.164 format. Your sender's number for outbound calls;
290
+ * the caller's number for inbound calls.
291
+ */
292
+ from: string;
293
+ /**
294
+ * Lifecycle status of a voice call.
295
+ *
296
+ * - `queued`: outbound call created, not yet dialing.
297
+ * - `ringing`: dialing (outbound) or received and ringing (inbound).
298
+ * - `in_progress`: answered, the agent is connected.
299
+ * - `completed`: ended after a conversation.
300
+ * - `failed`: could not be completed.
301
+ * - `busy`: the line was busy.
302
+ * - `no_answer`: rang but was not answered.
303
+ * - `canceled`: canceled before it was answered.
304
+ */
305
+ status: 'queued' | 'ringing' | 'in_progress' | 'completed' | 'failed' | 'busy' | 'no_answer' | 'canceled';
306
+ /**
307
+ * Callee phone number in E.164 format.
308
+ */
309
+ to: string;
310
+ /**
311
+ * When the call was answered.
312
+ */
313
+ answeredAt?: string | null;
314
+ /**
315
+ * Total cost of the call in USD, combining the managed voice pipeline per-minute
316
+ * charge and telephony. Available once the call has ended.
317
+ */
318
+ cost?: number | null;
319
+ /**
320
+ * Billable talk time in seconds, measured from answer to hangup.
321
+ */
322
+ durationSeconds?: number | null;
323
+ /**
324
+ * When the call ended.
325
+ */
326
+ endedAt?: string | null;
327
+ /**
328
+ * Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`).
329
+ * Present once the call is no longer active.
330
+ */
331
+ endReason?: string | null;
332
+ /**
333
+ * Arbitrary metadata you attached when creating the call.
334
+ */
335
+ metadata?: {
336
+ [key: string]: string;
337
+ };
338
+ /**
339
+ * Ordered transcript of the call. Included when retrieving a single call; omitted
340
+ * from list responses.
341
+ */
342
+ transcript?: Array<CallListResponse.Transcript>;
343
+ /**
344
+ * Number of conversation turns exchanged during the call.
345
+ */
346
+ turnCount?: number | null;
347
+ updatedAt?: string;
348
+ }
349
+ export declare namespace CallListResponse {
350
+ /**
351
+ * A single turn in a voice call transcript.
352
+ */
353
+ interface Transcript {
354
+ /**
355
+ * Who produced the turn. `tool` records a tool call the agent made during the
356
+ * conversation.
357
+ */
358
+ role: 'user' | 'assistant' | 'tool';
359
+ /**
360
+ * Ordinal position of the turn within the call, starting at 0.
361
+ */
362
+ seq: number;
363
+ /**
364
+ * Transcribed speech for `user` and `assistant` turns, or a JSON summary of the
365
+ * tool call for `tool` turns.
366
+ */
367
+ text: string;
368
+ /**
369
+ * When the turn ended.
370
+ */
371
+ endedAt?: string | null;
372
+ /**
373
+ * When the turn started.
374
+ */
375
+ startedAt?: string | null;
376
+ }
377
+ }
378
+ export interface CallHangupResponse {
379
+ call: CallHangupResponse.Call;
380
+ }
381
+ export declare namespace CallHangupResponse {
382
+ interface Call {
383
+ id: string;
384
+ createdAt: string;
385
+ /**
386
+ * Whether the call was placed by Zavu (outbound) or received from a caller
387
+ * (inbound).
388
+ */
389
+ direction: 'inbound' | 'outbound';
390
+ /**
391
+ * Caller phone number in E.164 format. Your sender's number for outbound calls;
392
+ * the caller's number for inbound calls.
393
+ */
394
+ from: string;
395
+ /**
396
+ * Lifecycle status of a voice call.
397
+ *
398
+ * - `queued`: outbound call created, not yet dialing.
399
+ * - `ringing`: dialing (outbound) or received and ringing (inbound).
400
+ * - `in_progress`: answered, the agent is connected.
401
+ * - `completed`: ended after a conversation.
402
+ * - `failed`: could not be completed.
403
+ * - `busy`: the line was busy.
404
+ * - `no_answer`: rang but was not answered.
405
+ * - `canceled`: canceled before it was answered.
406
+ */
407
+ status: 'queued' | 'ringing' | 'in_progress' | 'completed' | 'failed' | 'busy' | 'no_answer' | 'canceled';
408
+ /**
409
+ * Callee phone number in E.164 format.
410
+ */
411
+ to: string;
412
+ /**
413
+ * When the call was answered.
414
+ */
415
+ answeredAt?: string | null;
416
+ /**
417
+ * Total cost of the call in USD, combining the managed voice pipeline per-minute
418
+ * charge and telephony. Available once the call has ended.
419
+ */
420
+ cost?: number | null;
421
+ /**
422
+ * Billable talk time in seconds, measured from answer to hangup.
423
+ */
424
+ durationSeconds?: number | null;
425
+ /**
426
+ * When the call ended.
427
+ */
428
+ endedAt?: string | null;
429
+ /**
430
+ * Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`).
431
+ * Present once the call is no longer active.
432
+ */
433
+ endReason?: string | null;
434
+ /**
435
+ * Arbitrary metadata you attached when creating the call.
436
+ */
437
+ metadata?: {
438
+ [key: string]: string;
439
+ };
440
+ /**
441
+ * Ordered transcript of the call. Included when retrieving a single call; omitted
442
+ * from list responses.
443
+ */
444
+ transcript?: Array<Call.Transcript>;
445
+ /**
446
+ * Number of conversation turns exchanged during the call.
447
+ */
448
+ turnCount?: number | null;
449
+ updatedAt?: string;
450
+ }
451
+ namespace Call {
452
+ /**
453
+ * A single turn in a voice call transcript.
454
+ */
455
+ interface Transcript {
456
+ /**
457
+ * Who produced the turn. `tool` records a tool call the agent made during the
458
+ * conversation.
459
+ */
460
+ role: 'user' | 'assistant' | 'tool';
461
+ /**
462
+ * Ordinal position of the turn within the call, starting at 0.
463
+ */
464
+ seq: number;
465
+ /**
466
+ * Transcribed speech for `user` and `assistant` turns, or a JSON summary of the
467
+ * tool call for `tool` turns.
468
+ */
469
+ text: string;
470
+ /**
471
+ * When the turn ended.
472
+ */
473
+ endedAt?: string | null;
474
+ /**
475
+ * When the turn started.
476
+ */
477
+ startedAt?: string | null;
478
+ }
479
+ }
480
+ }
481
+ export interface CallCreateParams {
482
+ /**
483
+ * Recipient phone number in E.164 format.
484
+ */
485
+ to: string;
486
+ /**
487
+ * Overrides the agent's configured greeting for this call only.
488
+ */
489
+ greeting?: string;
490
+ /**
491
+ * Language the agent speaks on this call only, as a BCP-47 tag (`en`, `es`,
492
+ * `es-ES`, `pt-BR`), or `auto` to detect the caller's language and follow it.
493
+ * Overrides the agent's configured language for speech recognition, the agent's
494
+ * replies, and the synthesized voice. If the agent uses a custom voice you
495
+ * supplied, that voice is kept and only the language changes. When omitted, the
496
+ * agent's configured language is used.
497
+ */
498
+ language?: string;
499
+ /**
500
+ * Overrides the agent's maximum call duration for this call only.
501
+ */
502
+ maxDurationMinutes?: number;
503
+ /**
504
+ * Arbitrary metadata to associate with the call. Returned on the call object and
505
+ * included in voice webhooks.
506
+ */
507
+ metadata?: {
508
+ [key: string]: string;
509
+ };
510
+ /**
511
+ * Sender profile that places the call. Uses the project's default sender if
512
+ * omitted. The sender's agent must have voice enabled.
513
+ */
514
+ senderId?: string;
515
+ }
516
+ export interface CallListParams extends CursorParams {
517
+ /**
518
+ * Whether the call was placed by Zavu (outbound) or received from a caller
519
+ * (inbound).
520
+ */
521
+ direction?: 'inbound' | 'outbound';
522
+ /**
523
+ * Lifecycle status of a voice call.
524
+ *
525
+ * - `queued`: outbound call created, not yet dialing.
526
+ * - `ringing`: dialing (outbound) or received and ringing (inbound).
527
+ * - `in_progress`: answered, the agent is connected.
528
+ * - `completed`: ended after a conversation.
529
+ * - `failed`: could not be completed.
530
+ * - `busy`: the line was busy.
531
+ * - `no_answer`: rang but was not answered.
532
+ * - `canceled`: canceled before it was answered.
533
+ */
534
+ status?: 'queued' | 'ringing' | 'in_progress' | 'completed' | 'failed' | 'busy' | 'no_answer' | 'canceled';
535
+ }
536
+ export declare namespace Calls {
537
+ export { type CallCreateResponse as CallCreateResponse, type CallRetrieveResponse as CallRetrieveResponse, type CallListResponse as CallListResponse, type CallHangupResponse as CallHangupResponse, type CallListResponsesCursor as CallListResponsesCursor, type CallCreateParams as CallCreateParams, type CallListParams as CallListParams, };
538
+ }
539
+ //# sourceMappingURL=calls.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calls.d.mts","sourceRoot":"","sources":["../src/resources/calls.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE,+BAA2B;AAC5E,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAG7D,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,MAAM,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAIxF;;;;;;;;OAQG;IACH,QAAQ,CAAC,M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