sendblue 1.1.9 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (416) hide show
  1. package/CHANGELOG.md +161 -0
  2. package/LICENSE +201 -21
  3. package/README.md +349 -38
  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/client.d.mts +206 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +206 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +492 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +488 -0
  19. package/client.mjs.map +1 -0
  20. package/core/api-promise.d.mts +46 -0
  21. package/core/api-promise.d.mts.map +1 -0
  22. package/core/api-promise.d.ts +46 -0
  23. package/core/api-promise.d.ts.map +1 -0
  24. package/core/api-promise.js +74 -0
  25. package/core/api-promise.js.map +1 -0
  26. package/core/api-promise.mjs +70 -0
  27. package/core/api-promise.mjs.map +1 -0
  28. package/core/error.d.mts +46 -0
  29. package/core/error.d.mts.map +1 -0
  30. package/core/error.d.ts +46 -0
  31. package/core/error.d.ts.map +1 -0
  32. package/core/error.js +113 -0
  33. package/core/error.js.map +1 -0
  34. package/core/error.mjs +97 -0
  35. package/core/error.mjs.map +1 -0
  36. package/core/resource.d.mts +6 -0
  37. package/core/resource.d.mts.map +1 -0
  38. package/core/resource.d.ts +6 -0
  39. package/core/resource.d.ts.map +1 -0
  40. package/core/resource.js +11 -0
  41. package/core/resource.js.map +1 -0
  42. package/core/resource.mjs +7 -0
  43. package/core/resource.mjs.map +1 -0
  44. package/core/uploads.d.mts +3 -0
  45. package/core/uploads.d.mts.map +1 -0
  46. package/core/uploads.d.ts +3 -0
  47. package/core/uploads.d.ts.map +1 -0
  48. package/core/uploads.js +6 -0
  49. package/core/uploads.js.map +1 -0
  50. package/core/uploads.mjs +2 -0
  51. package/core/uploads.mjs.map +1 -0
  52. package/error.d.mts +2 -0
  53. package/error.d.mts.map +1 -0
  54. package/error.d.ts +2 -0
  55. package/error.d.ts.map +1 -0
  56. package/error.js +6 -0
  57. package/error.js.map +1 -0
  58. package/error.mjs +2 -0
  59. package/error.mjs.map +1 -0
  60. package/index.d.mts +6 -0
  61. package/index.d.mts.map +1 -0
  62. package/index.d.ts +6 -78
  63. package/index.d.ts.map +1 -0
  64. package/index.js +28 -104
  65. package/index.js.map +1 -0
  66. package/index.mjs +7 -0
  67. package/index.mjs.map +1 -0
  68. package/internal/builtin-types.d.mts +73 -0
  69. package/internal/builtin-types.d.mts.map +1 -0
  70. package/internal/builtin-types.d.ts +73 -0
  71. package/internal/builtin-types.d.ts.map +1 -0
  72. package/internal/builtin-types.js +4 -0
  73. package/internal/builtin-types.js.map +1 -0
  74. package/internal/builtin-types.mjs +3 -0
  75. package/internal/builtin-types.mjs.map +1 -0
  76. package/internal/detect-platform.d.mts +15 -0
  77. package/internal/detect-platform.d.mts.map +1 -0
  78. package/internal/detect-platform.d.ts +15 -0
  79. package/internal/detect-platform.d.ts.map +1 -0
  80. package/internal/detect-platform.js +162 -0
  81. package/internal/detect-platform.js.map +1 -0
  82. package/internal/detect-platform.mjs +157 -0
  83. package/internal/detect-platform.mjs.map +1 -0
  84. package/internal/errors.d.mts +3 -0
  85. package/internal/errors.d.mts.map +1 -0
  86. package/internal/errors.d.ts +3 -0
  87. package/internal/errors.d.ts.map +1 -0
  88. package/internal/errors.js +41 -0
  89. package/internal/errors.js.map +1 -0
  90. package/internal/errors.mjs +36 -0
  91. package/internal/errors.mjs.map +1 -0
  92. package/internal/headers.d.mts +20 -0
  93. package/internal/headers.d.mts.map +1 -0
  94. package/internal/headers.d.ts +20 -0
  95. package/internal/headers.d.ts.map +1 -0
  96. package/internal/headers.js +79 -0
  97. package/internal/headers.js.map +1 -0
  98. package/internal/headers.mjs +74 -0
  99. package/internal/headers.mjs.map +1 -0
  100. package/internal/parse.d.mts +12 -0
  101. package/internal/parse.d.mts.map +1 -0
  102. package/internal/parse.d.ts +12 -0
  103. package/internal/parse.d.ts.map +1 -0
  104. package/internal/parse.js +35 -0
  105. package/internal/parse.js.map +1 -0
  106. package/internal/parse.mjs +32 -0
  107. package/internal/parse.mjs.map +1 -0
  108. package/internal/request-options.d.mts +75 -0
  109. package/internal/request-options.d.mts.map +1 -0
  110. package/internal/request-options.d.ts +75 -0
  111. package/internal/request-options.d.ts.map +1 -0
  112. package/internal/request-options.js +14 -0
  113. package/internal/request-options.js.map +1 -0
  114. package/internal/request-options.mjs +10 -0
  115. package/internal/request-options.mjs.map +1 -0
  116. package/internal/shim-types.d.mts +17 -0
  117. package/internal/shim-types.d.mts.map +1 -0
  118. package/internal/shim-types.d.ts +17 -0
  119. package/internal/shim-types.d.ts.map +1 -0
  120. package/internal/shim-types.js +4 -0
  121. package/internal/shim-types.js.map +1 -0
  122. package/internal/shim-types.mjs +3 -0
  123. package/internal/shim-types.mjs.map +1 -0
  124. package/internal/shims.d.mts +20 -0
  125. package/internal/shims.d.mts.map +1 -0
  126. package/internal/shims.d.ts +20 -0
  127. package/internal/shims.d.ts.map +1 -0
  128. package/internal/shims.js +92 -0
  129. package/internal/shims.js.map +1 -0
  130. package/internal/shims.mjs +85 -0
  131. package/internal/shims.mjs.map +1 -0
  132. package/internal/to-file.d.mts +45 -0
  133. package/internal/to-file.d.mts.map +1 -0
  134. package/internal/to-file.d.ts +45 -0
  135. package/internal/to-file.d.ts.map +1 -0
  136. package/internal/to-file.js +91 -0
  137. package/internal/to-file.js.map +1 -0
  138. package/internal/to-file.mjs +88 -0
  139. package/internal/to-file.mjs.map +1 -0
  140. package/internal/tslib.js +81 -0
  141. package/internal/tslib.mjs +17 -0
  142. package/internal/types.d.mts +69 -0
  143. package/internal/types.d.mts.map +1 -0
  144. package/internal/types.d.ts +69 -0
  145. package/internal/types.d.ts.map +1 -0
  146. package/internal/types.js +4 -0
  147. package/internal/types.js.map +1 -0
  148. package/internal/types.mjs +3 -0
  149. package/internal/types.mjs.map +1 -0
  150. package/internal/uploads.d.mts +42 -0
  151. package/internal/uploads.d.mts.map +1 -0
  152. package/internal/uploads.d.ts +42 -0
  153. package/internal/uploads.d.ts.map +1 -0
  154. package/internal/uploads.js +141 -0
  155. package/internal/uploads.js.map +1 -0
  156. package/internal/uploads.mjs +131 -0
  157. package/internal/uploads.mjs.map +1 -0
  158. package/internal/utils/base64.d.mts +3 -0
  159. package/internal/utils/base64.d.mts.map +1 -0
  160. package/internal/utils/base64.d.ts +3 -0
  161. package/internal/utils/base64.d.ts.map +1 -0
  162. package/internal/utils/base64.js +38 -0
  163. package/internal/utils/base64.js.map +1 -0
  164. package/internal/utils/base64.mjs +33 -0
  165. package/internal/utils/base64.mjs.map +1 -0
  166. package/internal/utils/bytes.d.mts +4 -0
  167. package/internal/utils/bytes.d.mts.map +1 -0
  168. package/internal/utils/bytes.d.ts +4 -0
  169. package/internal/utils/bytes.d.ts.map +1 -0
  170. package/internal/utils/bytes.js +31 -0
  171. package/internal/utils/bytes.js.map +1 -0
  172. package/internal/utils/bytes.mjs +26 -0
  173. package/internal/utils/bytes.mjs.map +1 -0
  174. package/internal/utils/env.d.mts +9 -0
  175. package/internal/utils/env.d.mts.map +1 -0
  176. package/internal/utils/env.d.ts +9 -0
  177. package/internal/utils/env.d.ts.map +1 -0
  178. package/internal/utils/env.js +22 -0
  179. package/internal/utils/env.js.map +1 -0
  180. package/internal/utils/env.mjs +18 -0
  181. package/internal/utils/env.mjs.map +1 -0
  182. package/internal/utils/log.d.mts +37 -0
  183. package/internal/utils/log.d.mts.map +1 -0
  184. package/internal/utils/log.d.ts +37 -0
  185. package/internal/utils/log.d.ts.map +1 -0
  186. package/internal/utils/log.js +87 -0
  187. package/internal/utils/log.js.map +1 -0
  188. package/internal/utils/log.mjs +81 -0
  189. package/internal/utils/log.mjs.map +1 -0
  190. package/internal/utils/path.d.mts +15 -0
  191. package/internal/utils/path.d.mts.map +1 -0
  192. package/internal/utils/path.d.ts +15 -0
  193. package/internal/utils/path.d.ts.map +1 -0
  194. package/internal/utils/path.js +79 -0
  195. package/internal/utils/path.js.map +1 -0
  196. package/internal/utils/path.mjs +74 -0
  197. package/internal/utils/path.mjs.map +1 -0
  198. package/internal/utils/sleep.d.mts +2 -0
  199. package/internal/utils/sleep.d.mts.map +1 -0
  200. package/internal/utils/sleep.d.ts +2 -0
  201. package/internal/utils/sleep.d.ts.map +1 -0
  202. package/internal/utils/sleep.js +7 -0
  203. package/internal/utils/sleep.js.map +1 -0
  204. package/internal/utils/sleep.mjs +3 -0
  205. package/internal/utils/sleep.mjs.map +1 -0
  206. package/internal/utils/uuid.d.mts +5 -0
  207. package/internal/utils/uuid.d.mts.map +1 -0
  208. package/internal/utils/uuid.d.ts +5 -0
  209. package/internal/utils/uuid.d.ts.map +1 -0
  210. package/internal/utils/uuid.js +19 -0
  211. package/internal/utils/uuid.js.map +1 -0
  212. package/internal/utils/uuid.mjs +15 -0
  213. package/internal/utils/uuid.mjs.map +1 -0
  214. package/internal/utils/values.d.mts +18 -0
  215. package/internal/utils/values.d.mts.map +1 -0
  216. package/internal/utils/values.d.ts +18 -0
  217. package/internal/utils/values.d.ts.map +1 -0
  218. package/internal/utils/values.js +112 -0
  219. package/internal/utils/values.js.map +1 -0
  220. package/internal/utils/values.mjs +94 -0
  221. package/internal/utils/values.mjs.map +1 -0
  222. package/internal/utils.d.mts +7 -0
  223. package/internal/utils.d.mts.map +1 -0
  224. package/internal/utils.d.ts +7 -0
  225. package/internal/utils.d.ts.map +1 -0
  226. package/internal/utils.js +11 -0
  227. package/internal/utils.js.map +1 -0
  228. package/internal/utils.mjs +8 -0
  229. package/internal/utils.mjs.map +1 -0
  230. package/package.json +132 -39
  231. package/resource.d.mts +2 -0
  232. package/resource.d.mts.map +1 -0
  233. package/resource.d.ts +2 -0
  234. package/resource.d.ts.map +1 -0
  235. package/resource.js +6 -0
  236. package/resource.js.map +1 -0
  237. package/resource.mjs +2 -0
  238. package/resource.mjs.map +1 -0
  239. package/resources/contacts/bulk.d.mts +61 -0
  240. package/resources/contacts/bulk.d.mts.map +1 -0
  241. package/resources/contacts/bulk.d.ts +61 -0
  242. package/resources/contacts/bulk.d.ts.map +1 -0
  243. package/resources/contacts/bulk.js +35 -0
  244. package/resources/contacts/bulk.js.map +1 -0
  245. package/resources/contacts/bulk.mjs +31 -0
  246. package/resources/contacts/bulk.mjs.map +1 -0
  247. package/resources/contacts/contacts.d.mts +213 -0
  248. package/resources/contacts/contacts.d.mts.map +1 -0
  249. package/resources/contacts/contacts.d.ts +213 -0
  250. package/resources/contacts/contacts.d.ts.map +1 -0
  251. package/resources/contacts/contacts.js +101 -0
  252. package/resources/contacts/contacts.js.map +1 -0
  253. package/resources/contacts/contacts.mjs +96 -0
  254. package/resources/contacts/contacts.mjs.map +1 -0
  255. package/resources/contacts/index.d.mts +3 -0
  256. package/resources/contacts/index.d.mts.map +1 -0
  257. package/resources/contacts/index.d.ts +3 -0
  258. package/resources/contacts/index.d.ts.map +1 -0
  259. package/resources/contacts/index.js +9 -0
  260. package/resources/contacts/index.js.map +1 -0
  261. package/resources/contacts/index.mjs +4 -0
  262. package/resources/contacts/index.mjs.map +1 -0
  263. package/resources/contacts.d.mts +2 -0
  264. package/resources/contacts.d.mts.map +1 -0
  265. package/resources/contacts.d.ts +2 -0
  266. package/resources/contacts.d.ts.map +1 -0
  267. package/resources/contacts.js +6 -0
  268. package/resources/contacts.js.map +1 -0
  269. package/resources/contacts.mjs +3 -0
  270. package/resources/contacts.mjs.map +1 -0
  271. package/resources/groups.d.mts +77 -0
  272. package/resources/groups.d.mts.map +1 -0
  273. package/resources/groups.d.ts +77 -0
  274. package/resources/groups.d.ts.map +1 -0
  275. package/resources/groups.js +38 -0
  276. package/resources/groups.js.map +1 -0
  277. package/resources/groups.mjs +34 -0
  278. package/resources/groups.mjs.map +1 -0
  279. package/resources/index.d.mts +8 -0
  280. package/resources/index.d.mts.map +1 -0
  281. package/resources/index.d.ts +8 -0
  282. package/resources/index.d.ts.map +1 -0
  283. package/resources/index.js +19 -0
  284. package/resources/index.js.map +1 -0
  285. package/resources/index.mjs +9 -0
  286. package/resources/index.mjs.map +1 -0
  287. package/resources/lookups.d.mts +30 -0
  288. package/resources/lookups.d.mts.map +1 -0
  289. package/resources/lookups.d.ts +30 -0
  290. package/resources/lookups.d.ts.map +1 -0
  291. package/resources/lookups.js +16 -0
  292. package/resources/lookups.js.map +1 -0
  293. package/resources/lookups.mjs +12 -0
  294. package/resources/lookups.mjs.map +1 -0
  295. package/resources/media-objects.d.mts +31 -0
  296. package/resources/media-objects.d.mts.map +1 -0
  297. package/resources/media-objects.d.ts +31 -0
  298. package/resources/media-objects.d.ts.map +1 -0
  299. package/resources/media-objects.js +22 -0
  300. package/resources/media-objects.js.map +1 -0
  301. package/resources/media-objects.mjs +18 -0
  302. package/resources/media-objects.mjs.map +1 -0
  303. package/resources/messages.d.mts +479 -0
  304. package/resources/messages.d.mts.map +1 -0
  305. package/resources/messages.d.ts +479 -0
  306. package/resources/messages.d.ts.map +1 -0
  307. package/resources/messages.js +64 -0
  308. package/resources/messages.js.map +1 -0
  309. package/resources/messages.mjs +60 -0
  310. package/resources/messages.mjs.map +1 -0
  311. package/resources/typing-indicators.d.mts +42 -0
  312. package/resources/typing-indicators.d.mts.map +1 -0
  313. package/resources/typing-indicators.d.ts +42 -0
  314. package/resources/typing-indicators.d.ts.map +1 -0
  315. package/resources/typing-indicators.js +24 -0
  316. package/resources/typing-indicators.js.map +1 -0
  317. package/resources/typing-indicators.mjs +20 -0
  318. package/resources/typing-indicators.mjs.map +1 -0
  319. package/resources/webhooks.d.mts +224 -0
  320. package/resources/webhooks.d.mts.map +1 -0
  321. package/resources/webhooks.d.ts +224 -0
  322. package/resources/webhooks.d.ts.map +1 -0
  323. package/resources/webhooks.js +82 -0
  324. package/resources/webhooks.js.map +1 -0
  325. package/resources/webhooks.mjs +78 -0
  326. package/resources/webhooks.mjs.map +1 -0
  327. package/resources.d.mts +2 -0
  328. package/resources.d.mts.map +1 -0
  329. package/resources.d.ts +2 -0
  330. package/resources.d.ts.map +1 -0
  331. package/resources.js +5 -0
  332. package/resources.js.map +1 -0
  333. package/resources.mjs +2 -0
  334. package/resources.mjs.map +1 -0
  335. package/src/api-promise.ts +2 -0
  336. package/src/client.ts +865 -0
  337. package/src/core/README.md +3 -0
  338. package/src/core/api-promise.ts +92 -0
  339. package/src/core/error.ts +130 -0
  340. package/src/core/resource.ts +11 -0
  341. package/src/core/uploads.ts +2 -0
  342. package/src/error.ts +2 -0
  343. package/src/index.ts +22 -0
  344. package/src/internal/README.md +3 -0
  345. package/src/internal/builtin-types.ts +93 -0
  346. package/src/internal/detect-platform.ts +196 -0
  347. package/src/internal/errors.ts +33 -0
  348. package/src/internal/headers.ts +97 -0
  349. package/src/internal/parse.ts +50 -0
  350. package/src/internal/request-options.ts +91 -0
  351. package/src/internal/shim-types.ts +26 -0
  352. package/src/internal/shims.ts +107 -0
  353. package/src/internal/to-file.ts +154 -0
  354. package/src/internal/types.ts +95 -0
  355. package/src/internal/uploads.ts +187 -0
  356. package/src/internal/utils/base64.ts +40 -0
  357. package/src/internal/utils/bytes.ts +32 -0
  358. package/src/internal/utils/env.ts +18 -0
  359. package/src/internal/utils/log.ts +128 -0
  360. package/src/internal/utils/path.ts +88 -0
  361. package/src/internal/utils/sleep.ts +3 -0
  362. package/src/internal/utils/uuid.ts +17 -0
  363. package/src/internal/utils/values.ts +105 -0
  364. package/src/internal/utils.ts +8 -0
  365. package/src/lib/.keep +4 -0
  366. package/src/resource.ts +2 -0
  367. package/src/resources/contacts/bulk.ts +85 -0
  368. package/src/resources/contacts/contacts.ts +302 -0
  369. package/src/resources/contacts/index.ts +23 -0
  370. package/src/resources/contacts.ts +3 -0
  371. package/src/resources/groups.ts +102 -0
  372. package/src/resources/index.ts +50 -0
  373. package/src/resources/lookups.ts +44 -0
  374. package/src/resources/media-objects.ts +43 -0
  375. package/src/resources/messages.ts +710 -0
  376. package/src/resources/typing-indicators.ts +54 -0
  377. package/src/resources/webhooks.ts +284 -0
  378. package/src/resources.ts +1 -0
  379. package/src/tsconfig.json +11 -0
  380. package/src/uploads.ts +2 -0
  381. package/src/version.ts +1 -0
  382. package/uploads.d.mts +2 -0
  383. package/uploads.d.mts.map +1 -0
  384. package/uploads.d.ts +2 -0
  385. package/uploads.d.ts.map +1 -0
  386. package/uploads.js +6 -0
  387. package/uploads.js.map +1 -0
  388. package/uploads.mjs +2 -0
  389. package/uploads.mjs.map +1 -0
  390. package/version.d.mts +2 -0
  391. package/version.d.mts.map +1 -0
  392. package/version.d.ts +2 -0
  393. package/version.d.ts.map +1 -0
  394. package/version.js +5 -0
  395. package/version.js.map +1 -0
  396. package/version.mjs +2 -0
  397. package/version.mjs.map +1 -0
  398. package/.env +0 -5
  399. package/.prettierrc +0 -1
  400. package/config.js +0 -31
  401. package/dist/base/Message.d.ts +0 -43
  402. package/dist/base/Message.js +0 -30
  403. package/dist/base/RequestClient.d.ts +0 -27
  404. package/dist/base/RequestClient.js +0 -138
  405. package/dist/base/SendblueClient.d.ts +0 -18
  406. package/dist/base/SendblueClient.js +0 -33
  407. package/dist/index.d.ts +0 -2
  408. package/dist/index.js +0 -4
  409. package/dist/rest/group-message/index.d.ts +0 -23
  410. package/dist/rest/group-message/index.js +0 -73
  411. package/dist/rest/message/index.d.ts +0 -14
  412. package/dist/rest/message/index.js +0 -66
  413. package/dist/types.d.ts +0 -1
  414. package/dist/types.js +0 -2
  415. package/test/basic.test.js +0 -47
  416. package/tsconfig.json +0 -10
@@ -0,0 +1,42 @@
1
+ import { APIResource } from "../core/resource.js";
2
+ import { APIPromise } from "../core/api-promise.js";
3
+ import { RequestOptions } from "../internal/request-options.js";
4
+ export declare class TypingIndicators extends APIResource {
5
+ /**
6
+ * Send an indication that you are typing to a user. This shows up as the animated
7
+ * three dots on the recipient's device. Only available for existing chats and not
8
+ * supported in group chats.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const response = await client.typingIndicators.send({
13
+ * number: '+19998887777',
14
+ * });
15
+ * ```
16
+ */
17
+ send(body: TypingIndicatorSendParams, options?: RequestOptions): APIPromise<TypingIndicatorSendResponse>;
18
+ }
19
+ export interface TypingIndicatorSendResponse {
20
+ /**
21
+ * The error message if the status is ERROR
22
+ */
23
+ error_message?: string | null;
24
+ /**
25
+ * The number you evaluated in E.164 format
26
+ */
27
+ number?: string;
28
+ /**
29
+ * The status of the typing indicator you tried to send
30
+ */
31
+ status?: 'SENT' | 'ERROR';
32
+ }
33
+ export interface TypingIndicatorSendParams {
34
+ /**
35
+ * The number you want to send a typing indicator to (E.164 format)
36
+ */
37
+ number: string;
38
+ }
39
+ export declare namespace TypingIndicators {
40
+ export { type TypingIndicatorSendResponse as TypingIndicatorSendResponse, type TypingIndicatorSendParams as TypingIndicatorSendParams, };
41
+ }
42
+ //# sourceMappingURL=typing-indicators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typing-indicators.d.ts","sourceRoot":"","sources":["../src/resources/typing-indicators.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,IAAI,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,2BAA2B,CAAC;CAGzG;AAED,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,WAAW,gBAAgB,CAAC;IACxC,OAAO,EACL,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.TypingIndicators = void 0;
5
+ const resource_1 = require("../core/resource.js");
6
+ class TypingIndicators extends resource_1.APIResource {
7
+ /**
8
+ * Send an indication that you are typing to a user. This shows up as the animated
9
+ * three dots on the recipient's device. Only available for existing chats and not
10
+ * supported in group chats.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const response = await client.typingIndicators.send({
15
+ * number: '+19998887777',
16
+ * });
17
+ * ```
18
+ */
19
+ send(body, options) {
20
+ return this._client.post('/api/send-typing-indicator', { body, ...options });
21
+ }
22
+ }
23
+ exports.TypingIndicators = TypingIndicators;
24
+ //# sourceMappingURL=typing-indicators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typing-indicators.js","sourceRoot":"","sources":["../src/resources/typing-indicators.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,gBAAiB,SAAQ,sBAAW;IAC/C;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,IAA+B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF;AAhBD,4CAgBC"}
@@ -0,0 +1,20 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../core/resource.mjs";
3
+ export class TypingIndicators extends APIResource {
4
+ /**
5
+ * Send an indication that you are typing to a user. This shows up as the animated
6
+ * three dots on the recipient's device. Only available for existing chats and not
7
+ * supported in group chats.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const response = await client.typingIndicators.send({
12
+ * number: '+19998887777',
13
+ * });
14
+ * ```
15
+ */
16
+ send(body, options) {
17
+ return this._client.post('/api/send-typing-indicator', { body, ...options });
18
+ }
19
+ }
20
+ //# sourceMappingURL=typing-indicators.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typing-indicators.mjs","sourceRoot":"","sources":["../src/resources/typing-indicators.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAC/C;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,IAA+B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF"}
@@ -0,0 +1,224 @@
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 Webhooks extends APIResource {
5
+ /**
6
+ * Add new webhooks to your account. This endpoint appends webhooks to the existing
7
+ * list.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const webhook = await client.webhooks.create({
12
+ * webhooks: [
13
+ * 'https://example.com/new-webhook',
14
+ * {
15
+ * url: 'https://example.com/webhook-with-secret',
16
+ * secret: 'my-webhook-secret',
17
+ * },
18
+ * ],
19
+ * globalSecret: 'optional-global-secret',
20
+ * type: 'receive',
21
+ * });
22
+ * ```
23
+ */
24
+ create(body: WebhookCreateParams, options?: RequestOptions): APIPromise<WebhookCreateResponse>;
25
+ /**
26
+ * Replace all webhooks for your account. This endpoint completely replaces the
27
+ * existing webhook configuration.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const webhook = await client.webhooks.update({
32
+ * webhooks: {
33
+ * receive: [
34
+ * 'https://example.com/webhook1',
35
+ * {
36
+ * url: 'https://example.com/webhook2',
37
+ * secret: 'webhook-secret',
38
+ * },
39
+ * ],
40
+ * call_log: ['https://example.com/call-webhook'],
41
+ * contact_created: [
42
+ * 'https://example.com/contact-webhook',
43
+ * ],
44
+ * globalSecret: 'my-global-secret',
45
+ * },
46
+ * });
47
+ * ```
48
+ */
49
+ update(body: WebhookUpdateParams, options?: RequestOptions): APIPromise<WebhookUpdateResponse>;
50
+ /**
51
+ * Get all webhooks configured for your account.
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * const webhooks = await client.webhooks.list();
56
+ * ```
57
+ */
58
+ list(options?: RequestOptions): APIPromise<WebhookListResponse>;
59
+ /**
60
+ * Delete specific webhooks from your account.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * const webhook = await client.webhooks.delete({
65
+ * webhooks: ['https://example.com'],
66
+ * });
67
+ * ```
68
+ */
69
+ delete(body: WebhookDeleteParams, options?: RequestOptions): APIPromise<WebhookDeleteResponse>;
70
+ }
71
+ export interface WebhookConfiguration {
72
+ /**
73
+ * Webhooks for call logs
74
+ */
75
+ call_log?: Array<string | WebhookConfiguration.WebhookObject>;
76
+ /**
77
+ * Webhooks for contact creation (URL strings only)
78
+ */
79
+ contact_created?: Array<string>;
80
+ /**
81
+ * Global secret applied to all webhooks
82
+ */
83
+ globalSecret?: string;
84
+ /**
85
+ * Webhooks for line assignment
86
+ */
87
+ line_assigned?: Array<string | WebhookConfiguration.WebhookObject>;
88
+ /**
89
+ * Webhooks for blocked lines
90
+ */
91
+ line_blocked?: Array<string | WebhookConfiguration.WebhookObject>;
92
+ /**
93
+ * Webhooks for outbound messages
94
+ */
95
+ outbound?: Array<string | WebhookConfiguration.WebhookObject>;
96
+ /**
97
+ * Webhooks for inbound messages
98
+ */
99
+ receive?: Array<string | WebhookConfiguration.WebhookObject>;
100
+ /**
101
+ * Legacy secret field
102
+ */
103
+ secret?: string;
104
+ }
105
+ export declare namespace WebhookConfiguration {
106
+ interface WebhookObject {
107
+ /**
108
+ * Webhook URL (HTTPS only)
109
+ */
110
+ url: string;
111
+ /**
112
+ * Secret for webhook verification
113
+ */
114
+ secret?: string;
115
+ }
116
+ interface WebhookObject {
117
+ /**
118
+ * Webhook URL (HTTPS only)
119
+ */
120
+ url: string;
121
+ /**
122
+ * Secret for webhook verification
123
+ */
124
+ secret?: string;
125
+ }
126
+ interface WebhookObject {
127
+ /**
128
+ * Webhook URL (HTTPS only)
129
+ */
130
+ url: string;
131
+ /**
132
+ * Secret for webhook verification
133
+ */
134
+ secret?: string;
135
+ }
136
+ interface WebhookObject {
137
+ /**
138
+ * Webhook URL (HTTPS only)
139
+ */
140
+ url: string;
141
+ /**
142
+ * Secret for webhook verification
143
+ */
144
+ secret?: string;
145
+ }
146
+ interface WebhookObject {
147
+ /**
148
+ * Webhook URL (HTTPS only)
149
+ */
150
+ url: string;
151
+ /**
152
+ * Secret for webhook verification
153
+ */
154
+ secret?: string;
155
+ }
156
+ }
157
+ export interface WebhookCreateResponse {
158
+ status: 'OK' | 'ERROR';
159
+ message?: string;
160
+ /**
161
+ * Updated webhook configration (partial)
162
+ */
163
+ webhooks?: WebhookConfiguration;
164
+ }
165
+ export interface WebhookUpdateResponse {
166
+ status: 'OK' | 'ERROR';
167
+ message?: string;
168
+ /**
169
+ * Updated webhook configration (partial)
170
+ */
171
+ webhooks?: WebhookConfiguration;
172
+ }
173
+ export interface WebhookListResponse {
174
+ status: 'OK' | 'ERROR';
175
+ message?: string;
176
+ webhooks?: WebhookConfiguration;
177
+ }
178
+ export interface WebhookDeleteResponse {
179
+ status: 'OK' | 'ERROR';
180
+ message?: string;
181
+ }
182
+ export interface WebhookCreateParams {
183
+ /**
184
+ * Array of webhook URLs or webhook objects to add
185
+ */
186
+ webhooks: Array<string | WebhookCreateParams.WebhookObject>;
187
+ /**
188
+ * Optional global secret to apply to all webhooks
189
+ */
190
+ globalSecret?: string;
191
+ /**
192
+ * Webhook type (default to 'receive')
193
+ */
194
+ type?: 'receive' | 'call_log' | 'line_blocked' | 'line_assigned' | 'outbound' | 'contact_created';
195
+ }
196
+ export declare namespace WebhookCreateParams {
197
+ interface WebhookObject {
198
+ /**
199
+ * Webhook URL (HTTPS only)
200
+ */
201
+ url: string;
202
+ /**
203
+ * Secret for webhook verification
204
+ */
205
+ secret?: string;
206
+ }
207
+ }
208
+ export interface WebhookUpdateParams {
209
+ webhooks: WebhookConfiguration;
210
+ }
211
+ export interface WebhookDeleteParams {
212
+ /**
213
+ * Array of webhook URLs to delete
214
+ */
215
+ webhooks: Array<string>;
216
+ /**
217
+ * Webhook type (default to 'receive')
218
+ */
219
+ type?: 'receive' | 'call_log' | 'line_blocked' | 'line_assigned' | 'outbound' | 'contact_created';
220
+ }
221
+ export declare namespace Webhooks {
222
+ export { type WebhookConfiguration as WebhookConfiguration, type WebhookCreateResponse as WebhookCreateResponse, type WebhookUpdateResponse as WebhookUpdateResponse, type WebhookListResponse as WebhookListResponse, type WebhookDeleteResponse as WebhookDeleteResponse, type WebhookCreateParams as WebhookCreateParams, type WebhookUpdateParams as WebhookUpdateParams, type WebhookDeleteParams as WebhookDeleteParams, };
223
+ }
224
+ //# sourceMappingURL=webhooks.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhooks.d.mts","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAI9F;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAI9F;;;;;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AEG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;CACF;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,oBAAoB,CAAC;CAChC;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAExB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,cAAc,GAAG,eAAe,GAAG,UAAU,GAAG,iBAAiB,CAAC;CACnG;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -0,0 +1,224 @@
1
+ import { APIResource } from "../core/resource.js";
2
+ import { APIPromise } from "../core/api-promise.js";
3
+ import { RequestOptions } from "../internal/request-options.js";
4
+ export declare class Webhooks extends APIResource {
5
+ /**
6
+ * Add new webhooks to your account. This endpoint appends webhooks to the existing
7
+ * list.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const webhook = await client.webhooks.create({
12
+ * webhooks: [
13
+ * 'https://example.com/new-webhook',
14
+ * {
15
+ * url: 'https://example.com/webhook-with-secret',
16
+ * secret: 'my-webhook-secret',
17
+ * },
18
+ * ],
19
+ * globalSecret: 'optional-global-secret',
20
+ * type: 'receive',
21
+ * });
22
+ * ```
23
+ */
24
+ create(body: WebhookCreateParams, options?: RequestOptions): APIPromise<WebhookCreateResponse>;
25
+ /**
26
+ * Replace all webhooks for your account. This endpoint completely replaces the
27
+ * existing webhook configuration.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const webhook = await client.webhooks.update({
32
+ * webhooks: {
33
+ * receive: [
34
+ * 'https://example.com/webhook1',
35
+ * {
36
+ * url: 'https://example.com/webhook2',
37
+ * secret: 'webhook-secret',
38
+ * },
39
+ * ],
40
+ * call_log: ['https://example.com/call-webhook'],
41
+ * contact_created: [
42
+ * 'https://example.com/contact-webhook',
43
+ * ],
44
+ * globalSecret: 'my-global-secret',
45
+ * },
46
+ * });
47
+ * ```
48
+ */
49
+ update(body: WebhookUpdateParams, options?: RequestOptions): APIPromise<WebhookUpdateResponse>;
50
+ /**
51
+ * Get all webhooks configured for your account.
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * const webhooks = await client.webhooks.list();
56
+ * ```
57
+ */
58
+ list(options?: RequestOptions): APIPromise<WebhookListResponse>;
59
+ /**
60
+ * Delete specific webhooks from your account.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * const webhook = await client.webhooks.delete({
65
+ * webhooks: ['https://example.com'],
66
+ * });
67
+ * ```
68
+ */
69
+ delete(body: WebhookDeleteParams, options?: RequestOptions): APIPromise<WebhookDeleteResponse>;
70
+ }
71
+ export interface WebhookConfiguration {
72
+ /**
73
+ * Webhooks for call logs
74
+ */
75
+ call_log?: Array<string | WebhookConfiguration.WebhookObject>;
76
+ /**
77
+ * Webhooks for contact creation (URL strings only)
78
+ */
79
+ contact_created?: Array<string>;
80
+ /**
81
+ * Global secret applied to all webhooks
82
+ */
83
+ globalSecret?: string;
84
+ /**
85
+ * Webhooks for line assignment
86
+ */
87
+ line_assigned?: Array<string | WebhookConfiguration.WebhookObject>;
88
+ /**
89
+ * Webhooks for blocked lines
90
+ */
91
+ line_blocked?: Array<string | WebhookConfiguration.WebhookObject>;
92
+ /**
93
+ * Webhooks for outbound messages
94
+ */
95
+ outbound?: Array<string | WebhookConfiguration.WebhookObject>;
96
+ /**
97
+ * Webhooks for inbound messages
98
+ */
99
+ receive?: Array<string | WebhookConfiguration.WebhookObject>;
100
+ /**
101
+ * Legacy secret field
102
+ */
103
+ secret?: string;
104
+ }
105
+ export declare namespace WebhookConfiguration {
106
+ interface WebhookObject {
107
+ /**
108
+ * Webhook URL (HTTPS only)
109
+ */
110
+ url: string;
111
+ /**
112
+ * Secret for webhook verification
113
+ */
114
+ secret?: string;
115
+ }
116
+ interface WebhookObject {
117
+ /**
118
+ * Webhook URL (HTTPS only)
119
+ */
120
+ url: string;
121
+ /**
122
+ * Secret for webhook verification
123
+ */
124
+ secret?: string;
125
+ }
126
+ interface WebhookObject {
127
+ /**
128
+ * Webhook URL (HTTPS only)
129
+ */
130
+ url: string;
131
+ /**
132
+ * Secret for webhook verification
133
+ */
134
+ secret?: string;
135
+ }
136
+ interface WebhookObject {
137
+ /**
138
+ * Webhook URL (HTTPS only)
139
+ */
140
+ url: string;
141
+ /**
142
+ * Secret for webhook verification
143
+ */
144
+ secret?: string;
145
+ }
146
+ interface WebhookObject {
147
+ /**
148
+ * Webhook URL (HTTPS only)
149
+ */
150
+ url: string;
151
+ /**
152
+ * Secret for webhook verification
153
+ */
154
+ secret?: string;
155
+ }
156
+ }
157
+ export interface WebhookCreateResponse {
158
+ status: 'OK' | 'ERROR';
159
+ message?: string;
160
+ /**
161
+ * Updated webhook configration (partial)
162
+ */
163
+ webhooks?: WebhookConfiguration;
164
+ }
165
+ export interface WebhookUpdateResponse {
166
+ status: 'OK' | 'ERROR';
167
+ message?: string;
168
+ /**
169
+ * Updated webhook configration (partial)
170
+ */
171
+ webhooks?: WebhookConfiguration;
172
+ }
173
+ export interface WebhookListResponse {
174
+ status: 'OK' | 'ERROR';
175
+ message?: string;
176
+ webhooks?: WebhookConfiguration;
177
+ }
178
+ export interface WebhookDeleteResponse {
179
+ status: 'OK' | 'ERROR';
180
+ message?: string;
181
+ }
182
+ export interface WebhookCreateParams {
183
+ /**
184
+ * Array of webhook URLs or webhook objects to add
185
+ */
186
+ webhooks: Array<string | WebhookCreateParams.WebhookObject>;
187
+ /**
188
+ * Optional global secret to apply to all webhooks
189
+ */
190
+ globalSecret?: string;
191
+ /**
192
+ * Webhook type (default to 'receive')
193
+ */
194
+ type?: 'receive' | 'call_log' | 'line_blocked' | 'line_assigned' | 'outbound' | 'contact_created';
195
+ }
196
+ export declare namespace WebhookCreateParams {
197
+ interface WebhookObject {
198
+ /**
199
+ * Webhook URL (HTTPS only)
200
+ */
201
+ url: string;
202
+ /**
203
+ * Secret for webhook verification
204
+ */
205
+ secret?: string;
206
+ }
207
+ }
208
+ export interface WebhookUpdateParams {
209
+ webhooks: WebhookConfiguration;
210
+ }
211
+ export interface WebhookDeleteParams {
212
+ /**
213
+ * Array of webhook URLs to delete
214
+ */
215
+ webhooks: Array<string>;
216
+ /**
217
+ * Webhook type (default to 'receive')
218
+ */
219
+ type?: 'receive' | 'call_log' | 'line_blocked' | 'line_assigned' | 'outbound' | 'contact_created';
220
+ }
221
+ export declare namespace Webhooks {
222
+ export { type WebhookConfiguration as WebhookConfiguration, type WebhookCreateResponse as WebhookCreateResponse, type WebhookUpdateResponse as WebhookUpdateResponse, type WebhookListResponse as WebhookListResponse, type WebhookDeleteResponse as WebhookDeleteResponse, type WebhookCreateParams as WebhookCreateParams, type WebhookUpdateParams as WebhookUpdateParams, type WebhookDeleteParams as WebhookDeleteParams, };
223
+ }
224
+ //# sourceMappingURL=webhooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAI9F;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAm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AAC;IACnC,UAAiB,aAAa;QAC5B;;WAEG;QACH,GAAG,EAAE,MAAM,CAAC;QAEZ;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;CACF;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,oBAAoB,CAAC;CAChC;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAExB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,cAAc,GAAG,eAAe,GAAG,UAAU,GAAG,iBAAiB,CAAC;CACnG;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Webhooks = void 0;
5
+ const resource_1 = require("../core/resource.js");
6
+ class Webhooks extends resource_1.APIResource {
7
+ /**
8
+ * Add new webhooks to your account. This endpoint appends webhooks to the existing
9
+ * list.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const webhook = await client.webhooks.create({
14
+ * webhooks: [
15
+ * 'https://example.com/new-webhook',
16
+ * {
17
+ * url: 'https://example.com/webhook-with-secret',
18
+ * secret: 'my-webhook-secret',
19
+ * },
20
+ * ],
21
+ * globalSecret: 'optional-global-secret',
22
+ * type: 'receive',
23
+ * });
24
+ * ```
25
+ */
26
+ create(body, options) {
27
+ return this._client.post('/api/v2/account/webhooks', { body, ...options });
28
+ }
29
+ /**
30
+ * Replace all webhooks for your account. This endpoint completely replaces the
31
+ * existing webhook configuration.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const webhook = await client.webhooks.update({
36
+ * webhooks: {
37
+ * receive: [
38
+ * 'https://example.com/webhook1',
39
+ * {
40
+ * url: 'https://example.com/webhook2',
41
+ * secret: 'webhook-secret',
42
+ * },
43
+ * ],
44
+ * call_log: ['https://example.com/call-webhook'],
45
+ * contact_created: [
46
+ * 'https://example.com/contact-webhook',
47
+ * ],
48
+ * globalSecret: 'my-global-secret',
49
+ * },
50
+ * });
51
+ * ```
52
+ */
53
+ update(body, options) {
54
+ return this._client.put('/api/v2/account/webhooks', { body, ...options });
55
+ }
56
+ /**
57
+ * Get all webhooks configured for your account.
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * const webhooks = await client.webhooks.list();
62
+ * ```
63
+ */
64
+ list(options) {
65
+ return this._client.get('/api/v2/account/webhooks', options);
66
+ }
67
+ /**
68
+ * Delete specific webhooks from your account.
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * const webhook = await client.webhooks.delete({
73
+ * webhooks: ['https://example.com'],
74
+ * });
75
+ * ```
76
+ */
77
+ delete(body, options) {
78
+ return this._client.delete('/api/v2/account/webhooks', { body, ...options });
79
+ }
80
+ }
81
+ exports.Webhooks = Webhooks;
82
+ //# sourceMappingURL=webhooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,0BAA0B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF;AA7ED,4BA6EC"}