sendblue 1.1.9 → 2.0.1

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 (407) hide show
  1. package/CHANGELOG.md +83 -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 +203 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +203 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +489 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +485 -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 +129 -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 +239 -0
  248. package/resources/contacts/contacts.d.mts.map +1 -0
  249. package/resources/contacts/contacts.d.ts +239 -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 +7 -0
  280. package/resources/index.d.mts.map +1 -0
  281. package/resources/index.d.ts +7 -0
  282. package/resources/index.d.ts.map +1 -0
  283. package/resources/index.js +17 -0
  284. package/resources/index.js.map +1 -0
  285. package/resources/index.mjs +8 -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 +487 -0
  304. package/resources/messages.d.mts.map +1 -0
  305. package/resources/messages.d.ts +487 -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.d.mts +2 -0
  320. package/resources.d.mts.map +1 -0
  321. package/resources.d.ts +2 -0
  322. package/resources.d.ts.map +1 -0
  323. package/resources.js +5 -0
  324. package/resources.js.map +1 -0
  325. package/resources.mjs +2 -0
  326. package/resources.mjs.map +1 -0
  327. package/src/api-promise.ts +2 -0
  328. package/src/client.ts +840 -0
  329. package/src/core/README.md +3 -0
  330. package/src/core/api-promise.ts +92 -0
  331. package/src/core/error.ts +130 -0
  332. package/src/core/resource.ts +11 -0
  333. package/src/core/uploads.ts +2 -0
  334. package/src/error.ts +2 -0
  335. package/src/index.ts +22 -0
  336. package/src/internal/README.md +3 -0
  337. package/src/internal/builtin-types.ts +93 -0
  338. package/src/internal/detect-platform.ts +196 -0
  339. package/src/internal/errors.ts +33 -0
  340. package/src/internal/headers.ts +97 -0
  341. package/src/internal/parse.ts +50 -0
  342. package/src/internal/request-options.ts +91 -0
  343. package/src/internal/shim-types.ts +26 -0
  344. package/src/internal/shims.ts +107 -0
  345. package/src/internal/to-file.ts +154 -0
  346. package/src/internal/types.ts +95 -0
  347. package/src/internal/uploads.ts +187 -0
  348. package/src/internal/utils/base64.ts +40 -0
  349. package/src/internal/utils/bytes.ts +32 -0
  350. package/src/internal/utils/env.ts +18 -0
  351. package/src/internal/utils/log.ts +128 -0
  352. package/src/internal/utils/path.ts +88 -0
  353. package/src/internal/utils/sleep.ts +3 -0
  354. package/src/internal/utils/uuid.ts +17 -0
  355. package/src/internal/utils/values.ts +105 -0
  356. package/src/internal/utils.ts +8 -0
  357. package/src/lib/.keep +4 -0
  358. package/src/resource.ts +2 -0
  359. package/src/resources/contacts/bulk.ts +85 -0
  360. package/src/resources/contacts/contacts.ts +338 -0
  361. package/src/resources/contacts/index.ts +24 -0
  362. package/src/resources/contacts.ts +3 -0
  363. package/src/resources/groups.ts +102 -0
  364. package/src/resources/index.ts +40 -0
  365. package/src/resources/lookups.ts +44 -0
  366. package/src/resources/media-objects.ts +43 -0
  367. package/src/resources/messages.ts +720 -0
  368. package/src/resources/typing-indicators.ts +54 -0
  369. package/src/resources.ts +1 -0
  370. package/src/tsconfig.json +11 -0
  371. package/src/uploads.ts +2 -0
  372. package/src/version.ts +1 -0
  373. package/uploads.d.mts +2 -0
  374. package/uploads.d.mts.map +1 -0
  375. package/uploads.d.ts +2 -0
  376. package/uploads.d.ts.map +1 -0
  377. package/uploads.js +6 -0
  378. package/uploads.js.map +1 -0
  379. package/uploads.mjs +2 -0
  380. package/uploads.mjs.map +1 -0
  381. package/version.d.mts +2 -0
  382. package/version.d.mts.map +1 -0
  383. package/version.d.ts +2 -0
  384. package/version.d.ts.map +1 -0
  385. package/version.js +5 -0
  386. package/version.js.map +1 -0
  387. package/version.mjs +2 -0
  388. package/version.mjs.map +1 -0
  389. package/.env +0 -5
  390. package/.prettierrc +0 -1
  391. package/config.js +0 -31
  392. package/dist/base/Message.d.ts +0 -43
  393. package/dist/base/Message.js +0 -30
  394. package/dist/base/RequestClient.d.ts +0 -27
  395. package/dist/base/RequestClient.js +0 -138
  396. package/dist/base/SendblueClient.d.ts +0 -18
  397. package/dist/base/SendblueClient.js +0 -33
  398. package/dist/index.d.ts +0 -2
  399. package/dist/index.js +0 -4
  400. package/dist/rest/group-message/index.d.ts +0 -23
  401. package/dist/rest/group-message/index.js +0 -73
  402. package/dist/rest/message/index.d.ts +0 -14
  403. package/dist/rest/message/index.js +0 -66
  404. package/dist/types.d.ts +0 -1
  405. package/dist/types.js +0 -2
  406. package/test/basic.test.js +0 -47
  407. package/tsconfig.json +0 -10
@@ -0,0 +1,31 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ export class Bulk extends APIResource {
4
+ /**
5
+ * Create multiple contacts in bulk
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * const bulk = await client.contacts.bulk.create({
10
+ * contacts: [{ phone: 'phone' }],
11
+ * });
12
+ * ```
13
+ */
14
+ create(body, options) {
15
+ return this._client.post('/api/v2/contacts/bulk', { body, ...options });
16
+ }
17
+ /**
18
+ * Delete multiple contacts by their IDs
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const bulk = await client.contacts.bulk.delete({
23
+ * contact_ids: ['+1234567890', '+0987654321'],
24
+ * });
25
+ * ```
26
+ */
27
+ delete(body, options) {
28
+ return this._client.delete('/api/v2/contacts', { body, ...options });
29
+ }
30
+ }
31
+ //# sourceMappingURL=bulk.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulk.mjs","sourceRoot":"","sources":["../../src/resources/contacts/bulk.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAKtB,MAAM,OAAO,IAAK,SAAQ,WAAW;IACnC;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;CACF"}
@@ -0,0 +1,239 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import * as BulkAPI from "./bulk.mjs";
3
+ import { Bulk, BulkCreateParams, BulkCreateResponse, BulkDeleteParams, BulkDeleteResponse } from "./bulk.mjs";
4
+ import { APIPromise } from "../../core/api-promise.mjs";
5
+ import { RequestOptions } from "../../internal/request-options.mjs";
6
+ export declare class Contacts extends APIResource {
7
+ bulk: BulkAPI.Bulk;
8
+ /**
9
+ * Create a new contact or update existing if update_if_exists is true
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const contact = await client.contacts.create({
14
+ * number: 'number',
15
+ * });
16
+ * ```
17
+ */
18
+ create(body: ContactCreateParams, options?: RequestOptions): APIPromise<ContactCreateResponse>;
19
+ /**
20
+ * Retrieve a specific contact by phone number
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * const contact = await client.contacts.retrieve(
25
+ * '+1234567890',
26
+ * );
27
+ * ```
28
+ */
29
+ retrieve(phoneNumber: string, options?: RequestOptions): APIPromise<ContactRetrieveResponse>;
30
+ /**
31
+ * Update an existing contact
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const contact = await client.contacts.update('+1234567890');
36
+ * ```
37
+ */
38
+ update(phoneNumber: string, body: ContactUpdateParams, options?: RequestOptions): APIPromise<ContactUpdateResponse>;
39
+ /**
40
+ * Retrieve a list of contacts for the authenticated account
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const contacts = await client.contacts.list();
45
+ * ```
46
+ */
47
+ list(query?: ContactListParams | null | undefined, options?: RequestOptions): APIPromise<ContactListResponse>;
48
+ /**
49
+ * Delete a specific contact
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * const contact = await client.contacts.delete('+1234567890');
54
+ * ```
55
+ */
56
+ delete(phoneNumber: string, options?: RequestOptions): APIPromise<ContactDeleteResponse>;
57
+ /**
58
+ * Get the total number of contacts
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * const response = await client.contacts.count();
63
+ * ```
64
+ */
65
+ count(options?: RequestOptions): APIPromise<ContactCountResponse>;
66
+ /**
67
+ * Send a verification message to a contact
68
+ *
69
+ * @example
70
+ * ```ts
71
+ * const response = await client.contacts.verify({
72
+ * number: 'number',
73
+ * });
74
+ * ```
75
+ */
76
+ verify(body: ContactVerifyParams, options?: RequestOptions): APIPromise<ContactVerifyResponse>;
77
+ }
78
+ export interface Contact {
79
+ /**
80
+ * Email of assigned user
81
+ */
82
+ assignedToEmail?: string;
83
+ /**
84
+ * Company name
85
+ */
86
+ companyName?: string;
87
+ /**
88
+ * When the contact was created
89
+ */
90
+ created_at?: string;
91
+ /**
92
+ * First name
93
+ */
94
+ firstName?: string;
95
+ /**
96
+ * Last name
97
+ */
98
+ lastName?: string;
99
+ /**
100
+ * Phone number in E.164 format
101
+ */
102
+ phone?: string;
103
+ /**
104
+ * Associated Sendblue phone number
105
+ */
106
+ sendblueNumber?: string;
107
+ /**
108
+ * Tags associated with the contact
109
+ */
110
+ tags?: Array<string>;
111
+ /**
112
+ * Whether the contact is verified
113
+ */
114
+ verified?: boolean;
115
+ }
116
+ export interface ContactCreateResponse {
117
+ contact?: Contact;
118
+ status?: string;
119
+ }
120
+ export interface ContactRetrieveResponse {
121
+ contact?: Contact;
122
+ status?: string;
123
+ }
124
+ export interface ContactUpdateResponse {
125
+ contact?: Contact;
126
+ status?: string;
127
+ }
128
+ export type ContactListResponse = Array<Contact>;
129
+ export interface ContactDeleteResponse {
130
+ status?: string;
131
+ }
132
+ export interface ContactCountResponse {
133
+ /**
134
+ * Total number of contacts
135
+ */
136
+ count?: number;
137
+ }
138
+ export interface ContactVerifyResponse {
139
+ status?: string;
140
+ }
141
+ export interface ContactCreateParams {
142
+ /**
143
+ * Contact's phone number in E.164 format
144
+ */
145
+ number: string;
146
+ /**
147
+ * Email of assigned user
148
+ */
149
+ assigned_to_email?: string;
150
+ /**
151
+ * Email of assigned user (alternative)
152
+ */
153
+ assignedToEmail?: string;
154
+ /**
155
+ * Contact's first name
156
+ */
157
+ first_name?: string;
158
+ /**
159
+ * Contact's first name (alternative)
160
+ */
161
+ firstName?: string;
162
+ /**
163
+ * Contact's last name
164
+ */
165
+ last_name?: string;
166
+ /**
167
+ * Contact's last name (alternative)
168
+ */
169
+ lastName?: string;
170
+ /**
171
+ * Contact's phone number (alternative)
172
+ */
173
+ phone_number?: string;
174
+ /**
175
+ * Contact's phone number (alternative)
176
+ */
177
+ phoneNumber?: string;
178
+ /**
179
+ * Associated Sendblue phone number
180
+ */
181
+ sendblue_number?: string;
182
+ /**
183
+ * Associated Sendblue phone number (alternative)
184
+ */
185
+ sendblueNumber?: string;
186
+ /**
187
+ * Tags for the contact
188
+ */
189
+ tags?: Array<string>;
190
+ /**
191
+ * If true, updates the contact if it already exists
192
+ */
193
+ update_if_exists?: boolean;
194
+ }
195
+ export interface ContactUpdateParams {
196
+ assignedToEmail?: string;
197
+ companyName?: string;
198
+ firstName?: string;
199
+ lastName?: string;
200
+ sendblueNumber?: string;
201
+ tags?: Array<string>;
202
+ }
203
+ export interface ContactListParams {
204
+ /**
205
+ * Filter by contact ID
206
+ */
207
+ cid?: string;
208
+ /**
209
+ * Maximum number of contacts to return
210
+ */
211
+ limit?: number;
212
+ /**
213
+ * Number of contacts to skip
214
+ */
215
+ offset?: number;
216
+ /**
217
+ * Field to sort by
218
+ */
219
+ order_by?: string;
220
+ /**
221
+ * Sort direction
222
+ */
223
+ order_direction?: 'asc' | 'desc';
224
+ /**
225
+ * Filter by phone number
226
+ */
227
+ phone_number?: string;
228
+ }
229
+ export interface ContactVerifyParams {
230
+ /**
231
+ * Phone number to verify
232
+ */
233
+ number: string;
234
+ }
235
+ export declare namespace Contacts {
236
+ export { type Contact as Contact, type ContactCreateResponse as ContactCreateResponse, type ContactRetrieveResponse as ContactRetrieveResponse, type ContactUpdateResponse as ContactUpdateResponse, type ContactListResponse as ContactListResponse, type ContactDeleteResponse as ContactDeleteResponse, type ContactCountResponse as ContactCountResponse, type ContactVerifyResponse as ContactVerifyResponse, type ContactCreateParams as ContactCreateParams, type ContactUpdateParams as ContactUpdateParams, type ContactListParams as ContactListParams, type ContactVerifyParams as ContactVerifyParams, };
237
+ export { Bulk as Bulk, type BulkCreateResponse as BulkCreateResponse, type BulkDeleteResponse as BulkDeleteResponse, type BulkCreateParams as BulkCreateParams, type BulkDeleteParams as BulkDeleteParams, };
238
+ }
239
+ //# sourceMappingURL=contacts.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contacts.d.mts","sourceRoot":"","sources":["../../src/resources/contacts/contacts.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,OAAO;OACZ,EAAE,IAAI,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE;OACpF,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC,IAAI,EAAE,OA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C/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;IAEF,OAAO,EACL,IAAI,IAAI,IAAI,EACZ,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -0,0 +1,239 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as BulkAPI from "./bulk.js";
3
+ import { Bulk, BulkCreateParams, BulkCreateResponse, BulkDeleteParams, BulkDeleteResponse } from "./bulk.js";
4
+ import { APIPromise } from "../../core/api-promise.js";
5
+ import { RequestOptions } from "../../internal/request-options.js";
6
+ export declare class Contacts extends APIResource {
7
+ bulk: BulkAPI.Bulk;
8
+ /**
9
+ * Create a new contact or update existing if update_if_exists is true
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const contact = await client.contacts.create({
14
+ * number: 'number',
15
+ * });
16
+ * ```
17
+ */
18
+ create(body: ContactCreateParams, options?: RequestOptions): APIPromise<ContactCreateResponse>;
19
+ /**
20
+ * Retrieve a specific contact by phone number
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * const contact = await client.contacts.retrieve(
25
+ * '+1234567890',
26
+ * );
27
+ * ```
28
+ */
29
+ retrieve(phoneNumber: string, options?: RequestOptions): APIPromise<ContactRetrieveResponse>;
30
+ /**
31
+ * Update an existing contact
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const contact = await client.contacts.update('+1234567890');
36
+ * ```
37
+ */
38
+ update(phoneNumber: string, body: ContactUpdateParams, options?: RequestOptions): APIPromise<ContactUpdateResponse>;
39
+ /**
40
+ * Retrieve a list of contacts for the authenticated account
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const contacts = await client.contacts.list();
45
+ * ```
46
+ */
47
+ list(query?: ContactListParams | null | undefined, options?: RequestOptions): APIPromise<ContactListResponse>;
48
+ /**
49
+ * Delete a specific contact
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * const contact = await client.contacts.delete('+1234567890');
54
+ * ```
55
+ */
56
+ delete(phoneNumber: string, options?: RequestOptions): APIPromise<ContactDeleteResponse>;
57
+ /**
58
+ * Get the total number of contacts
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * const response = await client.contacts.count();
63
+ * ```
64
+ */
65
+ count(options?: RequestOptions): APIPromise<ContactCountResponse>;
66
+ /**
67
+ * Send a verification message to a contact
68
+ *
69
+ * @example
70
+ * ```ts
71
+ * const response = await client.contacts.verify({
72
+ * number: 'number',
73
+ * });
74
+ * ```
75
+ */
76
+ verify(body: ContactVerifyParams, options?: RequestOptions): APIPromise<ContactVerifyResponse>;
77
+ }
78
+ export interface Contact {
79
+ /**
80
+ * Email of assigned user
81
+ */
82
+ assignedToEmail?: string;
83
+ /**
84
+ * Company name
85
+ */
86
+ companyName?: string;
87
+ /**
88
+ * When the contact was created
89
+ */
90
+ created_at?: string;
91
+ /**
92
+ * First name
93
+ */
94
+ firstName?: string;
95
+ /**
96
+ * Last name
97
+ */
98
+ lastName?: string;
99
+ /**
100
+ * Phone number in E.164 format
101
+ */
102
+ phone?: string;
103
+ /**
104
+ * Associated Sendblue phone number
105
+ */
106
+ sendblueNumber?: string;
107
+ /**
108
+ * Tags associated with the contact
109
+ */
110
+ tags?: Array<string>;
111
+ /**
112
+ * Whether the contact is verified
113
+ */
114
+ verified?: boolean;
115
+ }
116
+ export interface ContactCreateResponse {
117
+ contact?: Contact;
118
+ status?: string;
119
+ }
120
+ export interface ContactRetrieveResponse {
121
+ contact?: Contact;
122
+ status?: string;
123
+ }
124
+ export interface ContactUpdateResponse {
125
+ contact?: Contact;
126
+ status?: string;
127
+ }
128
+ export type ContactListResponse = Array<Contact>;
129
+ export interface ContactDeleteResponse {
130
+ status?: string;
131
+ }
132
+ export interface ContactCountResponse {
133
+ /**
134
+ * Total number of contacts
135
+ */
136
+ count?: number;
137
+ }
138
+ export interface ContactVerifyResponse {
139
+ status?: string;
140
+ }
141
+ export interface ContactCreateParams {
142
+ /**
143
+ * Contact's phone number in E.164 format
144
+ */
145
+ number: string;
146
+ /**
147
+ * Email of assigned user
148
+ */
149
+ assigned_to_email?: string;
150
+ /**
151
+ * Email of assigned user (alternative)
152
+ */
153
+ assignedToEmail?: string;
154
+ /**
155
+ * Contact's first name
156
+ */
157
+ first_name?: string;
158
+ /**
159
+ * Contact's first name (alternative)
160
+ */
161
+ firstName?: string;
162
+ /**
163
+ * Contact's last name
164
+ */
165
+ last_name?: string;
166
+ /**
167
+ * Contact's last name (alternative)
168
+ */
169
+ lastName?: string;
170
+ /**
171
+ * Contact's phone number (alternative)
172
+ */
173
+ phone_number?: string;
174
+ /**
175
+ * Contact's phone number (alternative)
176
+ */
177
+ phoneNumber?: string;
178
+ /**
179
+ * Associated Sendblue phone number
180
+ */
181
+ sendblue_number?: string;
182
+ /**
183
+ * Associated Sendblue phone number (alternative)
184
+ */
185
+ sendblueNumber?: string;
186
+ /**
187
+ * Tags for the contact
188
+ */
189
+ tags?: Array<string>;
190
+ /**
191
+ * If true, updates the contact if it already exists
192
+ */
193
+ update_if_exists?: boolean;
194
+ }
195
+ export interface ContactUpdateParams {
196
+ assignedToEmail?: string;
197
+ companyName?: string;
198
+ firstName?: string;
199
+ lastName?: string;
200
+ sendblueNumber?: string;
201
+ tags?: Array<string>;
202
+ }
203
+ export interface ContactListParams {
204
+ /**
205
+ * Filter by contact ID
206
+ */
207
+ cid?: string;
208
+ /**
209
+ * Maximum number of contacts to return
210
+ */
211
+ limit?: number;
212
+ /**
213
+ * Number of contacts to skip
214
+ */
215
+ offset?: number;
216
+ /**
217
+ * Field to sort by
218
+ */
219
+ order_by?: string;
220
+ /**
221
+ * Sort direction
222
+ */
223
+ order_direction?: 'asc' | 'desc';
224
+ /**
225
+ * Filter by phone number
226
+ */
227
+ phone_number?: string;
228
+ }
229
+ export interface ContactVerifyParams {
230
+ /**
231
+ * Phone number to verify
232
+ */
233
+ number: string;
234
+ }
235
+ export declare namespace Contacts {
236
+ export { type Contact as Contact, type ContactCreateResponse as ContactCreateResponse, type ContactRetrieveResponse as ContactRetrieveResponse, type ContactUpdateResponse as ContactUpdateResponse, type ContactListResponse as ContactListResponse, type ContactDeleteResponse as ContactDeleteResponse, type ContactCountResponse as ContactCountResponse, type ContactVerifyResponse as ContactVerifyResponse, type ContactCreateParams as ContactCreateParams, type ContactUpdateParams as ContactUpdateParams, type ContactListParams as ContactListParams, type ContactVerifyParams as ContactVerifyParams, };
237
+ export { Bulk as Bulk, type BulkCreateResponse as BulkCreateResponse, type BulkDeleteResponse as BulkDeleteResponse, type BulkCreateParams as BulkCreateParams, type BulkDeleteParams as BulkDeleteParams, };
238
+ }
239
+ //# sourceMappingURL=contacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contacts.d.ts","sourceRoot":"","sources":["../../src/resources/contacts/contacts.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,OAAO;OACZ,EAAE,IAAI,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE;OACpF,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAkC;IAEpD;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAI9F;;;;;;;;;OASG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAI5F;;;;;;;OAOG;IACH,MAAM,CACJ,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,mBAAmB,EACzB,OAAO,CAA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API spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Contacts = void 0;
5
+ const tslib_1 = require("../../internal/tslib.js");
6
+ const resource_1 = require("../../core/resource.js");
7
+ const BulkAPI = tslib_1.__importStar(require("./bulk.js"));
8
+ const bulk_1 = require("./bulk.js");
9
+ const path_1 = require("../../internal/utils/path.js");
10
+ class Contacts extends resource_1.APIResource {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.bulk = new BulkAPI.Bulk(this._client);
14
+ }
15
+ /**
16
+ * Create a new contact or update existing if update_if_exists is true
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const contact = await client.contacts.create({
21
+ * number: 'number',
22
+ * });
23
+ * ```
24
+ */
25
+ create(body, options) {
26
+ return this._client.post('/api/v2/contacts', { body, ...options });
27
+ }
28
+ /**
29
+ * Retrieve a specific contact by phone number
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const contact = await client.contacts.retrieve(
34
+ * '+1234567890',
35
+ * );
36
+ * ```
37
+ */
38
+ retrieve(phoneNumber, options) {
39
+ return this._client.get((0, path_1.path) `/api/v2/contacts/${phoneNumber}`, options);
40
+ }
41
+ /**
42
+ * Update an existing contact
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * const contact = await client.contacts.update('+1234567890');
47
+ * ```
48
+ */
49
+ update(phoneNumber, body, options) {
50
+ return this._client.put((0, path_1.path) `/api/v2/contacts/${phoneNumber}`, { body, ...options });
51
+ }
52
+ /**
53
+ * Retrieve a list of contacts for the authenticated account
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * const contacts = await client.contacts.list();
58
+ * ```
59
+ */
60
+ list(query = {}, options) {
61
+ return this._client.get('/api/v2/contacts', { query, ...options });
62
+ }
63
+ /**
64
+ * Delete a specific contact
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * const contact = await client.contacts.delete('+1234567890');
69
+ * ```
70
+ */
71
+ delete(phoneNumber, options) {
72
+ return this._client.delete((0, path_1.path) `/api/v2/contacts/${phoneNumber}`, options);
73
+ }
74
+ /**
75
+ * Get the total number of contacts
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * const response = await client.contacts.count();
80
+ * ```
81
+ */
82
+ count(options) {
83
+ return this._client.get('/api/v2/contacts/count', options);
84
+ }
85
+ /**
86
+ * Send a verification message to a contact
87
+ *
88
+ * @example
89
+ * ```ts
90
+ * const response = await client.contacts.verify({
91
+ * number: 'number',
92
+ * });
93
+ * ```
94
+ */
95
+ verify(body, options) {
96
+ return this._client.post('/api/v2/contacts/verify', { body, ...options });
97
+ }
98
+ }
99
+ exports.Contacts = Contacts;
100
+ Contacts.Bulk = bulk_1.Bulk;
101
+ //# sourceMappingURL=contacts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contacts.js","sourceRoot":"","sources":["../../src/resources/contacts/contacts.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,2DAAkC;AAClC,oCAA0G;AAG1G,uDAAiD;AAEjD,MAAa,QAAS,SAAQ,sBAAW;IAAzC;;QACE,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAkGtD,CAAC;IAhGC;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,WAAmB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oBAAoB,WAAW,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CACJ,WAAmB,EACnB,IAAyB,EACzB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAA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