@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
package/src/client.ts CHANGED
@@ -29,9 +29,43 @@ import {
29
29
  Addresses,
30
30
  AddressesCursor,
31
31
  } from './resources/addresses';
32
+ import {
33
+ AgentTemplateListResponse,
34
+ AgentTemplateRetrieveResponse,
35
+ AgentTemplates,
36
+ } from './resources/agent-templates';
32
37
  import { Balance, BalanceRetrieveResponse } from './resources/balance';
38
+ import {
39
+ CallCreateParams,
40
+ CallCreateResponse,
41
+ CallHangupResponse,
42
+ CallListParams,
43
+ CallListResponse,
44
+ CallListResponsesCursor,
45
+ CallRetrieveResponse,
46
+ Calls,
47
+ } from './resources/calls';
48
+ import {
49
+ ConversationListMessagesParams,
50
+ ConversationListParams,
51
+ ConversationListResponse,
52
+ ConversationListResponsesCursor,
53
+ ConversationMarkAsReadResponse,
54
+ ConversationRetrieveResponse,
55
+ Conversations,
56
+ } from './resources/conversations';
57
+ import {
58
+ EmailDomainCreateParams,
59
+ EmailDomainCreateResponse,
60
+ EmailDomainListResponse,
61
+ EmailDomainRetrieveResponse,
62
+ EmailDomainVerifyResponse,
63
+ EmailDomains,
64
+ } from './resources/email-domains';
33
65
  import {
34
66
  Introspect,
67
+ IntrospectValidateEmailParams,
68
+ IntrospectValidateEmailResponse,
35
69
  IntrospectValidatePhoneParams,
36
70
  IntrospectValidatePhoneResponse,
37
71
  LineType,
@@ -51,6 +85,7 @@ import {
51
85
  Channel,
52
86
  Message,
53
87
  MessageContent,
88
+ MessageListAttachmentsResponse,
54
89
  MessageListParams,
55
90
  MessageReactParams,
56
91
  MessageResponse,
@@ -102,11 +137,15 @@ import {
102
137
  TemplateCreateParams,
103
138
  TemplateListParams,
104
139
  TemplateSubmitParams,
140
+ TemplateSyncParams,
141
+ TemplateSyncResponse,
105
142
  Templates,
106
143
  TemplatesCursor,
107
144
  WhatsappCategory,
108
145
  } from './resources/templates';
109
146
  import {
147
+ URLEscalateParams,
148
+ URLEscalateResponse,
110
149
  URLListVerifiedParams,
111
150
  URLRetrieveDetailsResponse,
112
151
  URLSubmitForVerificationParams,
@@ -115,6 +154,19 @@ import {
115
154
  VerifiedURL,
116
155
  VerifiedURLsCursor,
117
156
  } from './resources/urls';
157
+ import {
158
+ AgentCreateParams,
159
+ AgentCreateResponse,
160
+ AgentListParams,
161
+ AgentListVoicesParams,
162
+ AgentListVoicesResponse,
163
+ AgentRetrieveResponse,
164
+ AgentTestParams,
165
+ AgentTestResponse,
166
+ AgentUpdateParams,
167
+ AgentUpdateResponse,
168
+ Agents,
169
+ } from './resources/agents/agents';
118
170
  import {
119
171
  Broadcast,
120
172
  BroadcastCancelResponse,
@@ -157,7 +209,12 @@ import {
157
209
  FunctionDeployParams,
158
210
  FunctionDeployResponse,
159
211
  FunctionGetDeploymentResponse,
212
+ FunctionListDeploymentsParams,
213
+ FunctionListDeploymentsResponse,
214
+ FunctionListEventTypesResponse,
160
215
  FunctionRetrieveResponse,
216
+ FunctionRollbackDeploymentParams,
217
+ FunctionRollbackDeploymentResponse,
161
218
  FunctionTailLogsParams,
162
219
  FunctionTailLogsResponse,
163
220
  FunctionUpdateParams,
@@ -401,9 +458,6 @@ export class Zavudev {
401
458
  return buildHeaders([{ Authorization: `Bearer ${this.apiKey}` }]);
402
459
  }
403
460
 
404
- /**
405
- * Basic re-implementation of `qs.stringify` for primitive types.
406
- */
407
461
  protected stringifyQuery(query: object | Record<string, unknown>): string {
408
462
  return stringifyQuery(query);
409
463
  }
@@ -956,6 +1010,11 @@ export class Zavudev {
956
1010
  number10dlc: API.Number10dlc = new API.Number10dlc(this);
957
1011
  me: API.Me = new API.Me(this);
958
1012
  functions: API.Functions = new API.Functions(this);
1013
+ conversations: API.Conversations = new API.Conversations(this);
1014
+ calls: API.Calls = new API.Calls(this);
1015
+ agentTemplates: API.AgentTemplates = new API.AgentTemplates(this);
1016
+ emailDomains: API.EmailDomains = new API.EmailDomains(this);
1017
+ agents: API.Agents = new API.Agents(this);
959
1018
  }
960
1019
 
961
1020
  Zavudev.Messages = Messages;
@@ -974,6 +1033,11 @@ Zavudev.SubAccounts = SubAccounts;
974
1033
  Zavudev.Number10dlc = Number10dlc;
975
1034
  Zavudev.Me = Me;
976
1035
  Zavudev.Functions = Functions;
1036
+ Zavudev.Conversations = Conversations;
1037
+ Zavudev.Calls = Calls;
1038
+ Zavudev.AgentTemplates = AgentTemplates;
1039
+ Zavudev.EmailDomains = EmailDomains;
1040
+ Zavudev.Agents = Agents;
977
1041
 
978
1042
  export declare namespace Zavudev {
979
1043
  export type RequestOptions = Opts.RequestOptions;
@@ -989,6 +1053,7 @@ export declare namespace Zavudev {
989
1053
  type MessageResponse as MessageResponse,
990
1054
  type MessageStatus as MessageStatus,
991
1055
  type MessageType as MessageType,
1056
+ type MessageListAttachmentsResponse as MessageListAttachmentsResponse,
992
1057
  type MessageShowTypingResponse as MessageShowTypingResponse,
993
1058
  type MessagesCursor as MessagesCursor,
994
1059
  type MessageListParams as MessageListParams,
@@ -1001,10 +1066,12 @@ export declare namespace Zavudev {
1001
1066
  Templates as Templates,
1002
1067
  type Template as Template,
1003
1068
  type WhatsappCategory as WhatsappCategory,
1069
+ type TemplateSyncResponse as TemplateSyncResponse,
1004
1070
  type TemplatesCursor as TemplatesCursor,
1005
1071
  type TemplateCreateParams as TemplateCreateParams,
1006
1072
  type TemplateListParams as TemplateListParams,
1007
1073
  type TemplateSubmitParams as TemplateSubmitParams,
1074
+ type TemplateSyncParams as TemplateSyncParams,
1008
1075
  };
1009
1076
 
1010
1077
  export {
@@ -1066,7 +1133,9 @@ export declare namespace Zavudev {
1066
1133
  export {
1067
1134
  Introspect as Introspect,
1068
1135
  type LineType as LineType,
1136
+ type IntrospectValidateEmailResponse as IntrospectValidateEmailResponse,
1069
1137
  type IntrospectValidatePhoneResponse as IntrospectValidatePhoneResponse,
1138
+ type IntrospectValidateEmailParams as IntrospectValidateEmailParams,
1070
1139
  type IntrospectValidatePhoneParams as IntrospectValidatePhoneParams,
1071
1140
  };
1072
1141
 
@@ -1132,9 +1201,11 @@ export declare namespace Zavudev {
1132
1201
  export {
1133
1202
  URLs as URLs,
1134
1203
  type VerifiedURL as VerifiedURL,
1204
+ type URLEscalateResponse as URLEscalateResponse,
1135
1205
  type URLRetrieveDetailsResponse as URLRetrieveDetailsResponse,
1136
1206
  type URLSubmitForVerificationResponse as URLSubmitForVerificationResponse,
1137
1207
  type VerifiedURLsCursor as VerifiedURLsCursor,
1208
+ type URLEscalateParams as URLEscalateParams,
1138
1209
  type URLListVerifiedParams as URLListVerifiedParams,
1139
1210
  type URLSubmitForVerificationParams as URLSubmitForVerificationParams,
1140
1211
  };
@@ -1167,10 +1238,65 @@ export declare namespace Zavudev {
1167
1238
  type FunctionDeleteResponse as FunctionDeleteResponse,
1168
1239
  type FunctionDeployResponse as FunctionDeployResponse,
1169
1240
  type FunctionGetDeploymentResponse as FunctionGetDeploymentResponse,
1241
+ type FunctionListDeploymentsResponse as FunctionListDeploymentsResponse,
1242
+ type FunctionListEventTypesResponse as FunctionListEventTypesResponse,
1243
+ type FunctionRollbackDeploymentResponse as FunctionRollbackDeploymentResponse,
1170
1244
  type FunctionTailLogsResponse as FunctionTailLogsResponse,
1171
1245
  type FunctionCreateParams as FunctionCreateParams,
1172
1246
  type FunctionUpdateParams as FunctionUpdateParams,
1173
1247
  type FunctionDeployParams as FunctionDeployParams,
1248
+ type FunctionListDeploymentsParams as FunctionListDeploymentsParams,
1249
+ type FunctionRollbackDeploymentParams as FunctionRollbackDeploymentParams,
1174
1250
  type FunctionTailLogsParams as FunctionTailLogsParams,
1175
1251
  };
1252
+
1253
+ export {
1254
+ Conversations as Conversations,
1255
+ type ConversationRetrieveResponse as ConversationRetrieveResponse,
1256
+ type ConversationListResponse as ConversationListResponse,
1257
+ type ConversationMarkAsReadResponse as ConversationMarkAsReadResponse,
1258
+ type ConversationListResponsesCursor as ConversationListResponsesCursor,
1259
+ type ConversationListParams as ConversationListParams,
1260
+ type ConversationListMessagesParams as ConversationListMessagesParams,
1261
+ };
1262
+
1263
+ export {
1264
+ Calls as Calls,
1265
+ type CallCreateResponse as CallCreateResponse,
1266
+ type CallRetrieveResponse as CallRetrieveResponse,
1267
+ type CallListResponse as CallListResponse,
1268
+ type CallHangupResponse as CallHangupResponse,
1269
+ type CallListResponsesCursor as CallListResponsesCursor,
1270
+ type CallCreateParams as CallCreateParams,
1271
+ type CallListParams as CallListParams,
1272
+ };
1273
+
1274
+ export {
1275
+ AgentTemplates as AgentTemplates,
1276
+ type AgentTemplateRetrieveResponse as AgentTemplateRetrieveResponse,
1277
+ type AgentTemplateListResponse as AgentTemplateListResponse,
1278
+ };
1279
+
1280
+ export {
1281
+ EmailDomains as EmailDomains,
1282
+ type EmailDomainCreateResponse as EmailDomainCreateResponse,
1283
+ type EmailDomainRetrieveResponse as EmailDomainRetrieveResponse,
1284
+ type EmailDomainListResponse as EmailDomainListResponse,
1285
+ type EmailDomainVerifyResponse as EmailDomainVerifyResponse,
1286
+ type EmailDomainCreateParams as EmailDomainCreateParams,
1287
+ };
1288
+
1289
+ export {
1290
+ Agents as Agents,
1291
+ type AgentCreateResponse as AgentCreateResponse,
1292
+ type AgentRetrieveResponse as AgentRetrieveResponse,
1293
+ type AgentUpdateResponse as AgentUpdateResponse,
1294
+ type AgentListVoicesResponse as AgentListVoicesResponse,
1295
+ type AgentTestResponse as AgentTestResponse,
1296
+ type AgentCreateParams as AgentCreateParams,
1297
+ type AgentUpdateParams as AgentUpdateParams,
1298
+ type AgentListParams as AgentListParams,
1299
+ type AgentListVoicesParams as AgentListVoicesParams,
1300
+ type AgentTestParams as AgentTestParams,
1301
+ };
1176
1302
  }
@@ -0,0 +1,13 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/puruvj/neoqs/graphs/contributors) All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8
+
9
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
10
+
11
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
12
+
13
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,3 @@
1
+ # qs
2
+
3
+ This is a vendored version of [neoqs](https://github.com/PuruVJ/neoqs) which is a TypeScript rewrite of [qs](https://github.com/ljharb/qs), a query string library.
@@ -0,0 +1,10 @@
1
+ import type { Format } from './types';
2
+
3
+ export const default_format: Format = 'RFC3986';
4
+ export const default_formatter = (v: PropertyKey) => String(v);
5
+ export const formatters: Record<Format, (str: PropertyKey) => string> = {
6
+ RFC1738: (v: PropertyKey) => String(v).replace(/%20/g, '+'),
7
+ RFC3986: default_formatter,
8
+ };
9
+ export const RFC1738 = 'RFC1738';
10
+ export const RFC3986 = 'RFC3986';
@@ -0,0 +1,13 @@
1
+ import { default_format, formatters, RFC1738, RFC3986 } from './formats';
2
+
3
+ const formats = {
4
+ formatters,
5
+ RFC1738,
6
+ RFC3986,
7
+ default: default_format,
8
+ };
9
+
10
+ export { stringify } from './stringify';
11
+ export { formats };
12
+
13
+ export type { DefaultDecoder, DefaultEncoder, Format, ParseOptions, StringifyOptions } from './types';
@@ -0,0 +1,385 @@
1
+ import { encode, is_buffer, maybe_map, has } from './utils';
2
+ import { default_format, default_formatter, formatters } from './formats';
3
+ import type { NonNullableProperties, StringifyOptions } from './types';
4
+ import { isArray } from '../utils/values';
5
+
6
+ const array_prefix_generators = {
7
+ brackets(prefix: PropertyKey) {
8
+ return String(prefix) + '[]';
9
+ },
10
+ comma: 'comma',
11
+ indices(prefix: PropertyKey, key: string) {
12
+ return String(prefix) + '[' + key + ']';
13
+ },
14
+ repeat(prefix: PropertyKey) {
15
+ return String(prefix);
16
+ },
17
+ };
18
+
19
+ const push_to_array = function (arr: any[], value_or_array: any) {
20
+ Array.prototype.push.apply(arr, isArray(value_or_array) ? value_or_array : [value_or_array]);
21
+ };
22
+
23
+ let toISOString;
24
+
25
+ const defaults = {
26
+ addQueryPrefix: false,
27
+ allowDots: false,
28
+ allowEmptyArrays: false,
29
+ arrayFormat: 'indices',
30
+ charset: 'utf-8',
31
+ charsetSentinel: false,
32
+ delimiter: '&',
33
+ encode: true,
34
+ encodeDotInKeys: false,
35
+ encoder: encode,
36
+ encodeValuesOnly: false,
37
+ format: default_format,
38
+ formatter: default_formatter,
39
+ /** @deprecated */
40
+ indices: false,
41
+ serializeDate(date) {
42
+ return (toISOString ??= Function.prototype.call.bind(Date.prototype.toISOString))(date);
43
+ },
44
+ skipNulls: false,
45
+ strictNullHandling: false,
46
+ } as NonNullableProperties<StringifyOptions & { formatter: (typeof formatters)['RFC1738'] }>;
47
+
48
+ function is_non_nullish_primitive(v: unknown): v is string | number | boolean | symbol | bigint {
49
+ return (
50
+ typeof v === 'string' ||
51
+ typeof v === 'number' ||
52
+ typeof v === 'boolean' ||
53
+ typeof v === 'symbol' ||
54
+ typeof v === 'bigint'
55
+ );
56
+ }
57
+
58
+ const sentinel = {};
59
+
60
+ function inner_stringify(
61
+ object: any,
62
+ prefix: PropertyKey,
63
+ generateArrayPrefix: StringifyOptions['arrayFormat'] | ((prefix: string, key: string) => string),
64
+ commaRoundTrip: boolean,
65
+ allowEmptyArrays: boolean,
66
+ strictNullHandling: boolean,
67
+ skipNulls: boolean,
68
+ encodeDotInKeys: boolean,
69
+ encoder: StringifyOptions['encoder'],
70
+ filter: StringifyOptions['filter'],
71
+ sort: StringifyOptions['sort'],
72
+ allowDots: StringifyOptions['allowDots'],
73
+ serializeDate: StringifyOptions['serializeDate'],
74
+ format: StringifyOptions['format'],
75
+ formatter: StringifyOptions['formatter'],
76
+ encodeValuesOnly: boolean,
77
+ charset: StringifyOptions['charset'],
78
+ sideChannel: WeakMap<any, any>,
79
+ ) {
80
+ let obj = object;
81
+
82
+ let tmp_sc = sideChannel;
83
+ let step = 0;
84
+ let find_flag = false;
85
+ while ((tmp_sc = tmp_sc.get(sentinel)) !== void undefined && !find_flag) {
86
+ // Where object last appeared in the ref tree
87
+ const pos = tmp_sc.get(object);
88
+ step += 1;
89
+ if (typeof pos !== 'undefined') {
90
+ if (pos === step) {
91
+ throw new RangeError('Cyclic object value');
92
+ } else {
93
+ find_flag = true; // Break while
94
+ }
95
+ }
96
+ if (typeof tmp_sc.get(sentinel) === 'undefined') {
97
+ step = 0;
98
+ }
99
+ }
100
+
101
+ if (typeof filter === 'function') {
102
+ obj = filter(prefix, obj);
103
+ } else if (obj instanceof Date) {
104
+ obj = serializeDate?.(obj);
105
+ } else if (generateArrayPrefix === 'comma' && isArray(obj)) {
106
+ obj = maybe_map(obj, function (value) {
107
+ if (value instanceof Date) {
108
+ return serializeDate?.(value);
109
+ }
110
+ return value;
111
+ });
112
+ }
113
+
114
+ if (obj === null) {
115
+ if (strictNullHandling) {
116
+ return encoder && !encodeValuesOnly ?
117
+ // @ts-expect-error
118
+ encoder(prefix, defaults.encoder, charset, 'key', format)
119
+ : prefix;
120
+ }
121
+
122
+ obj = '';
123
+ }
124
+
125
+ if (is_non_nullish_primitive(obj) || is_buffer(obj)) {
126
+ if (encoder) {
127
+ const key_value =
128
+ encodeValuesOnly ? prefix
129
+ // @ts-expect-error
130
+ : encoder(prefix, defaults.encoder, charset, 'key', format);
131
+ return [
132
+ formatter?.(key_value) +
133
+ '=' +
134
+ // @ts-expect-error
135
+ formatter?.(encoder(obj, defaults.encoder, charset, 'value', format)),
136
+ ];
137
+ }
138
+ return [formatter?.(prefix) + '=' + formatter?.(String(obj))];
139
+ }
140
+
141
+ const values: string[] = [];
142
+
143
+ if (typeof obj === 'undefined') {
144
+ return values;
145
+ }
146
+
147
+ let obj_keys;
148
+ if (generateArrayPrefix === 'comma' && isArray(obj)) {
149
+ // we need to join elements in
150
+ if (encodeValuesOnly && encoder) {
151
+ // @ts-expect-error values only
152
+ obj = maybe_map(obj, encoder);
153
+ }
154
+ obj_keys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
155
+ } else if (isArray(filter)) {
156
+ obj_keys = filter;
157
+ } else {
158
+ const keys = Object.keys(obj);
159
+ obj_keys = sort ? keys.sort(sort) : keys;
160
+ }
161
+
162
+ const encoded_prefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix);
163
+
164
+ const adjusted_prefix =
165
+ commaRoundTrip && isArray(obj) && obj.length === 1 ? encoded_prefix + '[]' : encoded_prefix;
166
+
167
+ if (allowEmptyArrays && isArray(obj) && obj.length === 0) {
168
+ return adjusted_prefix + '[]';
169
+ }
170
+
171
+ for (let j = 0; j < obj_keys.length; ++j) {
172
+ const key = obj_keys[j];
173
+ const value =
174
+ // @ts-ignore
175
+ typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key as any];
176
+
177
+ if (skipNulls && value === null) {
178
+ continue;
179
+ }
180
+
181
+ // @ts-ignore
182
+ const encoded_key = allowDots && encodeDotInKeys ? (key as any).replace(/\./g, '%2E') : key;
183
+ const key_prefix =
184
+ isArray(obj) ?
185
+ typeof generateArrayPrefix === 'function' ?
186
+ generateArrayPrefix(adjusted_prefix, encoded_key)
187
+ : adjusted_prefix
188
+ : adjusted_prefix + (allowDots ? '.' + encoded_key : '[' + encoded_key + ']');
189
+
190
+ sideChannel.set(object, step);
191
+ const valueSideChannel = new WeakMap();
192
+ valueSideChannel.set(sentinel, sideChannel);
193
+ push_to_array(
194
+ values,
195
+ inner_stringify(
196
+ value,
197
+ key_prefix,
198
+ generateArrayPrefix,
199
+ commaRoundTrip,
200
+ allowEmptyArrays,
201
+ strictNullHandling,
202
+ skipNulls,
203
+ encodeDotInKeys,
204
+ // @ts-ignore
205
+ generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,
206
+ filter,
207
+ sort,
208
+ allowDots,
209
+ serializeDate,
210
+ format,
211
+ formatter,
212
+ encodeValuesOnly,
213
+ charset,
214
+ valueSideChannel,
215
+ ),
216
+ );
217
+ }
218
+
219
+ return values;
220
+ }
221
+
222
+ function normalize_stringify_options(
223
+ opts: StringifyOptions = defaults,
224
+ ): NonNullableProperties<Omit<StringifyOptions, 'indices'>> & { indices?: boolean } {
225
+ if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
226
+ throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
227
+ }
228
+
229
+ if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {
230
+ throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');
231
+ }
232
+
233
+ if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
234
+ throw new TypeError('Encoder has to be a function.');
235
+ }
236
+
237
+ const charset = opts.charset || defaults.charset;
238
+ if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
239
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
240
+ }
241
+
242
+ let format = default_format;
243
+ if (typeof opts.format !== 'undefined') {
244
+ if (!has(formatters, opts.format)) {
245
+ throw new TypeError('Unknown format option provided.');
246
+ }
247
+ format = opts.format;
248
+ }
249
+ const formatter = formatters[format];
250
+
251
+ let filter = defaults.filter;
252
+ if (typeof opts.filter === 'function' || isArray(opts.filter)) {
253
+ filter = opts.filter;
254
+ }
255
+
256
+ let arrayFormat: StringifyOptions['arrayFormat'];
257
+ if (opts.arrayFormat && opts.arrayFormat in array_prefix_generators) {
258
+ arrayFormat = opts.arrayFormat;
259
+ } else if ('indices' in opts) {
260
+ arrayFormat = opts.indices ? 'indices' : 'repeat';
261
+ } else {
262
+ arrayFormat = defaults.arrayFormat;
263
+ }
264
+
265
+ if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
266
+ throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
267
+ }
268
+
269
+ const allowDots =
270
+ typeof opts.allowDots === 'undefined' ?
271
+ !!opts.encodeDotInKeys === true ?
272
+ true
273
+ : defaults.allowDots
274
+ : !!opts.allowDots;
275
+
276
+ return {
277
+ addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
278
+ // @ts-ignore
279
+ allowDots: allowDots,
280
+ allowEmptyArrays:
281
+ typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
282
+ arrayFormat: arrayFormat,
283
+ charset: charset,
284
+ charsetSentinel:
285
+ typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
286
+ commaRoundTrip: !!opts.commaRoundTrip,
287
+ delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
288
+ encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
289
+ encodeDotInKeys:
290
+ typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
291
+ encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
292
+ encodeValuesOnly:
293
+ typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
294
+ filter: filter,
295
+ format: format,
296
+ formatter: formatter,
297
+ serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,
298
+ skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,
299
+ // @ts-ignore
300
+ sort: typeof opts.sort === 'function' ? opts.sort : null,
301
+ strictNullHandling:
302
+ typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling,
303
+ };
304
+ }
305
+
306
+ export function stringify(object: any, opts: StringifyOptions = {}) {
307
+ let obj = object;
308
+ const options = normalize_stringify_options(opts);
309
+
310
+ let obj_keys: PropertyKey[] | undefined;
311
+ let filter;
312
+
313
+ if (typeof options.filter === 'function') {
314
+ filter = options.filter;
315
+ obj = filter('', obj);
316
+ } else if (isArray(options.filter)) {
317
+ filter = options.filter;
318
+ obj_keys = filter;
319
+ }
320
+
321
+ const keys: string[] = [];
322
+
323
+ if (typeof obj !== 'object' || obj === null) {
324
+ return '';
325
+ }
326
+
327
+ const generateArrayPrefix = array_prefix_generators[options.arrayFormat];
328
+ const commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;
329
+
330
+ if (!obj_keys) {
331
+ obj_keys = Object.keys(obj);
332
+ }
333
+
334
+ if (options.sort) {
335
+ obj_keys.sort(options.sort);
336
+ }
337
+
338
+ const sideChannel = new WeakMap();
339
+ for (let i = 0; i < obj_keys.length; ++i) {
340
+ const key = obj_keys[i]!;
341
+
342
+ if (options.skipNulls && obj[key] === null) {
343
+ continue;
344
+ }
345
+ push_to_array(
346
+ keys,
347
+ inner_stringify(
348
+ obj[key],
349
+ key,
350
+ // @ts-expect-error
351
+ generateArrayPrefix,
352
+ commaRoundTrip,
353
+ options.allowEmptyArrays,
354
+ options.strictNullHandling,
355
+ options.skipNulls,
356
+ options.encodeDotInKeys,
357
+ options.encode ? options.encoder : null,
358
+ options.filter,
359
+ options.sort,
360
+ options.allowDots,
361
+ options.serializeDate,
362
+ options.format,
363
+ options.formatter,
364
+ options.encodeValuesOnly,
365
+ options.charset,
366
+ sideChannel,
367
+ ),
368
+ );
369
+ }
370
+
371
+ const joined = keys.join(options.delimiter);
372
+ let prefix = options.addQueryPrefix === true ? '?' : '';
373
+
374
+ if (options.charsetSentinel) {
375
+ if (options.charset === 'iso-8859-1') {
376
+ // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
377
+ prefix += 'utf8=%26%2310003%3B&';
378
+ } else {
379
+ // encodeURIComponent('✓')
380
+ prefix += 'utf8=%E2%9C%93&';
381
+ }
382
+ }
383
+
384
+ return joined.length > 0 ? prefix + joined : '';
385
+ }