@zavudev/sdk 0.31.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 +116 -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
@@ -1,145 +1,2 @@
1
- import { APIResource } from "../core/resource.mjs";
2
- import { APIPromise } from "../core/api-promise.mjs";
3
- import { Cursor, type CursorParams, PagePromise } from "../core/pagination.mjs";
4
- import { RequestOptions } from "../internal/request-options.mjs";
5
- export declare class Contacts extends APIResource {
6
- /**
7
- * Get contact
8
- */
9
- retrieve(contactID: string, options?: RequestOptions): APIPromise<Contact>;
10
- /**
11
- * Update contact
12
- */
13
- update(contactID: string, body: ContactUpdateParams, options?: RequestOptions): APIPromise<Contact>;
14
- /**
15
- * List contacts with their communication channels.
16
- */
17
- list(query?: ContactListParams | null | undefined, options?: RequestOptions): PagePromise<ContactsCursor, Contact>;
18
- /**
19
- * Get contact by phone number
20
- */
21
- retrieveByPhone(phoneNumber: string, options?: RequestOptions): APIPromise<Contact>;
22
- }
23
- export type ContactsCursor = Cursor<Contact>;
24
- export interface Contact {
25
- id: string;
26
- /**
27
- * List of available messaging channels for this contact.
28
- */
29
- availableChannels: Array<string>;
30
- createdAt: string;
31
- metadata: {
32
- [key: string]: string;
33
- };
34
- /**
35
- * Whether this contact has been verified.
36
- */
37
- verified: boolean;
38
- /**
39
- * All communication channels for this contact.
40
- */
41
- channels?: Array<Contact.Channel>;
42
- countryCode?: string;
43
- /**
44
- * Preferred channel for this contact.
45
- */
46
- defaultChannel?: 'sms' | 'whatsapp' | 'telegram' | 'email' | 'instagram' | 'voice';
47
- /**
48
- * Display name for the contact.
49
- */
50
- displayName?: string;
51
- /**
52
- * DEPRECATED: Use primaryPhone instead. Primary phone number in E.164 format.
53
- */
54
- phoneNumber?: string;
55
- /**
56
- * Primary email address.
57
- */
58
- primaryEmail?: string;
59
- /**
60
- * Primary phone number in E.164 format.
61
- */
62
- primaryPhone?: string;
63
- /**
64
- * Contact's WhatsApp profile name. Only available for WhatsApp contacts.
65
- */
66
- profileName?: string | null;
67
- /**
68
- * ID of a contact suggested for merging.
69
- */
70
- suggestedMergeWith?: string;
71
- updatedAt?: string;
72
- }
73
- export declare namespace Contact {
74
- /**
75
- * A communication channel for a contact.
76
- */
77
- interface Channel {
78
- id: string;
79
- /**
80
- * Channel type.
81
- */
82
- channel: 'sms' | 'whatsapp' | 'email' | 'telegram' | 'voice';
83
- createdAt: string;
84
- /**
85
- * Channel identifier (phone number or email address).
86
- */
87
- identifier: string;
88
- /**
89
- * Whether this is the primary channel for its type.
90
- */
91
- isPrimary: boolean;
92
- /**
93
- * Whether this channel has been verified.
94
- */
95
- verified: boolean;
96
- /**
97
- * ISO country code for phone numbers.
98
- */
99
- countryCode?: string;
100
- /**
101
- * Optional label for the channel.
102
- */
103
- label?: string;
104
- /**
105
- * Last time a message was received on this channel.
106
- */
107
- lastInboundAt?: string;
108
- metadata?: {
109
- [key: string]: string;
110
- };
111
- /**
112
- * Delivery metrics for this channel.
113
- */
114
- metrics?: Channel.Metrics;
115
- updatedAt?: string;
116
- }
117
- namespace Channel {
118
- /**
119
- * Delivery metrics for this channel.
120
- */
121
- interface Metrics {
122
- avgDeliveryTimeMs?: number;
123
- failureCount?: number;
124
- lastSuccessAt?: string;
125
- successCount?: number;
126
- totalAttempts?: number;
127
- }
128
- }
129
- }
130
- export interface ContactUpdateParams {
131
- /**
132
- * Preferred channel for this contact. Set to null to clear.
133
- */
134
- defaultChannel?: 'sms' | 'whatsapp' | 'telegram' | 'email' | 'instagram' | 'voice' | null;
135
- metadata?: {
136
- [key: string]: string;
137
- };
138
- }
139
- export interface ContactListParams extends CursorParams {
140
- phoneNumber?: string;
141
- }
142
- export declare namespace Contacts {
143
- export { type Contact as Contact, type ContactsCursor as ContactsCursor, type ContactUpdateParams as ContactUpdateParams, type ContactListParams as ContactListParams, };
144
- }
1
+ export * from "./contacts/index.mjs";
145
2
  //# sourceMappingURL=contacts.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contacts.d.mts","sourceRoot":"","sources":["../src/resources/contacts.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAC1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAI1E;;OAEG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAA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AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
1
+ {"version":3,"file":"contacts.d.mts","sourceRoot":"","sources":["../src/resources/contacts.ts"],"names":[],"mappings":""}
@@ -1,145 +1,2 @@
1
- import { APIResource } from "../core/resource.js";
2
- import { APIPromise } from "../core/api-promise.js";
3
- import { Cursor, type CursorParams, PagePromise } from "../core/pagination.js";
4
- import { RequestOptions } from "../internal/request-options.js";
5
- export declare class Contacts extends APIResource {
6
- /**
7
- * Get contact
8
- */
9
- retrieve(contactID: string, options?: RequestOptions): APIPromise<Contact>;
10
- /**
11
- * Update contact
12
- */
13
- update(contactID: string, body: ContactUpdateParams, options?: RequestOptions): APIPromise<Contact>;
14
- /**
15
- * List contacts with their communication channels.
16
- */
17
- list(query?: ContactListParams | null | undefined, options?: RequestOptions): PagePromise<ContactsCursor, Contact>;
18
- /**
19
- * Get contact by phone number
20
- */
21
- retrieveByPhone(phoneNumber: string, options?: RequestOptions): APIPromise<Contact>;
22
- }
23
- export type ContactsCursor = Cursor<Contact>;
24
- export interface Contact {
25
- id: string;
26
- /**
27
- * List of available messaging channels for this contact.
28
- */
29
- availableChannels: Array<string>;
30
- createdAt: string;
31
- metadata: {
32
- [key: string]: string;
33
- };
34
- /**
35
- * Whether this contact has been verified.
36
- */
37
- verified: boolean;
38
- /**
39
- * All communication channels for this contact.
40
- */
41
- channels?: Array<Contact.Channel>;
42
- countryCode?: string;
43
- /**
44
- * Preferred channel for this contact.
45
- */
46
- defaultChannel?: 'sms' | 'whatsapp' | 'telegram' | 'email' | 'instagram' | 'voice';
47
- /**
48
- * Display name for the contact.
49
- */
50
- displayName?: string;
51
- /**
52
- * DEPRECATED: Use primaryPhone instead. Primary phone number in E.164 format.
53
- */
54
- phoneNumber?: string;
55
- /**
56
- * Primary email address.
57
- */
58
- primaryEmail?: string;
59
- /**
60
- * Primary phone number in E.164 format.
61
- */
62
- primaryPhone?: string;
63
- /**
64
- * Contact's WhatsApp profile name. Only available for WhatsApp contacts.
65
- */
66
- profileName?: string | null;
67
- /**
68
- * ID of a contact suggested for merging.
69
- */
70
- suggestedMergeWith?: string;
71
- updatedAt?: string;
72
- }
73
- export declare namespace Contact {
74
- /**
75
- * A communication channel for a contact.
76
- */
77
- interface Channel {
78
- id: string;
79
- /**
80
- * Channel type.
81
- */
82
- channel: 'sms' | 'whatsapp' | 'email' | 'telegram' | 'voice';
83
- createdAt: string;
84
- /**
85
- * Channel identifier (phone number or email address).
86
- */
87
- identifier: string;
88
- /**
89
- * Whether this is the primary channel for its type.
90
- */
91
- isPrimary: boolean;
92
- /**
93
- * Whether this channel has been verified.
94
- */
95
- verified: boolean;
96
- /**
97
- * ISO country code for phone numbers.
98
- */
99
- countryCode?: string;
100
- /**
101
- * Optional label for the channel.
102
- */
103
- label?: string;
104
- /**
105
- * Last time a message was received on this channel.
106
- */
107
- lastInboundAt?: string;
108
- metadata?: {
109
- [key: string]: string;
110
- };
111
- /**
112
- * Delivery metrics for this channel.
113
- */
114
- metrics?: Channel.Metrics;
115
- updatedAt?: string;
116
- }
117
- namespace Channel {
118
- /**
119
- * Delivery metrics for this channel.
120
- */
121
- interface Metrics {
122
- avgDeliveryTimeMs?: number;
123
- failureCount?: number;
124
- lastSuccessAt?: string;
125
- successCount?: number;
126
- totalAttempts?: number;
127
- }
128
- }
129
- }
130
- export interface ContactUpdateParams {
131
- /**
132
- * Preferred channel for this contact. Set to null to clear.
133
- */
134
- defaultChannel?: 'sms' | 'whatsapp' | 'telegram' | 'email' | 'instagram' | 'voice' | null;
135
- metadata?: {
136
- [key: string]: string;
137
- };
138
- }
139
- export interface ContactListParams extends CursorParams {
140
- phoneNumber?: string;
141
- }
142
- export declare namespace Contacts {
143
- export { type Contact as Contact, type ContactsCursor as ContactsCursor, type ContactUpdateParams as ContactUpdateParams, type ContactListParams as ContactListParams, };
144
- }
1
+ export * from "./contacts/index.js";
145
2
  //# sourceMappingURL=contacts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contacts.d.ts","sourceRoot":"","sources":["../src/resources/contacts.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAC1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAI1E;;OAEG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAInG;;OAEG;IACH,IAAI,CACF,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,cAAc,EAAE,OAAO,CAAC;IAIvC;;OAEG;IACH,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;CAGpF;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;AAE7C,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEjC,SAAS,EAAE,MAAM,CAAC;IAElB,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAEpC;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,QAAQ,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B,OAAO,CAAC;QACvB;;WAEG;QACH,UAAiB,OAAO;YACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;YAE3B,YAAY,CAAC,EAAE,MAAM,CAAC;YAEtB,aAAa,CAAC,EAAE,MAAM,CAAC;YAEvB,YAAY,CAAC,EAAE,MAAM,CAAC;YAEtB,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB;KACF;CACF;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,WAAW,GAAG,OAAO,GAAG,IAAI,CAAC;IAE1F,QAAQ,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACtC;AAED,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
1
+ {"version":3,"file":"contacts.d.ts","sourceRoot":"","sources":["../src/resources/contacts.ts"],"names":[],"mappings":""}
@@ -1,35 +1,6 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Contacts = void 0;
5
- const resource_1 = require("../core/resource.js");
6
- const pagination_1 = require("../core/pagination.js");
7
- const path_1 = require("../internal/utils/path.js");
8
- class Contacts extends resource_1.APIResource {
9
- /**
10
- * Get contact
11
- */
12
- retrieve(contactID, options) {
13
- return this._client.get((0, path_1.path) `/v1/contacts/${contactID}`, options);
14
- }
15
- /**
16
- * Update contact
17
- */
18
- update(contactID, body, options) {
19
- return this._client.patch((0, path_1.path) `/v1/contacts/${contactID}`, { body, ...options });
20
- }
21
- /**
22
- * List contacts with their communication channels.
23
- */
24
- list(query = {}, options) {
25
- return this._client.getAPIList('/v1/contacts', (pagination_1.Cursor), { query, ...options });
26
- }
27
- /**
28
- * Get contact by phone number
29
- */
30
- retrieveByPhone(phoneNumber, options) {
31
- return this._client.get((0, path_1.path) `/v1/contacts/phone/${phoneNumber}`, options);
32
- }
33
- }
34
- exports.Contacts = Contacts;
4
+ const tslib_1 = require("../internal/tslib.js");
5
+ tslib_1.__exportStar(require("./contacts/index.js"), exports);
35
6
  //# sourceMappingURL=contacts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contacts.js","sourceRoot":"","sources":["../src/resources/contacts.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAA4E;AAE5E,oDAA8C;AAE9C,MAAa,QAAS,SAAQ,sBAAW;IACvC;;OAEG;IACH,QAAQ,CAAC,SAAiB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,gBAAgB,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,SAAiB,EAAE,IAAyB,EAAE,OAAwB;QAC3E,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,gBAAgB,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;IAED;;OAEG;IACH,IAAI,CACF,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAA,mBAAe,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,WAAmB,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,sBAAsB,WAAW,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;CACF;AA/BD,4BA+BC"}
1
+ {"version":3,"file":"contacts.js","sourceRoot":"","sources":["../src/resources/contacts.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,8DAAiC"}
@@ -1,31 +1,3 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../core/resource.mjs";
3
- import { Cursor } from "../core/pagination.mjs";
4
- import { path } from "../internal/utils/path.mjs";
5
- export class Contacts extends APIResource {
6
- /**
7
- * Get contact
8
- */
9
- retrieve(contactID, options) {
10
- return this._client.get(path `/v1/contacts/${contactID}`, options);
11
- }
12
- /**
13
- * Update contact
14
- */
15
- update(contactID, body, options) {
16
- return this._client.patch(path `/v1/contacts/${contactID}`, { body, ...options });
17
- }
18
- /**
19
- * List contacts with their communication channels.
20
- */
21
- list(query = {}, options) {
22
- return this._client.getAPIList('/v1/contacts', (Cursor), { query, ...options });
23
- }
24
- /**
25
- * Get contact by phone number
26
- */
27
- retrieveByPhone(phoneNumber, options) {
28
- return this._client.get(path `/v1/contacts/phone/${phoneNumber}`, options);
29
- }
30
- }
2
+ export * from "./contacts/index.mjs";
31
3
  //# sourceMappingURL=contacts.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"contacts.mjs","sourceRoot":"","sources":["../src/resources/contacts.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,MAAM,EAAkC;OAE1C,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,QAAQ,CAAC,SAAiB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,gBAAgB,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,SAAiB,EAAE,IAAyB,EAAE,OAAwB;QAC3E,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,gBAAgB,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;IAED;;OAEG;IACH,IAAI,CACF,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAA,MAAe,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,WAAmB,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,sBAAsB,WAAW,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;CACF"}
1
+ {"version":3,"file":"contacts.mjs","sourceRoot":"","sources":["../src/resources/contacts.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
@@ -0,0 +1,101 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import { APIPromise } from "../core/api-promise.mjs";
3
+ import { Cursor, type CursorParams, PagePromise } from "../core/pagination.mjs";
4
+ import { RequestOptions } from "../internal/request-options.mjs";
5
+ export declare class Exports extends APIResource {
6
+ /**
7
+ * Create a new data export job. The export will be processed asynchronously and
8
+ * the download URL will be available when status is 'completed'. Export links
9
+ * expire after 24 hours.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const _export = await client.exports.create({
14
+ * dataTypes: ['messages', 'conversations'],
15
+ * dateFrom: '2024-01-01T00:00:00Z',
16
+ * dateTo: '2024-12-31T23:59:59Z',
17
+ * });
18
+ * ```
19
+ */
20
+ create(body: ExportCreateParams, options?: RequestOptions): APIPromise<ExportCreateResponse>;
21
+ /**
22
+ * Get details of a specific data export, including download URL when completed.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const _export = await client.exports.retrieve('exportId');
27
+ * ```
28
+ */
29
+ retrieve(exportID: string, options?: RequestOptions): APIPromise<ExportRetrieveResponse>;
30
+ /**
31
+ * List data exports for this project.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * // Automatically fetches more pages as needed.
36
+ * for await (const dataExport of client.exports.list()) {
37
+ * // ...
38
+ * }
39
+ * ```
40
+ */
41
+ list(query?: ExportListParams | null | undefined, options?: RequestOptions): PagePromise<DataExportsCursor, DataExport>;
42
+ }
43
+ export type DataExportsCursor = Cursor<DataExport>;
44
+ export interface DataExport {
45
+ id: string;
46
+ createdAt: string;
47
+ dataTypes: Array<'messages' | 'conversations' | 'webhookDeliveries' | 'agentExecutions' | 'activities'>;
48
+ /**
49
+ * When the export download link expires (24 hours after creation).
50
+ */
51
+ expiresAt: string;
52
+ /**
53
+ * Status of a data export job.
54
+ */
55
+ status: 'pending' | 'processing' | 'completed' | 'failed';
56
+ completedAt?: string | null;
57
+ dateFrom?: string | null;
58
+ dateTo?: string | null;
59
+ /**
60
+ * URL to download the export file. Only available when status is 'completed'.
61
+ */
62
+ downloadUrl?: string | null;
63
+ /**
64
+ * Error message if the export failed.
65
+ */
66
+ errorMessage?: string | null;
67
+ /**
68
+ * Size of the export file in bytes.
69
+ */
70
+ fileSize?: number | null;
71
+ }
72
+ export interface ExportCreateResponse {
73
+ export: DataExport;
74
+ }
75
+ export interface ExportRetrieveResponse {
76
+ export: DataExport;
77
+ }
78
+ export interface ExportCreateParams {
79
+ /**
80
+ * List of data types to include in the export.
81
+ */
82
+ dataTypes: Array<'messages' | 'conversations' | 'webhookDeliveries' | 'agentExecutions' | 'activities'>;
83
+ /**
84
+ * Start date for data to export (inclusive).
85
+ */
86
+ dateFrom?: string;
87
+ /**
88
+ * End date for data to export (inclusive).
89
+ */
90
+ dateTo?: string;
91
+ }
92
+ export interface ExportListParams extends CursorParams {
93
+ /**
94
+ * Status of a data export job.
95
+ */
96
+ status?: 'pending' | 'processing' | 'completed' | 'failed';
97
+ }
98
+ export declare namespace Exports {
99
+ export { type DataExport as DataExport, type ExportCreateResponse as ExportCreateResponse, type ExportRetrieveResponse as ExportRetrieveResponse, type DataExportsCursor as DataExportsCursor, type ExportCreateParams as ExportCreateParams, type ExportListParams as ExportListParams, };
100
+ }
101
+ //# sourceMappingURL=exports.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports.d.mts","sourceRoot":"","sources":["../src/resources/exports.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAC1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAI5F;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,sBAAsB,CAAC;IAIxF;;;;;;;;;;OAUG;IACH,IAAI,CACF,KAAK,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,iBAAiB,EAAE,UAAU,CAAC;CAG9C;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAEnD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IAEX,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,KAAK,CAAC,UAAU,GAAG,eAAe,GAAG,mBAAmB,GAAG,iBAAiB,GAAG,YAAY,CAAC,CAAC;IAExG;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,EAAE,SAAS,GAAG,YAAY,GAAG,WAAW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orParams, PagePromise } from "../core/pagination.js";
4
+ import { RequestOptions } from "../internal/request-options.js";
5
+ export declare class Exports extends APIResource {
6
+ /**
7
+ * Create a new data export job. The export will be processed asynchronously and
8
+ * the download URL will be available when status is 'completed'. Export links
9
+ * expire after 24 hours.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const _export = await client.exports.create({
14
+ * dataTypes: ['messages', 'conversations'],
15
+ * dateFrom: '2024-01-01T00:00:00Z',
16
+ * dateTo: '2024-12-31T23:59:59Z',
17
+ * });
18
+ * ```
19
+ */
20
+ create(body: ExportCreateParams, options?: RequestOptions): APIPromise<ExportCreateResponse>;
21
+ /**
22
+ * Get details of a specific data export, including download URL when completed.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const _export = await client.exports.retrieve('exportId');
27
+ * ```
28
+ */
29
+ retrieve(exportID: string, options?: RequestOptions): APIPromise<ExportRetrieveResponse>;
30
+ /**
31
+ * List data exports for this project.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * // Automatically fetches more pages as needed.
36
+ * for await (const dataExport of client.exports.list()) {
37
+ * // ...
38
+ * }
39
+ * ```
40
+ */
41
+ list(query?: ExportListParams | null | undefined, options?: RequestOptions): PagePromise<DataExportsCursor, DataExport>;
42
+ }
43
+ export type DataExportsCursor = Cursor<DataExport>;
44
+ export interface DataExport {
45
+ id: string;
46
+ createdAt: string;
47
+ dataTypes: Array<'messages' | 'conversations' | 'webhookDeliveries' | 'agentExecutions' | 'activities'>;
48
+ /**
49
+ * When the export download link expires (24 hours after creation).
50
+ */
51
+ expiresAt: string;
52
+ /**
53
+ * Status of a data export job.
54
+ */
55
+ status: 'pending' | 'processing' | 'completed' | 'failed';
56
+ completedAt?: string | null;
57
+ dateFrom?: string | null;
58
+ dateTo?: string | null;
59
+ /**
60
+ * URL to download the export file. Only available when status is 'completed'.
61
+ */
62
+ downloadUrl?: string | null;
63
+ /**
64
+ * Error message if the export failed.
65
+ */
66
+ errorMessage?: string | null;
67
+ /**
68
+ * Size of the export file in bytes.
69
+ */
70
+ fileSize?: number | null;
71
+ }
72
+ export interface ExportCreateResponse {
73
+ export: DataExport;
74
+ }
75
+ export interface ExportRetrieveResponse {
76
+ export: DataExport;
77
+ }
78
+ export interface ExportCreateParams {
79
+ /**
80
+ * List of data types to include in the export.
81
+ */
82
+ dataTypes: Array<'messages' | 'conversations' | 'webhookDeliveries' | 'agentExecutions' | 'activities'>;
83
+ /**
84
+ * Start date for data to export (inclusive).
85
+ */
86
+ dateFrom?: string;
87
+ /**
88
+ * End date for data to export (inclusive).
89
+ */
90
+ dateTo?: string;
91
+ }
92
+ export interface ExportListParams extends CursorParams {
93
+ /**
94
+ * Status of a data export job.
95
+ */
96
+ status?: 'pending' | 'processing' | 'completed' | 'failed';
97
+ }
98
+ export declare namespace Exports {
99
+ export { type DataExport as DataExport, type ExportCreateResponse as ExportCreateResponse, type ExportRetrieveResponse as ExportRetrieveResponse, type DataExportsCursor as DataExportsCursor, type ExportCreateParams as ExportCreateParams, type ExportListParams as ExportListParams, };
100
+ }
101
+ //# sourceMappingURL=exports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../src/resources/exports.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAC1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAI5F;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,sBAAsB,CAAC;IAIxF;;;;;;;;;;OAUG;IACH,IAAI,CACF,KAAK,GAAE,gBAAgB,GA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IACH,MAAM,CAAC,EAAE,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,QAAQ,CAAC;CAC5D;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -0,0 +1,53 @@
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.Exports = void 0;
5
+ const resource_1 = require("../core/resource.js");
6
+ const pagination_1 = require("../core/pagination.js");
7
+ const path_1 = require("../internal/utils/path.js");
8
+ class Exports extends resource_1.APIResource {
9
+ /**
10
+ * Create a new data export job. The export will be processed asynchronously and
11
+ * the download URL will be available when status is 'completed'. Export links
12
+ * expire after 24 hours.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const _export = await client.exports.create({
17
+ * dataTypes: ['messages', 'conversations'],
18
+ * dateFrom: '2024-01-01T00:00:00Z',
19
+ * dateTo: '2024-12-31T23:59:59Z',
20
+ * });
21
+ * ```
22
+ */
23
+ create(body, options) {
24
+ return this._client.post('/v1/exports', { body, ...options });
25
+ }
26
+ /**
27
+ * Get details of a specific data export, including download URL when completed.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const _export = await client.exports.retrieve('exportId');
32
+ * ```
33
+ */
34
+ retrieve(exportID, options) {
35
+ return this._client.get((0, path_1.path) `/v1/exports/${exportID}`, options);
36
+ }
37
+ /**
38
+ * List data exports for this project.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * // Automatically fetches more pages as needed.
43
+ * for await (const dataExport of client.exports.list()) {
44
+ * // ...
45
+ * }
46
+ * ```
47
+ */
48
+ list(query = {}, options) {
49
+ return this._client.getAPIList('/v1/exports', (pagination_1.Cursor), { query, ...options });
50
+ }
51
+ }
52
+ exports.Exports = Exports;
53
+ //# sourceMappingURL=exports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports.js","sourceRoot":"","sources":["../src/resources/exports.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAA4E;AAE5E,oDAA8C;AAE9C,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,EAAE,CAAA,mBAAkB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3F,CAAC;CACF;AAhDD,0BAgDC"}