@zavudev/sdk 0.30.0 → 0.38.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 (305) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/client.d.mts +28 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +28 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +25 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +25 -1
  9. package/client.mjs.map +1 -1
  10. package/internal/utils/env.js +2 -2
  11. package/internal/utils/env.js.map +1 -1
  12. package/internal/utils/env.mjs +2 -2
  13. package/internal/utils/env.mjs.map +1 -1
  14. package/package.json +1 -1
  15. package/resources/balance.d.mts +33 -0
  16. package/resources/balance.d.mts.map +1 -0
  17. package/resources/balance.d.ts +33 -0
  18. package/resources/balance.d.ts.map +1 -0
  19. package/resources/balance.js +16 -0
  20. package/resources/balance.js.map +1 -0
  21. package/resources/balance.mjs +12 -0
  22. package/resources/balance.mjs.map +1 -0
  23. package/resources/broadcasts/broadcasts.d.mts +31 -1
  24. package/resources/broadcasts/broadcasts.d.mts.map +1 -1
  25. package/resources/broadcasts/broadcasts.d.ts +31 -1
  26. package/resources/broadcasts/broadcasts.d.ts.map +1 -1
  27. package/resources/broadcasts/broadcasts.js +28 -0
  28. package/resources/broadcasts/broadcasts.js.map +1 -1
  29. package/resources/broadcasts/broadcasts.mjs +28 -0
  30. package/resources/broadcasts/broadcasts.mjs.map +1 -1
  31. package/resources/broadcasts/index.d.mts +1 -1
  32. package/resources/broadcasts/index.d.mts.map +1 -1
  33. package/resources/broadcasts/index.d.ts +1 -1
  34. package/resources/broadcasts/index.d.ts.map +1 -1
  35. package/resources/broadcasts/index.js.map +1 -1
  36. package/resources/broadcasts/index.mjs.map +1 -1
  37. package/resources/contacts/channels.d.mts +127 -0
  38. package/resources/contacts/channels.d.mts.map +1 -0
  39. package/resources/contacts/channels.d.ts +127 -0
  40. package/resources/contacts/channels.d.ts.map +1 -0
  41. package/resources/contacts/channels.js +76 -0
  42. package/resources/contacts/channels.js.map +1 -0
  43. package/resources/contacts/channels.mjs +72 -0
  44. package/resources/contacts/channels.mjs.map +1 -0
  45. package/resources/contacts/contacts.d.mts +262 -0
  46. package/resources/contacts/contacts.d.mts.map +1 -0
  47. package/resources/contacts/contacts.d.ts +262 -0
  48. package/resources/contacts/contacts.d.ts.map +1 -0
  49. package/resources/contacts/contacts.js +118 -0
  50. package/resources/contacts/contacts.js.map +1 -0
  51. package/resources/contacts/contacts.mjs +113 -0
  52. package/resources/contacts/contacts.mjs.map +1 -0
  53. package/resources/contacts/index.d.mts +3 -0
  54. package/resources/contacts/index.d.mts.map +1 -0
  55. package/resources/contacts/index.d.ts +3 -0
  56. package/resources/contacts/index.d.ts.map +1 -0
  57. package/resources/contacts/index.js +9 -0
  58. package/resources/contacts/index.js.map +1 -0
  59. package/resources/contacts/index.mjs +4 -0
  60. package/resources/contacts/index.mjs.map +1 -0
  61. package/resources/contacts.d.mts +1 -144
  62. package/resources/contacts.d.mts.map +1 -1
  63. package/resources/contacts.d.ts +1 -144
  64. package/resources/contacts.d.ts.map +1 -1
  65. package/resources/contacts.js +2 -31
  66. package/resources/contacts.js.map +1 -1
  67. package/resources/contacts.mjs +1 -29
  68. package/resources/contacts.mjs.map +1 -1
  69. package/resources/exports.d.mts +101 -0
  70. package/resources/exports.d.mts.map +1 -0
  71. package/resources/exports.d.ts +101 -0
  72. package/resources/exports.d.ts.map +1 -0
  73. package/resources/exports.js +53 -0
  74. package/resources/exports.js.map +1 -0
  75. package/resources/exports.mjs +49 -0
  76. package/resources/exports.mjs.map +1 -0
  77. package/resources/index.d.mts +10 -2
  78. package/resources/index.d.mts.map +1 -1
  79. package/resources/index.d.ts +10 -2
  80. package/resources/index.d.ts.map +1 -1
  81. package/resources/index.js +18 -2
  82. package/resources/index.js.map +1 -1
  83. package/resources/index.mjs +9 -1
  84. package/resources/index.mjs.map +1 -1
  85. package/resources/invitations.d.mts +133 -0
  86. package/resources/invitations.d.mts.map +1 -0
  87. package/resources/invitations.d.ts +133 -0
  88. package/resources/invitations.d.ts.map +1 -0
  89. package/resources/invitations.js +67 -0
  90. package/resources/invitations.js.map +1 -0
  91. package/resources/invitations.mjs +63 -0
  92. package/resources/invitations.mjs.map +1 -0
  93. package/resources/messages.d.mts +37 -4
  94. package/resources/messages.d.mts.map +1 -1
  95. package/resources/messages.d.ts +37 -4
  96. package/resources/messages.d.ts.map +1 -1
  97. package/resources/number-10dlc/brands.d.mts +258 -0
  98. package/resources/number-10dlc/brands.d.mts.map +1 -0
  99. package/resources/number-10dlc/brands.d.ts +258 -0
  100. package/resources/number-10dlc/brands.d.ts.map +1 -0
  101. package/resources/number-10dlc/brands.js +132 -0
  102. package/resources/number-10dlc/brands.js.map +1 -0
  103. package/resources/number-10dlc/brands.mjs +128 -0
  104. package/resources/number-10dlc/brands.mjs.map +1 -0
  105. package/resources/number-10dlc/campaigns/campaigns.d.mts +223 -0
  106. package/resources/number-10dlc/campaigns/campaigns.d.mts.map +1 -0
  107. package/resources/number-10dlc/campaigns/campaigns.d.ts +223 -0
  108. package/resources/number-10dlc/campaigns/campaigns.d.ts.map +1 -0
  109. package/resources/number-10dlc/campaigns/campaigns.js +133 -0
  110. package/resources/number-10dlc/campaigns/campaigns.js.map +1 -0
  111. package/resources/number-10dlc/campaigns/campaigns.mjs +128 -0
  112. package/resources/number-10dlc/campaigns/campaigns.mjs.map +1 -0
  113. package/resources/number-10dlc/campaigns/index.d.mts +3 -0
  114. package/resources/number-10dlc/campaigns/index.d.mts.map +1 -0
  115. package/resources/number-10dlc/campaigns/index.d.ts +3 -0
  116. package/resources/number-10dlc/campaigns/index.d.ts.map +1 -0
  117. package/resources/number-10dlc/campaigns/index.js +9 -0
  118. package/resources/number-10dlc/campaigns/index.js.map +1 -0
  119. package/resources/number-10dlc/campaigns/index.mjs +4 -0
  120. package/resources/number-10dlc/campaigns/index.mjs.map +1 -0
  121. package/resources/number-10dlc/campaigns/phone-numbers.d.mts +79 -0
  122. package/resources/number-10dlc/campaigns/phone-numbers.d.mts.map +1 -0
  123. package/resources/number-10dlc/campaigns/phone-numbers.d.ts +79 -0
  124. package/resources/number-10dlc/campaigns/phone-numbers.d.ts.map +1 -0
  125. package/resources/number-10dlc/campaigns/phone-numbers.js +59 -0
  126. package/resources/number-10dlc/campaigns/phone-numbers.js.map +1 -0
  127. package/resources/number-10dlc/campaigns/phone-numbers.mjs +55 -0
  128. package/resources/number-10dlc/campaigns/phone-numbers.mjs.map +1 -0
  129. package/resources/number-10dlc/campaigns.d.mts +2 -0
  130. package/resources/number-10dlc/campaigns.d.mts.map +1 -0
  131. package/resources/number-10dlc/campaigns.d.ts +2 -0
  132. package/resources/number-10dlc/campaigns.d.ts.map +1 -0
  133. package/resources/number-10dlc/campaigns.js +6 -0
  134. package/resources/number-10dlc/campaigns.js.map +1 -0
  135. package/resources/number-10dlc/campaigns.mjs +3 -0
  136. package/resources/number-10dlc/campaigns.mjs.map +1 -0
  137. package/resources/number-10dlc/index.d.mts +4 -0
  138. package/resources/number-10dlc/index.d.mts.map +1 -0
  139. package/resources/number-10dlc/index.d.ts +4 -0
  140. package/resources/number-10dlc/index.d.ts.map +1 -0
  141. package/resources/number-10dlc/index.js +11 -0
  142. package/resources/number-10dlc/index.js.map +1 -0
  143. package/resources/number-10dlc/index.mjs +5 -0
  144. package/resources/number-10dlc/index.mjs.map +1 -0
  145. package/resources/number-10dlc/number-10dlc.d.mts +14 -0
  146. package/resources/number-10dlc/number-10dlc.d.mts.map +1 -0
  147. package/resources/number-10dlc/number-10dlc.d.ts +14 -0
  148. package/resources/number-10dlc/number-10dlc.d.ts.map +1 -0
  149. package/resources/number-10dlc/number-10dlc.js +21 -0
  150. package/resources/number-10dlc/number-10dlc.js.map +1 -0
  151. package/resources/number-10dlc/number-10dlc.mjs +16 -0
  152. package/resources/number-10dlc/number-10dlc.mjs.map +1 -0
  153. package/resources/number-10dlc.d.mts +2 -0
  154. package/resources/number-10dlc.d.mts.map +1 -0
  155. package/resources/number-10dlc.d.ts +2 -0
  156. package/resources/number-10dlc.d.ts.map +1 -0
  157. package/resources/number-10dlc.js +6 -0
  158. package/resources/number-10dlc.js.map +1 -0
  159. package/resources/number-10dlc.mjs +3 -0
  160. package/resources/number-10dlc.mjs.map +1 -0
  161. package/resources/plan.d.mts +43 -0
  162. package/resources/plan.d.mts.map +1 -0
  163. package/resources/plan.d.ts +43 -0
  164. package/resources/plan.d.ts.map +1 -0
  165. package/resources/plan.js +16 -0
  166. package/resources/plan.js.map +1 -0
  167. package/resources/plan.mjs +12 -0
  168. package/resources/plan.mjs.map +1 -0
  169. package/resources/senders/agent/agent.d.mts +4 -4
  170. package/resources/senders/agent/agent.d.mts.map +1 -1
  171. package/resources/senders/agent/agent.d.ts +4 -4
  172. package/resources/senders/agent/agent.d.ts.map +1 -1
  173. package/resources/senders/agent/agent.js.map +1 -1
  174. package/resources/senders/agent/agent.mjs.map +1 -1
  175. package/resources/senders/agent/flows.d.mts +40 -114
  176. package/resources/senders/agent/flows.d.mts.map +1 -1
  177. package/resources/senders/agent/flows.d.ts +40 -114
  178. package/resources/senders/agent/flows.d.ts.map +1 -1
  179. package/resources/senders/agent/index.d.mts +2 -2
  180. package/resources/senders/agent/index.d.mts.map +1 -1
  181. package/resources/senders/agent/index.d.ts +2 -2
  182. package/resources/senders/agent/index.d.ts.map +1 -1
  183. package/resources/senders/agent/index.js.map +1 -1
  184. package/resources/senders/agent/index.mjs.map +1 -1
  185. package/resources/senders/agent/tools.d.mts +15 -47
  186. package/resources/senders/agent/tools.d.mts.map +1 -1
  187. package/resources/senders/agent/tools.d.ts +15 -47
  188. package/resources/senders/agent/tools.d.ts.map +1 -1
  189. package/resources/senders/index.d.mts +1 -0
  190. package/resources/senders/index.d.mts.map +1 -1
  191. package/resources/senders/index.d.ts +1 -0
  192. package/resources/senders/index.d.ts.map +1 -1
  193. package/resources/senders/index.js +3 -1
  194. package/resources/senders/index.js.map +1 -1
  195. package/resources/senders/index.mjs +1 -0
  196. package/resources/senders/index.mjs.map +1 -1
  197. package/resources/senders/senders.d.mts +17 -1
  198. package/resources/senders/senders.d.mts.map +1 -1
  199. package/resources/senders/senders.d.ts +17 -1
  200. package/resources/senders/senders.d.ts.map +1 -1
  201. package/resources/senders/senders.js +4 -0
  202. package/resources/senders/senders.js.map +1 -1
  203. package/resources/senders/senders.mjs +4 -0
  204. package/resources/senders/senders.mjs.map +1 -1
  205. package/resources/senders/whatsapp-sync.d.mts +134 -0
  206. package/resources/senders/whatsapp-sync.d.mts.map +1 -0
  207. package/resources/senders/whatsapp-sync.d.ts +134 -0
  208. package/resources/senders/whatsapp-sync.d.ts.map +1 -0
  209. package/resources/senders/whatsapp-sync.js +56 -0
  210. package/resources/senders/whatsapp-sync.js.map +1 -0
  211. package/resources/senders/whatsapp-sync.mjs +52 -0
  212. package/resources/senders/whatsapp-sync.mjs.map +1 -0
  213. package/resources/sub-accounts/api-keys.d.mts +85 -0
  214. package/resources/sub-accounts/api-keys.d.mts.map +1 -0
  215. package/resources/sub-accounts/api-keys.d.ts +85 -0
  216. package/resources/sub-accounts/api-keys.d.ts.map +1 -0
  217. package/resources/sub-accounts/api-keys.js +53 -0
  218. package/resources/sub-accounts/api-keys.js.map +1 -0
  219. package/resources/sub-accounts/api-keys.mjs +49 -0
  220. package/resources/sub-accounts/api-keys.mjs.map +1 -0
  221. package/resources/sub-accounts/index.d.mts +3 -0
  222. package/resources/sub-accounts/index.d.mts.map +1 -0
  223. package/resources/sub-accounts/index.d.ts +3 -0
  224. package/resources/sub-accounts/index.d.ts.map +1 -0
  225. package/resources/sub-accounts/index.js +9 -0
  226. package/resources/sub-accounts/index.js.map +1 -0
  227. package/resources/sub-accounts/index.mjs +4 -0
  228. package/resources/sub-accounts/index.mjs.map +1 -0
  229. package/resources/sub-accounts/sub-accounts.d.mts +168 -0
  230. package/resources/sub-accounts/sub-accounts.d.mts.map +1 -0
  231. package/resources/sub-accounts/sub-accounts.d.ts +168 -0
  232. package/resources/sub-accounts/sub-accounts.d.ts.map +1 -0
  233. package/resources/sub-accounts/sub-accounts.js +94 -0
  234. package/resources/sub-accounts/sub-accounts.js.map +1 -0
  235. package/resources/sub-accounts/sub-accounts.mjs +89 -0
  236. package/resources/sub-accounts/sub-accounts.mjs.map +1 -0
  237. package/resources/sub-accounts.d.mts +2 -0
  238. package/resources/sub-accounts.d.mts.map +1 -0
  239. package/resources/sub-accounts.d.ts +2 -0
  240. package/resources/sub-accounts.d.ts.map +1 -0
  241. package/resources/sub-accounts.js +6 -0
  242. package/resources/sub-accounts.js.map +1 -0
  243. package/resources/sub-accounts.mjs +3 -0
  244. package/resources/sub-accounts.mjs.map +1 -0
  245. package/resources/templates.d.mts +42 -2
  246. package/resources/templates.d.mts.map +1 -1
  247. package/resources/templates.d.ts +42 -2
  248. package/resources/templates.d.ts.map +1 -1
  249. package/resources/urls.d.mts +88 -0
  250. package/resources/urls.d.mts.map +1 -0
  251. package/resources/urls.d.ts +88 -0
  252. package/resources/urls.d.ts.map +1 -0
  253. package/resources/urls.js +55 -0
  254. package/resources/urls.js.map +1 -0
  255. package/resources/urls.mjs +51 -0
  256. package/resources/urls.mjs.map +1 -0
  257. package/resources/usage.d.mts +36 -0
  258. package/resources/usage.d.mts.map +1 -0
  259. package/resources/usage.d.ts +36 -0
  260. package/resources/usage.d.ts.map +1 -0
  261. package/resources/usage.js +16 -0
  262. package/resources/usage.js.map +1 -0
  263. package/resources/usage.mjs +12 -0
  264. package/resources/usage.mjs.map +1 -0
  265. package/src/client.ts +130 -6
  266. package/src/internal/utils/env.ts +2 -2
  267. package/src/resources/balance.ts +43 -0
  268. package/src/resources/broadcasts/broadcasts.ts +40 -0
  269. package/src/resources/broadcasts/index.ts +2 -0
  270. package/src/resources/contacts/channels.ts +177 -0
  271. package/src/resources/contacts/contacts.ts +360 -0
  272. package/src/resources/contacts/index.ts +22 -0
  273. package/src/resources/contacts.ts +1 -196
  274. package/src/resources/exports.ts +141 -0
  275. package/src/resources/index.ts +51 -1
  276. package/src/resources/invitations.ts +188 -0
  277. package/src/resources/messages.ts +43 -3
  278. package/src/resources/number-10dlc/brands.ts +377 -0
  279. package/src/resources/number-10dlc/campaigns/campaigns.ts +349 -0
  280. package/src/resources/number-10dlc/campaigns/index.ts +23 -0
  281. package/src/resources/number-10dlc/campaigns/phone-numbers.ts +123 -0
  282. package/src/resources/number-10dlc/campaigns.ts +3 -0
  283. package/src/resources/number-10dlc/index.ts +30 -0
  284. package/src/resources/number-10dlc/number-10dlc.ts +71 -0
  285. package/src/resources/number-10dlc.ts +3 -0
  286. package/src/resources/plan.ts +62 -0
  287. package/src/resources/senders/agent/agent.ts +6 -0
  288. package/src/resources/senders/agent/flows.ts +44 -126
  289. package/src/resources/senders/agent/index.ts +3 -0
  290. package/src/resources/senders/agent/tools.ts +13 -50
  291. package/src/resources/senders/index.ts +9 -0
  292. package/src/resources/senders/senders.ts +38 -1
  293. package/src/resources/senders/whatsapp-sync.ts +175 -0
  294. package/src/resources/sub-accounts/api-keys.ts +126 -0
  295. package/src/resources/sub-accounts/index.ts +22 -0
  296. package/src/resources/sub-accounts/sub-accounts.ts +246 -0
  297. package/src/resources/sub-accounts.ts +3 -0
  298. package/src/resources/templates.ts +51 -2
  299. package/src/resources/urls.ts +125 -0
  300. package/src/resources/usage.ts +48 -0
  301. package/src/version.ts +1 -1
  302. package/version.d.mts +1 -1
  303. package/version.d.ts +1 -1
  304. package/version.js +1 -1
  305. package/version.mjs +1 -1
@@ -0,0 +1,127 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import * as ContactsAPI from "./contacts.mjs";
3
+ import { APIPromise } from "../../core/api-promise.mjs";
4
+ import { RequestOptions } from "../../internal/request-options.mjs";
5
+ export declare class Channels extends APIResource {
6
+ /**
7
+ * Update a contact's channel properties.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const channel = await client.contacts.channels.update(
12
+ * 'channelId',
13
+ * { contactId: 'contactId' },
14
+ * );
15
+ * ```
16
+ */
17
+ update(channelID: string, params: ChannelUpdateParams, options?: RequestOptions): APIPromise<ChannelUpdateResponse>;
18
+ /**
19
+ * Add a new communication channel to an existing contact.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const response = await client.contacts.channels.add(
24
+ * 'contactId',
25
+ * {
26
+ * channel: 'email',
27
+ * identifier: 'john.work@company.com',
28
+ * label: 'work',
29
+ * },
30
+ * );
31
+ * ```
32
+ */
33
+ add(contactID: string, body: ChannelAddParams, options?: RequestOptions): APIPromise<ChannelAddResponse>;
34
+ /**
35
+ * Remove a communication channel from a contact. Cannot remove the last channel.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * await client.contacts.channels.remove('channelId', {
40
+ * contactId: 'contactId',
41
+ * });
42
+ * ```
43
+ */
44
+ remove(channelID: string, params: ChannelRemoveParams, options?: RequestOptions): APIPromise<void>;
45
+ /**
46
+ * Set a channel as the primary channel for its type.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const response = await client.contacts.channels.setPrimary(
51
+ * 'channelId',
52
+ * { contactId: 'contactId' },
53
+ * );
54
+ * ```
55
+ */
56
+ setPrimary(channelID: string, params: ChannelSetPrimaryParams, options?: RequestOptions): APIPromise<ChannelSetPrimaryResponse>;
57
+ }
58
+ export interface ChannelUpdateResponse {
59
+ /**
60
+ * A communication channel for a contact.
61
+ */
62
+ channel: ContactsAPI.ContactChannel;
63
+ }
64
+ export interface ChannelAddResponse {
65
+ /**
66
+ * A communication channel for a contact.
67
+ */
68
+ channel: ContactsAPI.ContactChannel;
69
+ }
70
+ export interface ChannelSetPrimaryResponse {
71
+ /**
72
+ * A communication channel for a contact.
73
+ */
74
+ channel: ContactsAPI.ContactChannel;
75
+ }
76
+ export interface ChannelUpdateParams {
77
+ /**
78
+ * Path param
79
+ */
80
+ contactId: string;
81
+ /**
82
+ * Body param: Optional label for the channel. Set to null to clear.
83
+ */
84
+ label?: string | null;
85
+ /**
86
+ * Body param
87
+ */
88
+ metadata?: {
89
+ [key: string]: string;
90
+ };
91
+ /**
92
+ * Body param: Whether the channel is verified.
93
+ */
94
+ verified?: boolean;
95
+ }
96
+ export interface ChannelAddParams {
97
+ /**
98
+ * Channel type.
99
+ */
100
+ channel: 'sms' | 'whatsapp' | 'email' | 'telegram' | 'voice';
101
+ /**
102
+ * Channel identifier (phone number in E.164 format or email address).
103
+ */
104
+ identifier: string;
105
+ /**
106
+ * ISO country code for phone numbers.
107
+ */
108
+ countryCode?: string;
109
+ /**
110
+ * Whether this should be the primary channel for its type.
111
+ */
112
+ isPrimary?: boolean;
113
+ /**
114
+ * Optional label for the channel.
115
+ */
116
+ label?: string;
117
+ }
118
+ export interface ChannelRemoveParams {
119
+ contactId: string;
120
+ }
121
+ export interface ChannelSetPrimaryParams {
122
+ contactId: string;
123
+ }
124
+ export declare namespace Channels {
125
+ export { type ChannelUpdateResponse as ChannelUpdateResponse, type ChannelAddResponse as ChannelAddResponse, type ChannelSetPrimaryResponse as ChannelSetPrimaryResponse, type ChannelUpdateParams as ChannelUpdateParams, type ChannelAddParams as ChannelAddParams, type ChannelRemoveParams as ChannelRemoveParams, type ChannelSetPrimaryParams as ChannelSetPrimaryParams, };
126
+ }
127
+ //# sourceMappingURL=channels.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channels.d.mts","sourceRoot":"","sources":["../../src/resources/contacts/channels.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;OAUG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qBAAqB,CAAC;IAKpC;;;;;;;;;;;;;;OAcG;IACH,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAIxG;;;;;;;;;OASG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAQlG;;;;;;;;;;OAUG;IACH,UAAU,CACR,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,uBAAuB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,yBAAyB,CAAC;CAIzC;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC,cAAc,CAAC;CACrC;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC,cAAc,CAAC;CACrC;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC,cAAc,CAAC;CACrC;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAErC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,OAAO,EAAE,KAAK,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;IAE7D;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
@@ -0,0 +1,127 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as ContactsAPI from "./contacts.js";
3
+ import { APIPromise } from "../../core/api-promise.js";
4
+ import { RequestOptions } from "../../internal/request-options.js";
5
+ export declare class Channels extends APIResource {
6
+ /**
7
+ * Update a contact's channel properties.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const channel = await client.contacts.channels.update(
12
+ * 'channelId',
13
+ * { contactId: 'contactId' },
14
+ * );
15
+ * ```
16
+ */
17
+ update(channelID: string, params: ChannelUpdateParams, options?: RequestOptions): APIPromise<ChannelUpdateResponse>;
18
+ /**
19
+ * Add a new communication channel to an existing contact.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const response = await client.contacts.channels.add(
24
+ * 'contactId',
25
+ * {
26
+ * channel: 'email',
27
+ * identifier: 'john.work@company.com',
28
+ * label: 'work',
29
+ * },
30
+ * );
31
+ * ```
32
+ */
33
+ add(contactID: string, body: ChannelAddParams, options?: RequestOptions): APIPromise<ChannelAddResponse>;
34
+ /**
35
+ * Remove a communication channel from a contact. Cannot remove the last channel.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * await client.contacts.channels.remove('channelId', {
40
+ * contactId: 'contactId',
41
+ * });
42
+ * ```
43
+ */
44
+ remove(channelID: string, params: ChannelRemoveParams, options?: RequestOptions): APIPromise<void>;
45
+ /**
46
+ * Set a channel as the primary channel for its type.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const response = await client.contacts.channels.setPrimary(
51
+ * 'channelId',
52
+ * { contactId: 'contactId' },
53
+ * );
54
+ * ```
55
+ */
56
+ setPrimary(channelID: string, params: ChannelSetPrimaryParams, options?: RequestOptions): APIPromise<ChannelSetPrimaryResponse>;
57
+ }
58
+ export interface ChannelUpdateResponse {
59
+ /**
60
+ * A communication channel for a contact.
61
+ */
62
+ channel: ContactsAPI.ContactChannel;
63
+ }
64
+ export interface ChannelAddResponse {
65
+ /**
66
+ * A communication channel for a contact.
67
+ */
68
+ channel: ContactsAPI.ContactChannel;
69
+ }
70
+ export interface ChannelSetPrimaryResponse {
71
+ /**
72
+ * A communication channel for a contact.
73
+ */
74
+ channel: ContactsAPI.ContactChannel;
75
+ }
76
+ export interface ChannelUpdateParams {
77
+ /**
78
+ * Path param
79
+ */
80
+ contactId: string;
81
+ /**
82
+ * Body param: Optional label for the channel. Set to null to clear.
83
+ */
84
+ label?: string | null;
85
+ /**
86
+ * Body param
87
+ */
88
+ metadata?: {
89
+ [key: string]: string;
90
+ };
91
+ /**
92
+ * Body param: Whether the channel is verified.
93
+ */
94
+ verified?: boolean;
95
+ }
96
+ export interface ChannelAddParams {
97
+ /**
98
+ * Channel type.
99
+ */
100
+ channel: 'sms' | 'whatsapp' | 'email' | 'telegram' | 'voice';
101
+ /**
102
+ * Channel identifier (phone number in E.164 format or email address).
103
+ */
104
+ identifier: string;
105
+ /**
106
+ * ISO country code for phone numbers.
107
+ */
108
+ countryCode?: string;
109
+ /**
110
+ * Whether this should be the primary channel for its type.
111
+ */
112
+ isPrimary?: boolean;
113
+ /**
114
+ * Optional label for the channel.
115
+ */
116
+ label?: string;
117
+ }
118
+ export interface ChannelRemoveParams {
119
+ contactId: string;
120
+ }
121
+ export interface ChannelSetPrimaryParams {
122
+ contactId: string;
123
+ }
124
+ export declare namespace Channels {
125
+ export { type ChannelUpdateResponse as ChannelUpdateResponse, type ChannelAddResponse as ChannelAddResponse, type ChannelSetPrimaryResponse as ChannelSetPrimaryResponse, type ChannelUpdateParams as ChannelUpdateParams, type ChannelAddParams as ChannelAddParams, type ChannelRemoveParams as ChannelRemoveParams, type ChannelSetPrimaryParams as ChannelSetPrimaryParams, };
126
+ }
127
+ //# sourceMappingURL=channels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../../src/resources/contacts/channels.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;OAUG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qBAAqB,CAAC;IAKpC;;;;;;;;;;;;;;OAcG;IACH,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAIxG;;;;;;;;;OASG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAQlG;;;;;;;;;;OAUG;IACH,UAAU,CACR,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,uBAAuB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,yBAAyB,CAAC;CAIzC;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC,cAAc,CAAC;CACrC;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC,cAAc,CAAC;CACrC;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC,cAAc,CAAC;CACrC;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAErC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,OAAO,EAAE,KAAK,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;IAE7D;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
@@ -0,0 +1,76 @@
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.Channels = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const headers_1 = require("../../internal/headers.js");
7
+ const path_1 = require("../../internal/utils/path.js");
8
+ class Channels extends resource_1.APIResource {
9
+ /**
10
+ * Update a contact's channel properties.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const channel = await client.contacts.channels.update(
15
+ * 'channelId',
16
+ * { contactId: 'contactId' },
17
+ * );
18
+ * ```
19
+ */
20
+ update(channelID, params, options) {
21
+ const { contactId, ...body } = params;
22
+ return this._client.patch((0, path_1.path) `/v1/contacts/${contactId}/channels/${channelID}`, { body, ...options });
23
+ }
24
+ /**
25
+ * Add a new communication channel to an existing contact.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const response = await client.contacts.channels.add(
30
+ * 'contactId',
31
+ * {
32
+ * channel: 'email',
33
+ * identifier: 'john.work@company.com',
34
+ * label: 'work',
35
+ * },
36
+ * );
37
+ * ```
38
+ */
39
+ add(contactID, body, options) {
40
+ return this._client.post((0, path_1.path) `/v1/contacts/${contactID}/channels`, { body, ...options });
41
+ }
42
+ /**
43
+ * Remove a communication channel from a contact. Cannot remove the last channel.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * await client.contacts.channels.remove('channelId', {
48
+ * contactId: 'contactId',
49
+ * });
50
+ * ```
51
+ */
52
+ remove(channelID, params, options) {
53
+ const { contactId } = params;
54
+ return this._client.delete((0, path_1.path) `/v1/contacts/${contactId}/channels/${channelID}`, {
55
+ ...options,
56
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
57
+ });
58
+ }
59
+ /**
60
+ * Set a channel as the primary channel for its type.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * const response = await client.contacts.channels.setPrimary(
65
+ * 'channelId',
66
+ * { contactId: 'contactId' },
67
+ * );
68
+ * ```
69
+ */
70
+ setPrimary(channelID, params, options) {
71
+ const { contactId } = params;
72
+ return this._client.post((0, path_1.path) `/v1/contacts/${contactId}/channels/${channelID}/primary`, options);
73
+ }
74
+ }
75
+ exports.Channels = Channels;
76
+ //# sourceMappingURL=channels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channels.js","sourceRoot":"","sources":["../../src/resources/contacts/channels.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAGlD,uDAAsD;AAEtD,uDAAiD;AAEjD,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;OAUG;IACH,MAAM,CACJ,SAAiB,EACjB,MAA2B,EAC3B,OAAwB;QAExB,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,gBAAgB,SAAS,aAAa,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzG,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,GAAG,CAAC,SAAiB,EAAE,IAAsB,EAAE,OAAwB;QACrE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,gBAAgB,SAAS,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,SAAiB,EAAE,MAA2B,EAAE,OAAwB;QAC7E,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,gBAAgB,SAAS,aAAa,SAAS,EAAE,EAAE;YAChF,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,UAAU,CACR,SAAiB,EACjB,MAA+B,EAC/B,OAAwB;QAExB,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,gBAAgB,SAAS,aAAa,SAAS,UAAU,EAAE,OAAO,CAAC,CAAC;IACnG,CAAC;CACF;AA7ED,4BA6EC"}
@@ -0,0 +1,72 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import { buildHeaders } from "../../internal/headers.mjs";
4
+ import { path } from "../../internal/utils/path.mjs";
5
+ export class Channels extends APIResource {
6
+ /**
7
+ * Update a contact's channel properties.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const channel = await client.contacts.channels.update(
12
+ * 'channelId',
13
+ * { contactId: 'contactId' },
14
+ * );
15
+ * ```
16
+ */
17
+ update(channelID, params, options) {
18
+ const { contactId, ...body } = params;
19
+ return this._client.patch(path `/v1/contacts/${contactId}/channels/${channelID}`, { body, ...options });
20
+ }
21
+ /**
22
+ * Add a new communication channel to an existing contact.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const response = await client.contacts.channels.add(
27
+ * 'contactId',
28
+ * {
29
+ * channel: 'email',
30
+ * identifier: 'john.work@company.com',
31
+ * label: 'work',
32
+ * },
33
+ * );
34
+ * ```
35
+ */
36
+ add(contactID, body, options) {
37
+ return this._client.post(path `/v1/contacts/${contactID}/channels`, { body, ...options });
38
+ }
39
+ /**
40
+ * Remove a communication channel from a contact. Cannot remove the last channel.
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * await client.contacts.channels.remove('channelId', {
45
+ * contactId: 'contactId',
46
+ * });
47
+ * ```
48
+ */
49
+ remove(channelID, params, options) {
50
+ const { contactId } = params;
51
+ return this._client.delete(path `/v1/contacts/${contactId}/channels/${channelID}`, {
52
+ ...options,
53
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
54
+ });
55
+ }
56
+ /**
57
+ * Set a channel as the primary channel for its type.
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * const response = await client.contacts.channels.setPrimary(
62
+ * 'channelId',
63
+ * { contactId: 'contactId' },
64
+ * );
65
+ * ```
66
+ */
67
+ setPrimary(channelID, params, options) {
68
+ const { contactId } = params;
69
+ return this._client.post(path `/v1/contacts/${contactId}/channels/${channelID}/primary`, options);
70
+ }
71
+ }
72
+ //# sourceMappingURL=channels.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channels.mjs","sourceRoot":"","sources":["../../src/resources/contacts/channels.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;OAUG;IACH,MAAM,CACJ,SAAiB,EACjB,MAA2B,EAC3B,OAAwB;QAExB,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,gBAAgB,SAAS,aAAa,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzG,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,GAAG,CAAC,SAAiB,EAAE,IAAsB,EAAE,OAAwB;QACrE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,gBAAgB,SAAS,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,SAAiB,EAAE,MAA2B,EAAE,OAAwB;QAC7E,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,gBAAgB,SAAS,aAAa,SAAS,EAAE,EAAE;YAChF,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,UAAU,CACR,SAAiB,EACjB,MAA+B,EAC/B,OAAwB;QAExB,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,gBAAgB,SAAS,aAAa,SAAS,UAAU,EAAE,OAAO,CAAC,CAAC;IACnG,CAAC;CACF"}
@@ -0,0 +1,262 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import * as ChannelsAPI from "./channels.mjs";
3
+ import { ChannelAddParams, ChannelAddResponse, ChannelRemoveParams, ChannelSetPrimaryParams, ChannelSetPrimaryResponse, ChannelUpdateParams, ChannelUpdateResponse, Channels } from "./channels.mjs";
4
+ import { APIPromise } from "../../core/api-promise.mjs";
5
+ import { Cursor, type CursorParams, PagePromise } from "../../core/pagination.mjs";
6
+ import { RequestOptions } from "../../internal/request-options.mjs";
7
+ export declare class Contacts extends APIResource {
8
+ channels: ChannelsAPI.Channels;
9
+ /**
10
+ * Create a new contact with one or more communication channels.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const contact = await client.contacts.create({
15
+ * channels: [
16
+ * {
17
+ * channel: 'sms',
18
+ * identifier: '+14155551234',
19
+ * isPrimary: true,
20
+ * },
21
+ * ],
22
+ * displayName: 'John Doe',
23
+ * });
24
+ * ```
25
+ */
26
+ create(body: ContactCreateParams, options?: RequestOptions): APIPromise<Contact>;
27
+ /**
28
+ * Get contact
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const contact = await client.contacts.retrieve('contactId');
33
+ * ```
34
+ */
35
+ retrieve(contactID: string, options?: RequestOptions): APIPromise<Contact>;
36
+ /**
37
+ * Update contact
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * const contact = await client.contacts.update('contactId');
42
+ * ```
43
+ */
44
+ update(contactID: string, body: ContactUpdateParams, options?: RequestOptions): APIPromise<Contact>;
45
+ /**
46
+ * List contacts with their communication channels.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * // Automatically fetches more pages as needed.
51
+ * for await (const contact of client.contacts.list()) {
52
+ * // ...
53
+ * }
54
+ * ```
55
+ */
56
+ list(query?: ContactListParams | null | undefined, options?: RequestOptions): PagePromise<ContactsCursor, Contact>;
57
+ /**
58
+ * Dismiss the merge suggestion for a contact.
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * await client.contacts.dismissMergeSuggestion('contactId');
63
+ * ```
64
+ */
65
+ dismissMergeSuggestion(contactID: string, options?: RequestOptions): APIPromise<void>;
66
+ /**
67
+ * Merge a source contact into this contact. All channels from the source contact
68
+ * will be moved to the target contact, and the source contact will be marked as
69
+ * merged.
70
+ *
71
+ * @example
72
+ * ```ts
73
+ * const contact = await client.contacts.merge('contactId', {
74
+ * sourceContactId: 'jx7xyz789',
75
+ * });
76
+ * ```
77
+ */
78
+ merge(contactID: string, body: ContactMergeParams, options?: RequestOptions): APIPromise<Contact>;
79
+ /**
80
+ * Get contact by phone number
81
+ *
82
+ * @example
83
+ * ```ts
84
+ * const contact = await client.contacts.retrieveByPhone(
85
+ * 'phoneNumber',
86
+ * );
87
+ * ```
88
+ */
89
+ retrieveByPhone(phoneNumber: string, options?: RequestOptions): APIPromise<Contact>;
90
+ }
91
+ export type ContactsCursor = Cursor<Contact>;
92
+ export interface Contact {
93
+ id: string;
94
+ /**
95
+ * List of available messaging channels for this contact.
96
+ */
97
+ availableChannels: Array<string>;
98
+ createdAt: string;
99
+ metadata: {
100
+ [key: string]: string;
101
+ };
102
+ /**
103
+ * Whether this contact has been verified.
104
+ */
105
+ verified: boolean;
106
+ /**
107
+ * All communication channels for this contact.
108
+ */
109
+ channels?: Array<ContactChannel>;
110
+ countryCode?: string;
111
+ /**
112
+ * Preferred channel for this contact.
113
+ */
114
+ defaultChannel?: 'sms' | 'whatsapp' | 'telegram' | 'email' | 'instagram' | 'voice';
115
+ /**
116
+ * Display name for the contact.
117
+ */
118
+ displayName?: string;
119
+ /**
120
+ * DEPRECATED: Use primaryPhone instead. Primary phone number in E.164 format.
121
+ */
122
+ phoneNumber?: string;
123
+ /**
124
+ * Primary email address.
125
+ */
126
+ primaryEmail?: string;
127
+ /**
128
+ * Primary phone number in E.164 format.
129
+ */
130
+ primaryPhone?: string;
131
+ /**
132
+ * Contact's WhatsApp profile name. Only available for WhatsApp contacts.
133
+ */
134
+ profileName?: string | null;
135
+ /**
136
+ * ID of a contact suggested for merging.
137
+ */
138
+ suggestedMergeWith?: string;
139
+ updatedAt?: string;
140
+ }
141
+ /**
142
+ * A communication channel for a contact.
143
+ */
144
+ export interface ContactChannel {
145
+ id: string;
146
+ /**
147
+ * Channel type.
148
+ */
149
+ channel: 'sms' | 'whatsapp' | 'email' | 'telegram' | 'voice';
150
+ createdAt: string;
151
+ /**
152
+ * Channel identifier (phone number or email address).
153
+ */
154
+ identifier: string;
155
+ /**
156
+ * Whether this is the primary channel for its type.
157
+ */
158
+ isPrimary: boolean;
159
+ /**
160
+ * Whether this channel has been verified.
161
+ */
162
+ verified: boolean;
163
+ /**
164
+ * ISO country code for phone numbers.
165
+ */
166
+ countryCode?: string;
167
+ /**
168
+ * Optional label for the channel.
169
+ */
170
+ label?: string;
171
+ /**
172
+ * Last time a message was received on this channel.
173
+ */
174
+ lastInboundAt?: string;
175
+ metadata?: {
176
+ [key: string]: string;
177
+ };
178
+ /**
179
+ * Delivery metrics for this channel.
180
+ */
181
+ metrics?: ContactChannel.Metrics;
182
+ updatedAt?: string;
183
+ }
184
+ export declare namespace ContactChannel {
185
+ /**
186
+ * Delivery metrics for this channel.
187
+ */
188
+ interface Metrics {
189
+ avgDeliveryTimeMs?: number;
190
+ failureCount?: number;
191
+ lastSuccessAt?: string;
192
+ successCount?: number;
193
+ totalAttempts?: number;
194
+ }
195
+ }
196
+ export interface ContactCreateParams {
197
+ /**
198
+ * Communication channels for the contact.
199
+ */
200
+ channels: Array<ContactCreateParams.Channel>;
201
+ /**
202
+ * Display name for the contact.
203
+ */
204
+ displayName?: string;
205
+ /**
206
+ * Arbitrary metadata to associate with the contact.
207
+ */
208
+ metadata?: {
209
+ [key: string]: string;
210
+ };
211
+ }
212
+ export declare namespace ContactCreateParams {
213
+ /**
214
+ * Input for creating a contact channel.
215
+ */
216
+ interface Channel {
217
+ /**
218
+ * Channel type.
219
+ */
220
+ channel: 'sms' | 'whatsapp' | 'email' | 'telegram' | 'voice';
221
+ /**
222
+ * Channel identifier (phone number in E.164 format or email address).
223
+ */
224
+ identifier: string;
225
+ /**
226
+ * ISO country code for phone numbers.
227
+ */
228
+ countryCode?: string;
229
+ /**
230
+ * Whether this should be the primary channel for its type.
231
+ */
232
+ isPrimary?: boolean;
233
+ /**
234
+ * Optional label for the channel.
235
+ */
236
+ label?: string;
237
+ }
238
+ }
239
+ export interface ContactUpdateParams {
240
+ /**
241
+ * Preferred channel for this contact. Set to null to clear.
242
+ */
243
+ defaultChannel?: 'sms' | 'whatsapp' | 'telegram' | 'email' | 'instagram' | 'voice' | null;
244
+ metadata?: {
245
+ [key: string]: string;
246
+ };
247
+ }
248
+ export interface ContactListParams extends CursorParams {
249
+ phoneNumber?: string;
250
+ }
251
+ export interface ContactMergeParams {
252
+ /**
253
+ * ID of the contact to merge into the target contact. The source contact will be
254
+ * marked as merged.
255
+ */
256
+ sourceContactId: string;
257
+ }
258
+ export declare namespace Contacts {
259
+ export { type Contact as Contact, type ContactChannel as ContactChannel, type ContactsCursor as ContactsCursor, type ContactCreateParams as ContactCreateParams, type ContactUpdateParams as ContactUpdateParams, type ContactListParams as ContactListParams, type ContactMergeParams as ContactMergeParams, };
260
+ export { Channels as Channels, type ChannelUpdateResponse as ChannelUpdateResponse, type ChannelAddResponse as ChannelAddResponse, type ChannelSetPrimaryResponse as ChannelSetPrimaryResponse, type ChannelUpdateParams as ChannelUpdateParams, type ChannelAddParams as ChannelAddParams, type ChannelRemoveParams as ChannelRemoveParams, type ChannelSetPrimaryParams as ChannelSetPrimaryParams, };
261
+ }
262
+ //# sourceMappingURL=contacts.d.mts.map