@polymorfa/sdk 0.1.0-dev.20260922093854

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 (347) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1881 -0
  3. package/dist/bridge.d.ts +31 -0
  4. package/dist/bridge.d.ts.map +1 -0
  5. package/dist/bridge.js +39 -0
  6. package/dist/bridge.js.map +1 -0
  7. package/dist/calls/api.d.ts +109 -0
  8. package/dist/calls/api.d.ts.map +1 -0
  9. package/dist/calls/api.js +179 -0
  10. package/dist/calls/api.js.map +1 -0
  11. package/dist/calls/call.d.ts +286 -0
  12. package/dist/calls/call.d.ts.map +1 -0
  13. package/dist/calls/call.js +860 -0
  14. package/dist/calls/call.js.map +1 -0
  15. package/dist/calls/client.d.ts +124 -0
  16. package/dist/calls/client.d.ts.map +1 -0
  17. package/dist/calls/client.js +447 -0
  18. package/dist/calls/client.js.map +1 -0
  19. package/dist/calls/diagnostics.d.ts +74 -0
  20. package/dist/calls/diagnostics.d.ts.map +1 -0
  21. package/dist/calls/diagnostics.js +133 -0
  22. package/dist/calls/diagnostics.js.map +1 -0
  23. package/dist/calls/errors.d.ts +37 -0
  24. package/dist/calls/errors.d.ts.map +1 -0
  25. package/dist/calls/errors.js +52 -0
  26. package/dist/calls/errors.js.map +1 -0
  27. package/dist/calls/events.d.ts +15 -0
  28. package/dist/calls/events.d.ts.map +1 -0
  29. package/dist/calls/events.js +34 -0
  30. package/dist/calls/events.js.map +1 -0
  31. package/dist/calls/index.d.ts +6 -0
  32. package/dist/calls/index.d.ts.map +1 -0
  33. package/dist/calls/index.js +7 -0
  34. package/dist/calls/index.js.map +1 -0
  35. package/dist/calls/internal.d.ts +18 -0
  36. package/dist/calls/internal.d.ts.map +1 -0
  37. package/dist/calls/internal.js +18 -0
  38. package/dist/calls/internal.js.map +1 -0
  39. package/dist/calls/lifecycle.d.ts +111 -0
  40. package/dist/calls/lifecycle.d.ts.map +1 -0
  41. package/dist/calls/lifecycle.js +490 -0
  42. package/dist/calls/lifecycle.js.map +1 -0
  43. package/dist/calls/media.d.ts +102 -0
  44. package/dist/calls/media.d.ts.map +1 -0
  45. package/dist/calls/media.js +414 -0
  46. package/dist/calls/media.js.map +1 -0
  47. package/dist/calls/protocol.d.ts +216 -0
  48. package/dist/calls/protocol.d.ts.map +1 -0
  49. package/dist/calls/protocol.js +268 -0
  50. package/dist/calls/protocol.js.map +1 -0
  51. package/dist/calls/token.d.ts +43 -0
  52. package/dist/calls/token.d.ts.map +1 -0
  53. package/dist/calls/token.js +146 -0
  54. package/dist/calls/token.js.map +1 -0
  55. package/dist/client.d.ts +65 -0
  56. package/dist/client.d.ts.map +1 -0
  57. package/dist/client.js +119 -0
  58. package/dist/client.js.map +1 -0
  59. package/dist/credentials.d.ts +50 -0
  60. package/dist/credentials.d.ts.map +1 -0
  61. package/dist/credentials.js +73 -0
  62. package/dist/credentials.js.map +1 -0
  63. package/dist/errors.d.ts +71 -0
  64. package/dist/errors.d.ts.map +1 -0
  65. package/dist/errors.js +129 -0
  66. package/dist/errors.js.map +1 -0
  67. package/dist/index.d.ts +70 -0
  68. package/dist/index.d.ts.map +1 -0
  69. package/dist/index.js +61 -0
  70. package/dist/index.js.map +1 -0
  71. package/dist/media/whatsapp.d.ts +105 -0
  72. package/dist/media/whatsapp.d.ts.map +1 -0
  73. package/dist/media/whatsapp.js +624 -0
  74. package/dist/media/whatsapp.js.map +1 -0
  75. package/dist/messaging/bansafe.d.ts +30 -0
  76. package/dist/messaging/bansafe.d.ts.map +1 -0
  77. package/dist/messaging/bansafe.js +86 -0
  78. package/dist/messaging/bansafe.js.map +1 -0
  79. package/dist/messaging/business.d.ts +35 -0
  80. package/dist/messaging/business.d.ts.map +1 -0
  81. package/dist/messaging/business.js +145 -0
  82. package/dist/messaging/business.js.map +1 -0
  83. package/dist/messaging/calls.d.ts +9 -0
  84. package/dist/messaging/calls.d.ts.map +1 -0
  85. package/dist/messaging/calls.js +16 -0
  86. package/dist/messaging/calls.js.map +1 -0
  87. package/dist/messaging/campaigns.d.ts +19 -0
  88. package/dist/messaging/campaigns.d.ts.map +1 -0
  89. package/dist/messaging/campaigns.js +77 -0
  90. package/dist/messaging/campaigns.js.map +1 -0
  91. package/dist/messaging/channels.d.ts +23 -0
  92. package/dist/messaging/channels.d.ts.map +1 -0
  93. package/dist/messaging/channels.js +104 -0
  94. package/dist/messaging/channels.js.map +1 -0
  95. package/dist/messaging/chats.d.ts +14 -0
  96. package/dist/messaging/chats.d.ts.map +1 -0
  97. package/dist/messaging/chats.js +51 -0
  98. package/dist/messaging/chats.js.map +1 -0
  99. package/dist/messaging/client-tokens.d.ts +15 -0
  100. package/dist/messaging/client-tokens.d.ts.map +1 -0
  101. package/dist/messaging/client-tokens.js +64 -0
  102. package/dist/messaging/client-tokens.js.map +1 -0
  103. package/dist/messaging/client.d.ts +58 -0
  104. package/dist/messaging/client.d.ts.map +1 -0
  105. package/dist/messaging/client.js +100 -0
  106. package/dist/messaging/client.js.map +1 -0
  107. package/dist/messaging/contacts.d.ts +20 -0
  108. package/dist/messaging/contacts.d.ts.map +1 -0
  109. package/dist/messaging/contacts.js +75 -0
  110. package/dist/messaging/contacts.js.map +1 -0
  111. package/dist/messaging/groups.d.ts +34 -0
  112. package/dist/messaging/groups.d.ts.map +1 -0
  113. package/dist/messaging/groups.js +97 -0
  114. package/dist/messaging/groups.js.map +1 -0
  115. package/dist/messaging/identities.d.ts +9 -0
  116. package/dist/messaging/identities.d.ts.map +1 -0
  117. package/dist/messaging/identities.js +21 -0
  118. package/dist/messaging/identities.js.map +1 -0
  119. package/dist/messaging/labels.d.ts +16 -0
  120. package/dist/messaging/labels.d.ts.map +1 -0
  121. package/dist/messaging/labels.js +65 -0
  122. package/dist/messaging/labels.js.map +1 -0
  123. package/dist/messaging/media.d.ts +72 -0
  124. package/dist/messaging/media.d.ts.map +1 -0
  125. package/dist/messaging/media.js +142 -0
  126. package/dist/messaging/media.js.map +1 -0
  127. package/dist/messaging/messages.d.ts +18 -0
  128. package/dist/messaging/messages.d.ts.map +1 -0
  129. package/dist/messaging/messages.js +32 -0
  130. package/dist/messaging/messages.js.map +1 -0
  131. package/dist/messaging/observation-policies.d.ts +10 -0
  132. package/dist/messaging/observation-policies.d.ts.map +1 -0
  133. package/dist/messaging/observation-policies.js +28 -0
  134. package/dist/messaging/observation-policies.js.map +1 -0
  135. package/dist/messaging/onboarding.d.ts +53 -0
  136. package/dist/messaging/onboarding.d.ts.map +1 -0
  137. package/dist/messaging/onboarding.js +69 -0
  138. package/dist/messaging/onboarding.js.map +1 -0
  139. package/dist/messaging/presence.d.ts +12 -0
  140. package/dist/messaging/presence.d.ts.map +1 -0
  141. package/dist/messaging/presence.js +43 -0
  142. package/dist/messaging/presence.js.map +1 -0
  143. package/dist/messaging/privacy.d.ts +11 -0
  144. package/dist/messaging/privacy.d.ts.map +1 -0
  145. package/dist/messaging/privacy.js +34 -0
  146. package/dist/messaging/privacy.js.map +1 -0
  147. package/dist/messaging/profile.d.ts +13 -0
  148. package/dist/messaging/profile.d.ts.map +1 -0
  149. package/dist/messaging/profile.js +49 -0
  150. package/dist/messaging/profile.js.map +1 -0
  151. package/dist/messaging/quick-replies.d.ts +13 -0
  152. package/dist/messaging/quick-replies.d.ts.map +1 -0
  153. package/dist/messaging/quick-replies.js +45 -0
  154. package/dist/messaging/quick-replies.js.map +1 -0
  155. package/dist/messaging/quicklinks.d.ts +69 -0
  156. package/dist/messaging/quicklinks.d.ts.map +1 -0
  157. package/dist/messaging/quicklinks.js +45 -0
  158. package/dist/messaging/quicklinks.js.map +1 -0
  159. package/dist/messaging/session-configuration.d.ts +67 -0
  160. package/dist/messaging/session-configuration.d.ts.map +1 -0
  161. package/dist/messaging/session-configuration.js +2 -0
  162. package/dist/messaging/session-configuration.js.map +1 -0
  163. package/dist/messaging/sessions.d.ts +26 -0
  164. package/dist/messaging/sessions.d.ts.map +1 -0
  165. package/dist/messaging/sessions.js +108 -0
  166. package/dist/messaging/sessions.js.map +1 -0
  167. package/dist/messaging/templates.d.ts +15 -0
  168. package/dist/messaging/templates.d.ts.map +1 -0
  169. package/dist/messaging/templates.js +67 -0
  170. package/dist/messaging/templates.js.map +1 -0
  171. package/dist/messaging/testing-configuration.d.ts +89 -0
  172. package/dist/messaging/testing-configuration.d.ts.map +1 -0
  173. package/dist/messaging/testing-configuration.js +14 -0
  174. package/dist/messaging/testing-configuration.js.map +1 -0
  175. package/dist/messaging/types.d.ts +1793 -0
  176. package/dist/messaging/types.d.ts.map +1 -0
  177. package/dist/messaging/types.js +25 -0
  178. package/dist/messaging/types.js.map +1 -0
  179. package/dist/messaging/users.d.ts +9 -0
  180. package/dist/messaging/users.d.ts.map +1 -0
  181. package/dist/messaging/users.js +15 -0
  182. package/dist/messaging/users.js.map +1 -0
  183. package/dist/messaging/voip.d.ts +51 -0
  184. package/dist/messaging/voip.d.ts.map +1 -0
  185. package/dist/messaging/voip.js +293 -0
  186. package/dist/messaging/voip.js.map +1 -0
  187. package/dist/messaging/webhooks.d.ts +13 -0
  188. package/dist/messaging/webhooks.d.ts.map +1 -0
  189. package/dist/messaging/webhooks.js +48 -0
  190. package/dist/messaging/webhooks.js.map +1 -0
  191. package/dist/node.d.ts +55 -0
  192. package/dist/node.d.ts.map +1 -0
  193. package/dist/node.js +237 -0
  194. package/dist/node.js.map +1 -0
  195. package/dist/pagination.d.ts +24 -0
  196. package/dist/pagination.d.ts.map +1 -0
  197. package/dist/pagination.js +28 -0
  198. package/dist/pagination.js.map +1 -0
  199. package/dist/platform/api-keys.d.ts +10 -0
  200. package/dist/platform/api-keys.d.ts.map +1 -0
  201. package/dist/platform/api-keys.js +22 -0
  202. package/dist/platform/api-keys.js.map +1 -0
  203. package/dist/platform/audiences.d.ts +16 -0
  204. package/dist/platform/audiences.d.ts.map +1 -0
  205. package/dist/platform/audiences.js +46 -0
  206. package/dist/platform/audiences.js.map +1 -0
  207. package/dist/platform/audit-logs.d.ts +9 -0
  208. package/dist/platform/audit-logs.d.ts.map +1 -0
  209. package/dist/platform/audit-logs.js +20 -0
  210. package/dist/platform/audit-logs.js.map +1 -0
  211. package/dist/platform/bansafe.d.ts +24 -0
  212. package/dist/platform/bansafe.d.ts.map +1 -0
  213. package/dist/platform/bansafe.js +70 -0
  214. package/dist/platform/bansafe.js.map +1 -0
  215. package/dist/platform/billing.d.ts +13 -0
  216. package/dist/platform/billing.d.ts.map +1 -0
  217. package/dist/platform/billing.js +27 -0
  218. package/dist/platform/billing.js.map +1 -0
  219. package/dist/platform/campaigns.d.ts +28 -0
  220. package/dist/platform/campaigns.d.ts.map +1 -0
  221. package/dist/platform/campaigns.js +92 -0
  222. package/dist/platform/campaigns.js.map +1 -0
  223. package/dist/platform/customers.d.ts +23 -0
  224. package/dist/platform/customers.d.ts.map +1 -0
  225. package/dist/platform/customers.js +140 -0
  226. package/dist/platform/customers.js.map +1 -0
  227. package/dist/platform/developer-resources.d.ts +101 -0
  228. package/dist/platform/developer-resources.d.ts.map +1 -0
  229. package/dist/platform/developer-resources.js +250 -0
  230. package/dist/platform/developer-resources.js.map +1 -0
  231. package/dist/platform/developer-types.d.ts +378 -0
  232. package/dist/platform/developer-types.d.ts.map +1 -0
  233. package/dist/platform/developer-types.js +2 -0
  234. package/dist/platform/developer-types.js.map +1 -0
  235. package/dist/platform/event-stream.d.ts +114 -0
  236. package/dist/platform/event-stream.d.ts.map +1 -0
  237. package/dist/platform/event-stream.js +308 -0
  238. package/dist/platform/event-stream.js.map +1 -0
  239. package/dist/platform/media.d.ts +13 -0
  240. package/dist/platform/media.d.ts.map +1 -0
  241. package/dist/platform/media.js +33 -0
  242. package/dist/platform/media.js.map +1 -0
  243. package/dist/platform/members.d.ts +9 -0
  244. package/dist/platform/members.d.ts.map +1 -0
  245. package/dist/platform/members.js +15 -0
  246. package/dist/platform/members.js.map +1 -0
  247. package/dist/platform/opt-outs.d.ts +15 -0
  248. package/dist/platform/opt-outs.d.ts.map +1 -0
  249. package/dist/platform/opt-outs.js +36 -0
  250. package/dist/platform/opt-outs.js.map +1 -0
  251. package/dist/platform/organizations.d.ts +9 -0
  252. package/dist/platform/organizations.d.ts.map +1 -0
  253. package/dist/platform/organizations.js +15 -0
  254. package/dist/platform/organizations.js.map +1 -0
  255. package/dist/platform/project-tokens.d.ts +9 -0
  256. package/dist/platform/project-tokens.d.ts.map +1 -0
  257. package/dist/platform/project-tokens.js +16 -0
  258. package/dist/platform/project-tokens.js.map +1 -0
  259. package/dist/platform/projects.d.ts +24 -0
  260. package/dist/platform/projects.d.ts.map +1 -0
  261. package/dist/platform/projects.js +83 -0
  262. package/dist/platform/projects.js.map +1 -0
  263. package/dist/platform/quicklink-settings.d.ts +85 -0
  264. package/dist/platform/quicklink-settings.d.ts.map +1 -0
  265. package/dist/platform/quicklink-settings.js +35 -0
  266. package/dist/platform/quicklink-settings.js.map +1 -0
  267. package/dist/platform/response.d.ts +10 -0
  268. package/dist/platform/response.d.ts.map +1 -0
  269. package/dist/platform/response.js +41 -0
  270. package/dist/platform/response.js.map +1 -0
  271. package/dist/platform/security-incidents.d.ts +10 -0
  272. package/dist/platform/security-incidents.d.ts.map +1 -0
  273. package/dist/platform/security-incidents.js +22 -0
  274. package/dist/platform/security-incidents.js.map +1 -0
  275. package/dist/platform/session-bans.d.ts +13 -0
  276. package/dist/platform/session-bans.d.ts.map +1 -0
  277. package/dist/platform/session-bans.js +21 -0
  278. package/dist/platform/session-bans.js.map +1 -0
  279. package/dist/platform/session-configuration.d.ts +15 -0
  280. package/dist/platform/session-configuration.d.ts.map +1 -0
  281. package/dist/platform/session-configuration.js +36 -0
  282. package/dist/platform/session-configuration.js.map +1 -0
  283. package/dist/platform/sessions.d.ts +26 -0
  284. package/dist/platform/sessions.d.ts.map +1 -0
  285. package/dist/platform/sessions.js +121 -0
  286. package/dist/platform/sessions.js.map +1 -0
  287. package/dist/platform/sip-trunks.d.ts +141 -0
  288. package/dist/platform/sip-trunks.d.ts.map +1 -0
  289. package/dist/platform/sip-trunks.js +140 -0
  290. package/dist/platform/sip-trunks.js.map +1 -0
  291. package/dist/platform/types.d.ts +897 -0
  292. package/dist/platform/types.d.ts.map +1 -0
  293. package/dist/platform/types.js +2 -0
  294. package/dist/platform/types.js.map +1 -0
  295. package/dist/raw.d.ts +26 -0
  296. package/dist/raw.d.ts.map +1 -0
  297. package/dist/raw.js +79 -0
  298. package/dist/raw.js.map +1 -0
  299. package/dist/system.d.ts +37 -0
  300. package/dist/system.d.ts.map +1 -0
  301. package/dist/system.js +45 -0
  302. package/dist/system.js.map +1 -0
  303. package/dist/transport/body.d.ts +6 -0
  304. package/dist/transport/body.d.ts.map +1 -0
  305. package/dist/transport/body.js +33 -0
  306. package/dist/transport/body.js.map +1 -0
  307. package/dist/transport/content-disposition.d.ts +9 -0
  308. package/dist/transport/content-disposition.d.ts.map +1 -0
  309. package/dist/transport/content-disposition.js +107 -0
  310. package/dist/transport/content-disposition.js.map +1 -0
  311. package/dist/transport/http.d.ts +35 -0
  312. package/dist/transport/http.d.ts.map +1 -0
  313. package/dist/transport/http.js +660 -0
  314. package/dist/transport/http.js.map +1 -0
  315. package/dist/transport/idempotency.d.ts +10 -0
  316. package/dist/transport/idempotency.d.ts.map +1 -0
  317. package/dist/transport/idempotency.js +13 -0
  318. package/dist/transport/idempotency.js.map +1 -0
  319. package/dist/transport/retry.d.ts +11 -0
  320. package/dist/transport/retry.d.ts.map +1 -0
  321. package/dist/transport/retry.js +45 -0
  322. package/dist/transport/retry.js.map +1 -0
  323. package/dist/transport/types.d.ts +58 -0
  324. package/dist/transport/types.d.ts.map +1 -0
  325. package/dist/transport/types.js +2 -0
  326. package/dist/transport/types.js.map +1 -0
  327. package/dist/version.d.ts +2 -0
  328. package/dist/version.d.ts.map +1 -0
  329. package/dist/version.js +2 -0
  330. package/dist/version.js.map +1 -0
  331. package/dist/webhooks/events.d.ts +741 -0
  332. package/dist/webhooks/events.d.ts.map +1 -0
  333. package/dist/webhooks/events.js +80 -0
  334. package/dist/webhooks/events.js.map +1 -0
  335. package/dist/webhooks/index.d.ts +4 -0
  336. package/dist/webhooks/index.d.ts.map +1 -0
  337. package/dist/webhooks/index.js +4 -0
  338. package/dist/webhooks/index.js.map +1 -0
  339. package/dist/webhooks/utilities.d.ts +33 -0
  340. package/dist/webhooks/utilities.d.ts.map +1 -0
  341. package/dist/webhooks/utilities.js +67 -0
  342. package/dist/webhooks/utilities.js.map +1 -0
  343. package/dist/webhooks/verify.d.ts +9 -0
  344. package/dist/webhooks/verify.d.ts.map +1 -0
  345. package/dist/webhooks/verify.js +77 -0
  346. package/dist/webhooks/verify.js.map +1 -0
  347. package/package.json +58 -0
@@ -0,0 +1,1793 @@
1
+ export type MessagingConnection = "linked_device" | "cloud_api";
2
+ export type BartenderMode = "magic" | "passthrough" | "passthrough_plus";
3
+ export interface CloudApiCredentials {
4
+ readonly phoneNumberId: string;
5
+ readonly wabaId: string;
6
+ readonly businessAccountId?: string;
7
+ readonly appId: string;
8
+ readonly appSecret: string;
9
+ readonly systemUserToken: string;
10
+ readonly webhookVerifyToken: string;
11
+ }
12
+ export interface HistorySyncPolicy {
13
+ readonly mode?: "metadata_only" | "deliver";
14
+ readonly requestFull?: boolean;
15
+ }
16
+ export interface Session {
17
+ readonly sessionId: string;
18
+ readonly name: string;
19
+ readonly externalId?: string;
20
+ readonly tenantId: string;
21
+ readonly type: MessagingConnection;
22
+ readonly testMode: boolean;
23
+ readonly status: string;
24
+ readonly statusReason?: string;
25
+ readonly configuration?: import("./session-configuration.js").SessionConfigurationView;
26
+ readonly createdAt: string;
27
+ readonly updatedAt: string;
28
+ }
29
+ export interface UpdateSessionRequest {
30
+ readonly configuration: import("./session-configuration.js").SessionConfigurationPatch;
31
+ readonly revision: number;
32
+ }
33
+ export interface SessionOperation extends Session {
34
+ readonly operationId?: string;
35
+ }
36
+ export interface OperationAccepted {
37
+ readonly success: true;
38
+ readonly message: string;
39
+ readonly operationId: string;
40
+ }
41
+ /** Where the account's primary WhatsApp client runs. `meta_cloud` means Meta hosts the number. */
42
+ export type PhonePlatform = "android" | "ios" | "meta_cloud" | "unknown";
43
+ /**
44
+ * `whatsapp_app` and `business_app` connect as linked devices. `meta_cloud` is
45
+ * Meta Cloud API. `meta_coexistence` is Cloud API with the WhatsApp Business
46
+ * app still active on the phone.
47
+ */
48
+ export type WhatsAppAccountType = "whatsapp_app" | "business_app" | "meta_cloud" | "meta_coexistence";
49
+ export interface WhatsAppAccount {
50
+ readonly id?: string;
51
+ readonly bsuid?: string;
52
+ readonly username?: string;
53
+ readonly phoneNumber?: string;
54
+ readonly pushName: string;
55
+ readonly businessName?: string;
56
+ readonly phonePlatform?: PhonePlatform;
57
+ readonly accountType?: WhatsAppAccountType;
58
+ readonly profilePicUrl?: string;
59
+ }
60
+ export interface SuccessEnvelope<T> {
61
+ readonly success: true;
62
+ readonly data: T;
63
+ }
64
+ export interface SuccessResponse {
65
+ readonly success: boolean;
66
+ readonly message?: string;
67
+ }
68
+ /** Project-scoped campaign summary returned by the Messaging API. */
69
+ export interface Campaign {
70
+ readonly id: string;
71
+ readonly name: string;
72
+ /** The pinned contract deliberately leaves campaign states forward-compatible. */
73
+ readonly status: string;
74
+ readonly templateId: string | null;
75
+ readonly recipientListId: string | null;
76
+ readonly recipientCount: number;
77
+ readonly sentCount: number;
78
+ readonly deliveredCount: number;
79
+ readonly readCount: number;
80
+ readonly failedCount: number;
81
+ readonly skippedCount: number;
82
+ /** Epoch milliseconds, or null when the lifecycle timestamp is absent. */
83
+ readonly scheduledAt: number | null;
84
+ readonly launchedAt: number | null;
85
+ readonly completedAt: number | null;
86
+ readonly createdAt: number;
87
+ readonly updatedAt: number;
88
+ /** Additional live repository fields omitted from the pinned OpenAPI schema. */
89
+ readonly composerBlueprint?: unknown;
90
+ readonly messages?: unknown;
91
+ readonly audienceRef?: unknown;
92
+ readonly senderConfig?: unknown;
93
+ readonly complianceConfig?: unknown;
94
+ readonly variants?: unknown;
95
+ readonly variantStrategy?: unknown;
96
+ }
97
+ export interface CampaignAnalytics {
98
+ readonly campaignId: string;
99
+ readonly recipientCount: number;
100
+ readonly sentCount: number;
101
+ readonly deliveredCount: number;
102
+ readonly readCount: number;
103
+ readonly failedCount: number;
104
+ readonly skippedCount: number;
105
+ readonly respondedCount: number;
106
+ readonly responseRate: number;
107
+ }
108
+ export interface CreateCampaignRequest {
109
+ readonly name: string;
110
+ readonly templateId?: string;
111
+ readonly recipientListId?: string;
112
+ readonly senderConfig?: Readonly<Record<string, unknown>>;
113
+ /** Epoch milliseconds. */
114
+ readonly scheduledAt?: number;
115
+ }
116
+ export interface LaunchCampaignRequest {
117
+ /** Epoch milliseconds. */
118
+ readonly scheduledAt?: number;
119
+ }
120
+ export interface RequeueCampaignRequest {
121
+ readonly includeSkippedError?: boolean;
122
+ }
123
+ export interface CampaignOperation extends Campaign {
124
+ /** Durable lifecycle operation that can be read through `operations.retrieve`. */
125
+ readonly operationId: string;
126
+ }
127
+ export interface CampaignRequeueResult {
128
+ readonly requeued: number;
129
+ }
130
+ export type ListCampaignsResponse = SuccessEnvelope<readonly Campaign[]>;
131
+ export type GetCampaignResponse = SuccessEnvelope<Campaign>;
132
+ export type CreateCampaignResponse = SuccessEnvelope<Campaign>;
133
+ export type CampaignAnalyticsResponse = SuccessEnvelope<CampaignAnalytics>;
134
+ export type CampaignOperationResponse = SuccessEnvelope<CampaignOperation>;
135
+ export type CampaignRequeueResponse = SuccessEnvelope<CampaignRequeueResult>;
136
+ export interface RejectCallRequest {
137
+ /** JID of the incoming caller. */
138
+ readonly from: string;
139
+ }
140
+ export interface RejectCallResult {
141
+ readonly status: "REJECTED";
142
+ }
143
+ /**
144
+ * OpenAPI declares SuccessResponse, while the live RPC returns a data envelope
145
+ * and also supports Prefer: respond-async for a request ID.
146
+ */
147
+ export type RejectCallResponse = SuccessResponse | SuccessEnvelope<RejectCallResult> | SuccessEnvelope<AsyncAcceptedData>;
148
+ export type ResolveIdentityParams = {
149
+ /** Phone number containing digits with an optional leading plus sign. */
150
+ readonly phoneNumber: string;
151
+ readonly id?: never;
152
+ readonly username?: never;
153
+ readonly usernameKey?: never;
154
+ } | {
155
+ /** Opaque Polymorfa user ID. */
156
+ readonly id: string;
157
+ readonly phoneNumber?: never;
158
+ readonly username?: never;
159
+ readonly usernameKey?: never;
160
+ } | {
161
+ /** WhatsApp username containing 3 through 35 characters. */
162
+ readonly username: string;
163
+ /** Optional four-digit key requested by WhatsApp for this username. */
164
+ readonly usernameKey?: string;
165
+ readonly phoneNumber?: never;
166
+ readonly id?: never;
167
+ };
168
+ export interface ResolveIdentityResult {
169
+ readonly id?: string;
170
+ readonly bsuid?: string;
171
+ readonly phoneNumber?: string;
172
+ readonly username?: string;
173
+ readonly keyRequired?: boolean;
174
+ }
175
+ export type ResolveIdentityResponse = SuccessEnvelope<ResolveIdentityResult>;
176
+ export interface UserSecurityCode {
177
+ /** Opaque Polymorfa user ID. */
178
+ readonly id: string;
179
+ readonly phoneNumber?: string;
180
+ readonly username?: string;
181
+ /** The 60-digit identity verification code. */
182
+ readonly numericCode: string;
183
+ /** Base64-encoded display QR; the private verification payload is excluded. */
184
+ readonly qrCode: string;
185
+ }
186
+ export type GetUserSecurityCodeResponse = SuccessEnvelope<UserSecurityCode>;
187
+ export interface Contact {
188
+ readonly bsuid?: string;
189
+ readonly phoneNumber?: string;
190
+ readonly name: string;
191
+ readonly pushName: string;
192
+ readonly businessName?: string;
193
+ readonly profileUrl?: string;
194
+ readonly id: string;
195
+ readonly username?: string;
196
+ }
197
+ export interface CheckContactResult {
198
+ readonly exists: boolean;
199
+ readonly bsuid?: string;
200
+ readonly phoneNumber?: string;
201
+ readonly id?: string;
202
+ readonly username?: string;
203
+ }
204
+ export interface ContactBlocklist {
205
+ readonly hash: string;
206
+ readonly contacts: readonly ConversationIdentity[];
207
+ }
208
+ export interface BusinessProfileCategory {
209
+ readonly id: string;
210
+ readonly name: string;
211
+ }
212
+ export interface BusinessProfileHours {
213
+ readonly dayOfWeek: string;
214
+ readonly mode: string;
215
+ readonly openTime: string;
216
+ readonly closeTime: string;
217
+ }
218
+ export interface BusinessProfile extends ConversationIdentity {
219
+ readonly address: string;
220
+ readonly email: string;
221
+ readonly description: string;
222
+ readonly websites: readonly string[];
223
+ readonly coverPhotoId: string;
224
+ readonly categories: readonly BusinessProfileCategory[];
225
+ readonly options: Readonly<Record<string, string>>;
226
+ readonly hoursTimeZone: string;
227
+ readonly hours: readonly BusinessProfileHours[];
228
+ }
229
+ export type BusinessProfileDay = {
230
+ readonly dayOfWeek: "sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat";
231
+ readonly mode: "specific_hours";
232
+ /** Minutes after midnight, from 0 through 1439. */
233
+ readonly openTime: number;
234
+ /** Minutes after midnight, from 0 through 1439 and distinct from openTime. */
235
+ readonly closeTime: number;
236
+ } | {
237
+ readonly dayOfWeek: "sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat";
238
+ readonly mode: "open_24h" | "appointment_only";
239
+ readonly openTime?: never;
240
+ readonly closeTime?: never;
241
+ };
242
+ export interface BusinessProfileHoursUpdate {
243
+ readonly timeZone: string;
244
+ readonly days: readonly BusinessProfileDay[];
245
+ }
246
+ export interface BusinessProfileUpdateRequest {
247
+ readonly address?: string;
248
+ readonly email?: string;
249
+ readonly description?: string;
250
+ readonly websites?: readonly string[];
251
+ readonly hours?: BusinessProfileHoursUpdate;
252
+ }
253
+ export type BusinessCoverPhotoRequest = {
254
+ readonly url: string;
255
+ readonly base64?: never;
256
+ } | {
257
+ readonly url?: never;
258
+ readonly base64: string;
259
+ };
260
+ export interface BusinessProfileStatus {
261
+ readonly status: string;
262
+ }
263
+ export interface BusinessCoverPhotoResult {
264
+ readonly coverPhotoId: string;
265
+ }
266
+ export interface BusinessActionSuccess {
267
+ readonly success: true;
268
+ }
269
+ export interface BusinessCatalogParams {
270
+ /** Polymorfa business user ID. */
271
+ readonly id: string;
272
+ /** Opaque cursor returned as `next` by the preceding page. */
273
+ readonly after?: string;
274
+ /** Product limit from 1 through 100. */
275
+ readonly limit?: number;
276
+ /** Requested image width from 1 through 1024. */
277
+ readonly width?: number;
278
+ /** Requested image height from 1 through 1024. */
279
+ readonly height?: number;
280
+ }
281
+ export interface BusinessProductParams {
282
+ /** Polymorfa business user ID. */
283
+ readonly id: string;
284
+ }
285
+ export interface BusinessCollectionsParams {
286
+ /** Polymorfa business user ID. */
287
+ readonly id: string;
288
+ /** Opaque cursor returned as `next` by the preceding page. */
289
+ readonly after?: string;
290
+ /** Collection limit from 1 through 20. */
291
+ readonly collectionLimit?: number;
292
+ /** Product limit per collection from 1 through 100. */
293
+ readonly itemLimit?: number;
294
+ /** Requested image width from 1 through 1024. */
295
+ readonly width?: number;
296
+ /** Requested image height from 1 through 1024. */
297
+ readonly height?: number;
298
+ }
299
+ export interface BusinessCollectionParams {
300
+ /** Polymorfa business user ID. */
301
+ readonly id: string;
302
+ /** Opaque product cursor returned by the upstream collection page. */
303
+ readonly after?: string;
304
+ /** Product limit from 1 through 100. */
305
+ readonly limit?: number;
306
+ /** Requested image width from 1 through 1024. */
307
+ readonly width?: number;
308
+ /** Requested image height from 1 through 1024. */
309
+ readonly height?: number;
310
+ }
311
+ export type BusinessProductImageSource = {
312
+ /** HTTPS source fetched through the API's bounded, SSRF-safe downloader. */
313
+ readonly url: string;
314
+ readonly base64?: never;
315
+ readonly mediaUrl?: never;
316
+ } | {
317
+ /** Base64 image data representing at most 16 MiB after decoding. */
318
+ readonly url?: never;
319
+ readonly base64: string;
320
+ readonly mediaUrl?: never;
321
+ } | {
322
+ readonly url?: never;
323
+ readonly base64?: never;
324
+ /** Existing HTTPS WhatsApp or Meta media URL reused without downloading. */
325
+ readonly mediaUrl: string;
326
+ };
327
+ export interface BusinessProductImporterAddress {
328
+ readonly street1?: string;
329
+ readonly street2?: string;
330
+ readonly city?: string;
331
+ readonly region?: string;
332
+ readonly postalCode?: string;
333
+ readonly countryCode?: string;
334
+ }
335
+ export interface BusinessProductCompliance {
336
+ readonly countryCodeOrigin?: string;
337
+ readonly importerName?: string;
338
+ readonly importerAddress?: BusinessProductImporterAddress;
339
+ }
340
+ export interface BusinessProductMutationRequest {
341
+ readonly name: string;
342
+ readonly description?: string;
343
+ readonly currency?: string;
344
+ /** Integer amount in thousandths, represented as a decimal string. */
345
+ readonly price?: string;
346
+ /** Integer amount in thousandths, represented as a decimal string. */
347
+ readonly salePrice?: string;
348
+ readonly url?: string;
349
+ readonly retailerId?: string;
350
+ /** Omitted is interpreted as false by the pinned runner during replacement. */
351
+ readonly hidden?: boolean;
352
+ readonly images: readonly BusinessProductImageSource[];
353
+ /** Existing HTTPS WhatsApp or Meta media URLs. */
354
+ readonly videoUrls?: readonly string[];
355
+ readonly complianceCategory?: string;
356
+ readonly compliance?: BusinessProductCompliance;
357
+ readonly width?: number;
358
+ readonly height?: number;
359
+ }
360
+ export interface BusinessAddress {
361
+ readonly street1?: string;
362
+ readonly street2?: string;
363
+ readonly city?: string;
364
+ readonly region?: string;
365
+ readonly postalCode?: string;
366
+ readonly countryCode?: string;
367
+ }
368
+ export interface BusinessComplianceInfo {
369
+ readonly countryCodeOrigin?: string;
370
+ readonly importerName?: string;
371
+ readonly importerAddress?: BusinessAddress;
372
+ }
373
+ export interface BusinessProductImage {
374
+ readonly id: string;
375
+ readonly originalUrl?: string;
376
+ readonly requestUrl?: string;
377
+ }
378
+ export interface BusinessProductVideo {
379
+ readonly id: string;
380
+ readonly originalUrl?: string;
381
+ readonly thumbnailUrl?: string;
382
+ }
383
+ export interface BusinessProductMedia {
384
+ readonly images: readonly BusinessProductImage[];
385
+ readonly videos: readonly BusinessProductVideo[];
386
+ }
387
+ export interface BusinessSalePrice {
388
+ readonly price: string;
389
+ readonly startDate?: string;
390
+ readonly endDate?: string;
391
+ }
392
+ export interface BusinessProductStatus {
393
+ readonly status?: string;
394
+ readonly canAppeal: boolean;
395
+ }
396
+ export interface BusinessDimensions {
397
+ readonly width?: number;
398
+ readonly height?: number;
399
+ }
400
+ export interface BusinessVariantThumbnail {
401
+ readonly id?: string;
402
+ readonly originalUrl?: string;
403
+ readonly requestUrl?: string;
404
+ readonly originalDimensions: BusinessDimensions;
405
+ }
406
+ export interface BusinessVariantProperty {
407
+ readonly name: string;
408
+ readonly value: string;
409
+ }
410
+ export interface BusinessVariantAvailabilityItem {
411
+ readonly productId?: string;
412
+ readonly available: boolean;
413
+ readonly options: readonly BusinessVariantProperty[];
414
+ }
415
+ export interface BusinessVariantAvailability {
416
+ readonly listings: readonly BusinessVariantAvailabilityItem[];
417
+ }
418
+ export interface BusinessVariantListing {
419
+ readonly description?: string;
420
+ readonly lowestPrice?: string;
421
+ readonly multiPrice?: string;
422
+ }
423
+ export interface BusinessVariantOption {
424
+ readonly value: string;
425
+ readonly thumbnail?: BusinessVariantThumbnail;
426
+ }
427
+ export interface BusinessVariantType {
428
+ readonly name: string;
429
+ readonly options: readonly BusinessVariantOption[];
430
+ }
431
+ export interface BusinessProductVariant {
432
+ readonly availability: BusinessVariantAvailability;
433
+ readonly listingDetails: BusinessVariantListing;
434
+ readonly types: readonly BusinessVariantType[];
435
+ readonly properties: readonly BusinessVariantProperty[];
436
+ }
437
+ export interface BusinessProduct {
438
+ readonly id: string;
439
+ readonly retailerId?: string;
440
+ readonly belongsTo?: string;
441
+ readonly name: string;
442
+ readonly description?: string;
443
+ readonly price: string;
444
+ readonly currency: string;
445
+ readonly url?: string;
446
+ readonly shimmedUrl?: string;
447
+ readonly hidden: boolean;
448
+ readonly sanctioned: boolean;
449
+ readonly maxAvailable?: number;
450
+ readonly availability?: string;
451
+ readonly complianceCategory?: string;
452
+ readonly compliance?: BusinessComplianceInfo;
453
+ readonly media: BusinessProductMedia;
454
+ readonly salePrice?: BusinessSalePrice;
455
+ readonly status: BusinessProductStatus;
456
+ readonly variant?: BusinessProductVariant;
457
+ }
458
+ export interface BusinessCatalogPage {
459
+ readonly next?: string;
460
+ readonly previous?: string;
461
+ readonly products: readonly BusinessProduct[];
462
+ }
463
+ export interface BusinessProductDeleteResult {
464
+ readonly deletedCount: number;
465
+ }
466
+ export interface BusinessCartSettingRequest {
467
+ readonly enabled: boolean;
468
+ }
469
+ export interface BusinessProductVisibilityRequest {
470
+ readonly hidden: boolean;
471
+ }
472
+ export interface BusinessCatalogAppealRequest {
473
+ readonly reason: string;
474
+ }
475
+ export interface BusinessCollectionStatus {
476
+ readonly status?: string;
477
+ readonly canAppeal: boolean;
478
+ readonly commerceUrl?: string;
479
+ readonly rejectReason?: string;
480
+ }
481
+ export interface BusinessCollection {
482
+ readonly id: string;
483
+ readonly name: string;
484
+ readonly products: readonly BusinessProduct[];
485
+ readonly status: BusinessCollectionStatus;
486
+ }
487
+ export interface BusinessCollectionPage {
488
+ readonly next?: string;
489
+ readonly collections: readonly BusinessCollection[];
490
+ }
491
+ export interface BusinessCollectionCreateRequest {
492
+ readonly name: string;
493
+ readonly productIds: readonly string[];
494
+ }
495
+ export interface BusinessCollectionUpdateRequest {
496
+ readonly name?: string;
497
+ readonly addProductIds?: readonly string[];
498
+ readonly removeProductIds?: readonly string[];
499
+ }
500
+ export interface BusinessCollectionMutationResult {
501
+ readonly id: string;
502
+ readonly reviewStatus: string;
503
+ }
504
+ export interface BusinessCollectionMove {
505
+ readonly collectionId: string;
506
+ readonly fromIndex: number;
507
+ readonly toIndex: number;
508
+ }
509
+ export interface BusinessCollectionReorderRequest {
510
+ readonly moves: readonly BusinessCollectionMove[];
511
+ }
512
+ export interface BusinessOrderLookupRequest {
513
+ readonly token: string;
514
+ }
515
+ export interface BusinessOrderPrice {
516
+ readonly subtotal: string;
517
+ readonly total: string;
518
+ readonly currency: string;
519
+ readonly priceStatus?: string;
520
+ }
521
+ export interface BusinessOrderProduct {
522
+ readonly id: string;
523
+ readonly imageId?: string;
524
+ readonly imageUrl?: string;
525
+ readonly price: string;
526
+ readonly currency: string;
527
+ readonly name: string;
528
+ readonly quantity: number;
529
+ readonly variantProperties?: string;
530
+ }
531
+ export interface BusinessOrder {
532
+ readonly id: string;
533
+ readonly createdAt: number;
534
+ readonly catalogId?: string;
535
+ readonly price: BusinessOrderPrice;
536
+ readonly products: readonly BusinessOrderProduct[];
537
+ }
538
+ export type BusinessMerchantEntityType = "SOLE_PROPRIETORSHIP" | "PARTNERSHIP" | "PRIVATE_COMPANY" | "PUBLIC_COMPANY" | "LIMITED_LIABILITY_PARTNERSHIP" | "OTHER";
539
+ export interface BusinessMerchantContact {
540
+ readonly email: string;
541
+ readonly landlineNumber: string;
542
+ readonly mobileNumber: string;
543
+ }
544
+ export interface BusinessMerchantOfficer extends BusinessMerchantContact {
545
+ readonly name: string;
546
+ }
547
+ export interface BusinessMerchantCompliance {
548
+ readonly entityName: string;
549
+ readonly entityType: BusinessMerchantEntityType;
550
+ readonly isRegistered: boolean;
551
+ readonly entityTypeCustom: string;
552
+ readonly customerCare: BusinessMerchantContact;
553
+ readonly grievanceOfficer: BusinessMerchantOfficer;
554
+ }
555
+ export interface BusinessAdStatus {
556
+ readonly hasActiveCTWAAd: boolean;
557
+ readonly hasCreatedAd: boolean;
558
+ }
559
+ export interface BusinessFacebookPage extends BusinessAdStatus {
560
+ readonly id: string;
561
+ readonly displayName: string;
562
+ readonly profileSync?: "disable" | "import";
563
+ readonly profilePictureUrl: string;
564
+ readonly showOnProfile: boolean;
565
+ readonly whatsAppAsPageButton: boolean;
566
+ }
567
+ export interface BusinessFacebookBusiness {
568
+ readonly id: string;
569
+ readonly displayName: string;
570
+ readonly catalogId?: string;
571
+ readonly catalogState?: "disable" | "import";
572
+ }
573
+ export interface BusinessInstagramProfessional {
574
+ readonly handle: string;
575
+ readonly displayName: string;
576
+ readonly profilePictureUrl: string;
577
+ readonly showOnProfile: boolean;
578
+ }
579
+ export interface BusinessWhatsAppAdIdentity extends BusinessAdStatus {
580
+ readonly id: string;
581
+ }
582
+ export interface BusinessLinkedAccounts {
583
+ readonly facebookPage?: BusinessFacebookPage;
584
+ readonly facebookBusiness?: BusinessFacebookBusiness;
585
+ readonly instagramProfessional?: BusinessInstagramProfessional;
586
+ readonly whatsAppAdIdentity?: BusinessWhatsAppAdIdentity;
587
+ }
588
+ export type BusinessFeature = "meta_verified" | "marketing_messages" | "genai" | "genai_image" | "meta_one" | "bb_pro";
589
+ export interface BusinessFeatureEligibility {
590
+ readonly feature: BusinessFeature;
591
+ readonly status: string;
592
+ readonly expiration?: number;
593
+ readonly additionalParams?: string;
594
+ readonly showPrivacyInterstitialToNewUsers?: boolean;
595
+ readonly v1Enabled?: boolean;
596
+ }
597
+ export interface BusinessEligibility {
598
+ readonly features: readonly BusinessFeatureEligibility[];
599
+ }
600
+ /** Non-GET RPC operations can return this accepted envelope when requested asynchronously. */
601
+ export type BusinessCommandResponse<T> = SuccessEnvelope<T> | SuccessEnvelope<AsyncAcceptedData>;
602
+ export type GetOwnBusinessProfileResponse = SuccessEnvelope<BusinessProfile>;
603
+ export type UpdateBusinessProfileResponse = BusinessCommandResponse<BusinessProfileStatus>;
604
+ export type SetBusinessCoverPhotoResponse = BusinessCommandResponse<BusinessCoverPhotoResult>;
605
+ export type DeleteBusinessCoverPhotoResponse = BusinessCommandResponse<BusinessProfileStatus>;
606
+ export type GetBusinessCatalogResponse = SuccessEnvelope<BusinessCatalogPage>;
607
+ export type CreateBusinessCatalogResponse = BusinessCommandResponse<BusinessActionSuccess>;
608
+ export type SetBusinessCartEnabledResponse = BusinessCommandResponse<BusinessActionSuccess>;
609
+ export type GetBusinessProductResponse = SuccessEnvelope<BusinessProduct>;
610
+ export type CreateBusinessProductResponse = BusinessCommandResponse<BusinessProduct>;
611
+ export type UpdateBusinessProductResponse = BusinessCommandResponse<BusinessProduct>;
612
+ export type DeleteBusinessProductResponse = BusinessCommandResponse<BusinessProductDeleteResult>;
613
+ export type SetBusinessProductVisibilityResponse = BusinessCommandResponse<BusinessActionSuccess>;
614
+ export type AppealBusinessProductResponse = BusinessCommandResponse<BusinessActionSuccess>;
615
+ export type GetBusinessCollectionsResponse = SuccessEnvelope<BusinessCollectionPage>;
616
+ export type GetBusinessCollectionResponse = SuccessEnvelope<BusinessCollection>;
617
+ export type CreateBusinessCollectionResponse = BusinessCommandResponse<BusinessCollectionMutationResult>;
618
+ export type UpdateBusinessCollectionResponse = BusinessCommandResponse<BusinessCollectionMutationResult>;
619
+ export type DeleteBusinessCollectionResponse = BusinessCommandResponse<BusinessActionSuccess>;
620
+ export type ReorderBusinessCollectionsResponse = BusinessCommandResponse<BusinessActionSuccess>;
621
+ export type AppealBusinessCollectionResponse = BusinessCommandResponse<BusinessActionSuccess>;
622
+ export type GetBusinessOrderResponse = BusinessCommandResponse<BusinessOrder>;
623
+ export type GetBusinessMerchantComplianceResponse = SuccessEnvelope<BusinessMerchantCompliance>;
624
+ export type SetBusinessMerchantComplianceResponse = BusinessCommandResponse<BusinessMerchantCompliance>;
625
+ export type GetBusinessLinkedAccountsResponse = SuccessEnvelope<BusinessLinkedAccounts>;
626
+ export type GetBusinessEligibilityResponse = SuccessEnvelope<BusinessEligibility>;
627
+ export interface ContactUserInfo {
628
+ readonly bsuid?: string;
629
+ readonly status: string;
630
+ readonly pictureId: string;
631
+ readonly verifiedName: string;
632
+ readonly devices: readonly (ConversationIdentity & {
633
+ readonly device: number;
634
+ })[];
635
+ readonly id: string;
636
+ readonly phoneNumber?: string;
637
+ readonly username?: string;
638
+ }
639
+ export interface ContactProfilePicture {
640
+ readonly url: string;
641
+ }
642
+ export interface ProfileData {
643
+ readonly name: string;
644
+ readonly status: string;
645
+ readonly profilePicUrl?: string;
646
+ readonly phonePlatform?: PhonePlatform;
647
+ readonly accountType?: WhatsAppAccountType;
648
+ }
649
+ export interface SetProfileNameRequest {
650
+ readonly name: string;
651
+ }
652
+ export interface SetProfileStatusRequest {
653
+ readonly status: string;
654
+ }
655
+ /** JSON picture source accepted by the public API contract. */
656
+ export interface SetProfilePictureRequest {
657
+ readonly url?: string;
658
+ readonly base64?: string;
659
+ }
660
+ export type GetProfileResponse = SuccessEnvelope<ProfileData>;
661
+ export type SetProfileNameResponse = SuccessResponse;
662
+ export type SetProfileStatusResponse = SuccessResponse;
663
+ export type SetProfilePictureResponse = SuccessResponse;
664
+ export type DeleteProfilePictureResponse = SuccessResponse;
665
+ export declare const PRIVACY_SETTING_VALUES: {
666
+ readonly groupadd: readonly ["all", "contacts", "contact_blacklist", "none"];
667
+ readonly last: readonly ["all", "contacts", "contact_blacklist", "none"];
668
+ readonly status: readonly ["all", "contacts", "contact_blacklist", "none"];
669
+ readonly profile: readonly ["all", "contacts", "contact_blacklist", "none"];
670
+ readonly readreceipts: readonly ["all", "none"];
671
+ readonly online: readonly ["all", "match_last_seen"];
672
+ readonly calladd: readonly ["all", "known"];
673
+ readonly messages: readonly ["all", "contacts"];
674
+ readonly defense: readonly ["on_standard", "off"];
675
+ readonly stickers: readonly ["contacts", "contact_allowlist", "none"];
676
+ };
677
+ export type StandardPrivacyAudience = (typeof PRIVACY_SETTING_VALUES)["groupadd"][number];
678
+ export interface PrivacySettings {
679
+ readonly groupAdd: StandardPrivacyAudience;
680
+ readonly lastSeen: StandardPrivacyAudience;
681
+ readonly status: StandardPrivacyAudience;
682
+ readonly profile: StandardPrivacyAudience;
683
+ readonly readReceipts: "all" | "none";
684
+ readonly online: "all" | "match_last_seen";
685
+ readonly callAdd: "all" | "known";
686
+ readonly messages: "all" | "contacts";
687
+ readonly defense: "on_standard" | "off";
688
+ readonly stickers: "contacts" | "contact_allowlist" | "none";
689
+ }
690
+ export type PrivacySettingValueMap = {
691
+ readonly [Setting in keyof typeof PRIVACY_SETTING_VALUES]: (typeof PRIVACY_SETTING_VALUES)[Setting][number];
692
+ };
693
+ export type PrivacySettingName = keyof PrivacySettingValueMap;
694
+ export type PrivacySettingMutation = {
695
+ [Setting in PrivacySettingName]: {
696
+ readonly setting: Setting;
697
+ readonly value: PrivacySettingValueMap[Setting];
698
+ };
699
+ }[PrivacySettingName];
700
+ export type PrivacySettingValue = PrivacySettingMutation["value"];
701
+ export type DefaultDisappearingTimerRequest = DisappearingTimerRequest;
702
+ export type GetPrivacySettingsResponse = SuccessEnvelope<PrivacySettings>;
703
+ export type SetPrivacySettingResponse = SuccessEnvelope<PrivacySettings>;
704
+ export type SetDefaultDisappearingTimerResponse = SuccessResponse;
705
+ export type ListContactsResponse = SuccessEnvelope<readonly Contact[]>;
706
+ export type CheckContactsResponse = SuccessEnvelope<readonly CheckContactResult[]>;
707
+ export type GetContactResponse = SuccessEnvelope<Contact>;
708
+ export type GetContactPictureResponse = SuccessEnvelope<ContactProfilePicture>;
709
+ export type GetBlocklistResponse = SuccessEnvelope<ContactBlocklist>;
710
+ export type GetUserInfoResponse = SuccessEnvelope<ContactUserInfo>;
711
+ export type GetUserDevicesResponse = SuccessEnvelope<readonly string[]>;
712
+ export type GetBusinessProfileResponse = SuccessEnvelope<BusinessProfile>;
713
+ export interface MessagingMediaInfo {
714
+ readonly id: string;
715
+ readonly session: string;
716
+ readonly messageId: string;
717
+ readonly mimeType: string;
718
+ readonly fileLength: number;
719
+ readonly persisted: boolean;
720
+ readonly s3Url?: string | null;
721
+ }
722
+ export type GetMessagingMediaInfoResponse = SuccessEnvelope<MessagingMediaInfo>;
723
+ export type ObservationMode = "off" | "events" | "cache";
724
+ export type LabelObservationMode = ObservationMode | "project";
725
+ export type SessionObservationMode = ObservationMode | "inherit";
726
+ export type SessionLabelObservationMode = LabelObservationMode | "inherit";
727
+ export declare const PRESENCE_STATES: readonly ["available", "unavailable"];
728
+ export declare const PRESENCE_OBSERVATION_STATUSES: readonly ["unknown", "fresh", "stale"];
729
+ export declare const PRESENCE_UNKNOWN_REASONS: readonly ["disabled", "not_observed", "suspended"];
730
+ export declare const PRESENCE_CHAT_STATES: readonly ["composing", "paused"];
731
+ export type PresenceState = (typeof PRESENCE_STATES)[number];
732
+ export type PresenceObservationStatus = (typeof PRESENCE_OBSERVATION_STATUSES)[number];
733
+ export type PresenceUnknownReason = (typeof PRESENCE_UNKNOWN_REASONS)[number];
734
+ export type PresenceChatStateValue = (typeof PRESENCE_CHAT_STATES)[number];
735
+ export interface SetPresenceRequest {
736
+ readonly presence: PresenceState;
737
+ }
738
+ /**
739
+ * The runner's remembered intent and last successful send, not authoritative
740
+ * remote account state.
741
+ */
742
+ export interface PresenceData {
743
+ readonly desired?: PresenceState;
744
+ readonly desiredAt?: string;
745
+ readonly lastSent?: PresenceState;
746
+ readonly lastSentAt?: string;
747
+ readonly authoritative: false;
748
+ }
749
+ export interface PresenceChatState {
750
+ readonly sender: string;
751
+ readonly state: PresenceChatStateValue;
752
+ readonly media?: string;
753
+ readonly observedAt: string;
754
+ readonly stale: boolean;
755
+ }
756
+ /** Policy-governed retained observation state; this is not a live query. */
757
+ export interface ChatPresenceData {
758
+ readonly policy: ObservationMode;
759
+ readonly status: PresenceObservationStatus;
760
+ readonly unknownReason?: PresenceUnknownReason;
761
+ readonly available?: boolean;
762
+ readonly lastSeen?: string;
763
+ readonly observedAt?: string;
764
+ readonly subscriptionExpiresAt?: string;
765
+ readonly stale: boolean;
766
+ readonly typingPolicy: ObservationMode;
767
+ readonly typingStatus: PresenceObservationStatus;
768
+ readonly typingUnknownReason?: PresenceUnknownReason;
769
+ readonly chatState?: PresenceChatState;
770
+ }
771
+ export interface PresenceSubscriptionData {
772
+ readonly status: "SUBSCRIBED";
773
+ readonly expiresAt: string;
774
+ }
775
+ export interface PresenceSetResult {
776
+ readonly status: "OK";
777
+ }
778
+ export interface AsyncAcceptedData {
779
+ readonly requestId: string;
780
+ }
781
+ export type GetPresenceResponse = SuccessEnvelope<PresenceData>;
782
+ export type GetChatPresenceResponse = SuccessEnvelope<ChatPresenceData>;
783
+ /**
784
+ * The pinned OpenAPI declares SuccessResponse; the pinned live RPC handler
785
+ * returns a data envelope. Both are represented until the source converges.
786
+ */
787
+ export type SetPresenceResponse = SuccessResponse | SuccessEnvelope<PresenceSetResult> | SuccessEnvelope<AsyncAcceptedData>;
788
+ export type SubscribePresenceResponse = SuccessEnvelope<PresenceSubscriptionData> | SuccessEnvelope<AsyncAcceptedData>;
789
+ /** Public channel/newsletter metadata. Fields are optional in the pinned contract. */
790
+ export interface Channel {
791
+ readonly id?: string;
792
+ readonly name?: string;
793
+ readonly description?: string;
794
+ readonly profileUrl?: string;
795
+ readonly followers?: number;
796
+ readonly muted?: boolean;
797
+ readonly preview?: boolean;
798
+ }
799
+ export interface CreateChannelRequest {
800
+ readonly name: string;
801
+ readonly description?: string;
802
+ /** Public contract field; the pinned runner does not presently apply it. */
803
+ readonly picture?: string;
804
+ }
805
+ export interface ChannelMessage {
806
+ /** Ordering position for before/after pagination, not a message ID. */
807
+ readonly position: number;
808
+ readonly id: string;
809
+ readonly whatsapp_id: string;
810
+ readonly conversation: ConversationIdentity;
811
+ readonly type: string;
812
+ readonly timestamp: string;
813
+ readonly views: number;
814
+ readonly reactionCounts: Readonly<Record<string, number>>;
815
+ readonly text?: string;
816
+ }
817
+ export interface ChannelMessagesParams {
818
+ /** Number of messages to return. The API accepts 1 through 100 and defaults to 50. */
819
+ readonly count?: number;
820
+ /** Positive message server ID used as the exclusive older-history cursor. */
821
+ readonly before?: number;
822
+ }
823
+ export interface ChannelMessageUpdatesParams {
824
+ /** Number of updates to return. The API accepts 1 through 100 and defaults to 50. */
825
+ readonly count?: number;
826
+ /** Non-negative Unix timestamp in seconds. Zero is treated as unset by the runner. */
827
+ readonly since?: number;
828
+ /** Positive message server ID used as the update cursor. */
829
+ readonly after?: number;
830
+ }
831
+ export interface ChannelReactionRequest {
832
+ /** Reaction text, limited to 32 characters by the public contract. Empty removes a reaction. */
833
+ readonly reaction: string;
834
+ }
835
+ export interface ChannelLiveUpdates {
836
+ readonly durationSeconds: number;
837
+ }
838
+ export interface DeletedChannel {
839
+ readonly status: "DELETED";
840
+ }
841
+ export type ChannelActionStatus = "FOLLOWED" | "UNFOLLOWED" | "MUTED" | "UNMUTED" | "VIEWED" | "UPDATED";
842
+ export interface ChannelActionResult<Status extends ChannelActionStatus = ChannelActionStatus> {
843
+ readonly status: Status;
844
+ }
845
+ export type ListChannelsResponse = SuccessEnvelope<readonly Channel[]>;
846
+ export type CreateChannelResponse = SuccessEnvelope<Channel> | SuccessEnvelope<AsyncAcceptedData>;
847
+ export type GetChannelResponse = SuccessEnvelope<Channel>;
848
+ export type DeleteChannelResponse = SuccessEnvelope<DeletedChannel> | SuccessEnvelope<AsyncAcceptedData>;
849
+ export type ListChannelMessagesResponse = SuccessEnvelope<readonly ChannelMessage[]>;
850
+ export type ListChannelMessageUpdatesResponse = ListChannelMessagesResponse;
851
+ export type ChannelLiveUpdatesResponse = SuccessEnvelope<ChannelLiveUpdates> | SuccessEnvelope<AsyncAcceptedData>;
852
+ export type ChannelActionResponse<Status extends ChannelActionStatus> = SuccessResponse | SuccessEnvelope<ChannelActionResult<Status>> | SuccessEnvelope<AsyncAcceptedData>;
853
+ export type MarkChannelMessageViewedResponse = ChannelActionResponse<"VIEWED">;
854
+ export type ReactToChannelMessageResponse = ChannelActionResponse<"UPDATED">;
855
+ export type FollowChannelResponse = ChannelActionResponse<"FOLLOWED">;
856
+ export type UnfollowChannelResponse = ChannelActionResponse<"UNFOLLOWED">;
857
+ export type MuteChannelResponse = ChannelActionResponse<"MUTED">;
858
+ export type UnmuteChannelResponse = ChannelActionResponse<"UNMUTED">;
859
+ export interface Label {
860
+ readonly id: string;
861
+ readonly name: string;
862
+ readonly color: number;
863
+ readonly orderIndex?: number;
864
+ readonly chatCount?: number;
865
+ readonly observedAt?: string;
866
+ }
867
+ export type LabelObservationStatus = "disabled" | "unknown" | "partial" | "fresh";
868
+ export type LabelUnknownReason = "observation_disabled" | "not_retained" | "not_observed" | "expired";
869
+ export interface LabelCollection {
870
+ readonly policy: LabelObservationMode;
871
+ readonly status: LabelObservationStatus;
872
+ readonly unknownReason?: LabelUnknownReason;
873
+ readonly observedAt?: string;
874
+ readonly expiresAt?: string;
875
+ readonly labels: readonly Label[];
876
+ }
877
+ export type LabelReadData = readonly Label[] | LabelCollection;
878
+ export interface ListLabelsParams {
879
+ readonly includeObservation?: boolean;
880
+ }
881
+ export interface CreateLabelRequest {
882
+ readonly name: string;
883
+ readonly color?: number;
884
+ }
885
+ export type UpdateLabelRequest = {
886
+ readonly name: string;
887
+ readonly color?: number;
888
+ } | {
889
+ readonly name?: string;
890
+ readonly color: number;
891
+ };
892
+ export interface ReplaceChatLabelsRequest {
893
+ readonly labels: readonly string[];
894
+ }
895
+ export type ListLabelsResponse = SuccessEnvelope<LabelReadData>;
896
+ export type GetChatLabelsResponse = SuccessEnvelope<LabelReadData>;
897
+ export type CreateLabelResponse = SuccessEnvelope<Label>;
898
+ export interface ProjectObservationPolicy {
899
+ readonly projectId: string;
900
+ readonly presenceMode: ObservationMode;
901
+ readonly typingMode: ObservationMode;
902
+ readonly labelMode: LabelObservationMode;
903
+ readonly quickReplyMode?: ObservationMode;
904
+ }
905
+ export interface SessionObservationPolicyValues {
906
+ readonly presenceMode: ObservationMode;
907
+ readonly typingMode: ObservationMode;
908
+ readonly labelMode: LabelObservationMode;
909
+ readonly quickReplyMode?: ObservationMode;
910
+ }
911
+ export interface SessionObservationPolicyOverrides {
912
+ readonly presenceMode: SessionObservationMode;
913
+ readonly typingMode: SessionObservationMode;
914
+ readonly labelMode: SessionLabelObservationMode;
915
+ readonly quickReplyMode?: SessionObservationMode;
916
+ }
917
+ export interface SessionObservationPolicy {
918
+ readonly sessionName: string;
919
+ readonly projectId: string;
920
+ readonly project: SessionObservationPolicyValues;
921
+ readonly override: SessionObservationPolicyOverrides;
922
+ readonly effective: SessionObservationPolicyValues;
923
+ }
924
+ export interface UpdateProjectObservationPolicyRequest {
925
+ readonly presenceMode: ObservationMode;
926
+ readonly typingMode: ObservationMode;
927
+ readonly labelMode?: LabelObservationMode;
928
+ }
929
+ export interface UpdateSessionObservationPolicyRequest {
930
+ readonly presenceMode: SessionObservationMode;
931
+ readonly typingMode: SessionObservationMode;
932
+ readonly labelMode?: SessionLabelObservationMode;
933
+ }
934
+ export type GetProjectObservationPolicyResponse = SuccessEnvelope<ProjectObservationPolicy>;
935
+ export type UpdateProjectObservationPolicyResponse = SuccessEnvelope<ProjectObservationPolicy>;
936
+ export type GetSessionObservationPolicyResponse = SuccessEnvelope<SessionObservationPolicy>;
937
+ export type UpdateSessionObservationPolicyResponse = SuccessEnvelope<SessionObservationPolicy>;
938
+ export interface BusinessQuickReplyMutation {
939
+ readonly shortcut: string;
940
+ readonly message: string;
941
+ readonly keywords?: readonly string[];
942
+ readonly count?: number;
943
+ }
944
+ export interface BusinessQuickReply extends BusinessQuickReplyMutation {
945
+ readonly id: string;
946
+ }
947
+ export interface BusinessQuickReplyObserved extends BusinessQuickReply {
948
+ readonly associatedLabelIds: readonly string[];
949
+ readonly observedAt: string;
950
+ }
951
+ export type QuickReplyObservationStatus = "disabled" | "unknown" | "partial" | "fresh";
952
+ export type QuickReplyUnknownReason = "observation_disabled" | "not_retained" | "not_observed";
953
+ export interface BusinessQuickReplyCollection {
954
+ readonly policy: ObservationMode;
955
+ readonly status: QuickReplyObservationStatus;
956
+ readonly unknownReason?: QuickReplyUnknownReason;
957
+ readonly observedAt?: string;
958
+ readonly quickReplies: readonly BusinessQuickReplyObserved[];
959
+ }
960
+ export interface DeletedBusinessQuickReply {
961
+ readonly id: string;
962
+ readonly status: "DELETED";
963
+ }
964
+ export type CreateBusinessQuickReplyResponse = SuccessEnvelope<BusinessQuickReply>;
965
+ export type SetBusinessQuickReplyResponse = SuccessEnvelope<BusinessQuickReply>;
966
+ export type ReplaceBusinessQuickReplyResponse = SetBusinessQuickReplyResponse;
967
+ export type DeleteBusinessQuickReplyResponse = SuccessEnvelope<DeletedBusinessQuickReply>;
968
+ export type ListBusinessQuickRepliesResponse = SuccessEnvelope<BusinessQuickReplyCollection>;
969
+ export interface GroupParticipant {
970
+ readonly bsuid?: string;
971
+ readonly phoneNumber?: string;
972
+ readonly isAdmin: boolean;
973
+ readonly isSuperAdmin: boolean;
974
+ readonly id: string;
975
+ readonly username?: string;
976
+ }
977
+ export interface Group {
978
+ readonly id: string;
979
+ readonly name: string;
980
+ readonly description: string;
981
+ readonly createdAt: number;
982
+ readonly participants: readonly GroupParticipant[];
983
+ readonly ownerId: string;
984
+ }
985
+ export interface GroupInviteInfo {
986
+ readonly id: string;
987
+ readonly subject: string;
988
+ readonly createdAt: number;
989
+ readonly size: number;
990
+ readonly participants: readonly GroupParticipant[];
991
+ readonly creatorId: string;
992
+ }
993
+ export interface GroupInviteCode {
994
+ readonly code: string;
995
+ }
996
+ export interface CreateGroupRequest {
997
+ readonly name: string;
998
+ readonly participants: readonly string[];
999
+ }
1000
+ export interface SetGroupFieldRequest {
1001
+ readonly value: string;
1002
+ }
1003
+ export interface GroupParticipantsRequest {
1004
+ readonly participants: readonly string[];
1005
+ }
1006
+ export interface SetGroupPictureRequest {
1007
+ readonly url?: string;
1008
+ readonly base64?: string;
1009
+ }
1010
+ export interface JoinGroupRequest {
1011
+ readonly code: string;
1012
+ }
1013
+ export interface GroupAdminOnlySettingRequest {
1014
+ readonly adminsOnly: boolean;
1015
+ }
1016
+ export type GroupMemberAddMode = "admin_add" | "all_member_add";
1017
+ export interface GroupMemberAddModeRequest {
1018
+ readonly mode: GroupMemberAddMode;
1019
+ }
1020
+ export interface GroupJoinApprovalRequest {
1021
+ readonly required: boolean;
1022
+ }
1023
+ export type ListGroupsResponse = SuccessEnvelope<readonly Group[]>;
1024
+ export type CreateGroupResponse = SuccessEnvelope<Group>;
1025
+ export type GetGroupResponse = SuccessEnvelope<Group>;
1026
+ export type GetGroupJoinInfoResponse = SuccessEnvelope<GroupInviteInfo>;
1027
+ export type GetGroupInviteCodeResponse = SuccessEnvelope<GroupInviteCode>;
1028
+ export type RevokeGroupInviteCodeResponse = SuccessEnvelope<GroupInviteCode>;
1029
+ export type GetGroupParticipantsResponse = SuccessEnvelope<readonly GroupParticipant[]>;
1030
+ export interface EditMessageRequest {
1031
+ readonly text: string;
1032
+ }
1033
+ export type DisappearingTimerDuration = 0 | 86400 | 604800 | 7776000;
1034
+ export interface DisappearingTimerRequest {
1035
+ readonly durationSeconds: DisappearingTimerDuration;
1036
+ }
1037
+ export interface QRCodeData {
1038
+ readonly qr?: string;
1039
+ readonly event?: string;
1040
+ }
1041
+ export interface PairCodeRequest {
1042
+ readonly phone: string;
1043
+ }
1044
+ export interface PairCodeData {
1045
+ readonly code: string;
1046
+ }
1047
+ export type GetQRCodeResponse = SuccessEnvelope<QRCodeData>;
1048
+ export type RequestPairCodeResponse = SuccessEnvelope<PairCodeData>;
1049
+ export type OperationStatus = "pending" | "running" | "action_required" | "succeeded" | "failed" | "cancelled";
1050
+ export interface Operation {
1051
+ readonly id: string;
1052
+ readonly kind: string;
1053
+ readonly resourceType: string;
1054
+ readonly resourceId: string;
1055
+ readonly projectId: string | null;
1056
+ readonly status: OperationStatus;
1057
+ readonly progressCode: string | null;
1058
+ readonly failureCode: string | null;
1059
+ readonly createdAt: string;
1060
+ readonly updatedAt: string;
1061
+ readonly completedAt: string | null;
1062
+ }
1063
+ export type GetOperationResponse = SuccessEnvelope<Operation>;
1064
+ /** Actions a Customer-scoped client token can carry in `allow`. */
1065
+ export type CustomerClientTokenAction = "send_message" | "send_reaction" | "send_typing" | "send_seen" | "read_presence" | "subscribe_presence" | "read_contact";
1066
+ interface MintClientTokenBase {
1067
+ readonly ephemeralId: string;
1068
+ readonly ttlSeconds?: number;
1069
+ }
1070
+ /** A token limited to one session. */
1071
+ export interface MintSessionClientTokenRequest extends MintClientTokenBase {
1072
+ readonly session: string;
1073
+ readonly customer?: never;
1074
+ readonly allow?: never;
1075
+ }
1076
+ /**
1077
+ * A token covering the numbers one Customer owns when it is minted (beta).
1078
+ * Each request also requires that the Customer still owns the number and
1079
+ * passes that session's client rules. Requires `customers:read`.
1080
+ */
1081
+ export interface MintCustomerClientTokenRequest extends MintClientTokenBase {
1082
+ /** Polymorfa Customer ID. Never pass your own external ID. */
1083
+ readonly customer: string;
1084
+ /** Narrows the token's actions further; omit to use session rules alone. */
1085
+ readonly allow?: readonly CustomerClientTokenAction[];
1086
+ readonly session?: never;
1087
+ }
1088
+ export type MintClientTokenRequest = MintSessionClientTokenRequest | MintCustomerClientTokenRequest;
1089
+ export interface ClientTokenValue {
1090
+ readonly token: string;
1091
+ readonly expiresAt: string;
1092
+ }
1093
+ export type MintClientTokenResponse = SuccessEnvelope<ClientTokenValue>;
1094
+ /** Who a client token may message: chats the peer started, anyone, or nobody. */
1095
+ export type ClientRecipientMode = "conversation" | "any" | "none";
1096
+ /**
1097
+ * Client-token actions (comma-separated in `allowedActions`). The `voip_*`
1098
+ * actions gate the Calls routes for client tokens: `voip_place` places calls
1099
+ * and adds participants, `voip_answer` accepts or declines, and `voip_signal`
1100
+ * covers ICE candidates, renegotiation, ending a call, and the lifecycle socket.
1101
+ */
1102
+ export type ClientAction = "mcp" | "send_message" | "send_reaction" | "send_typing" | "send_seen" | "read_presence" | "subscribe_presence" | "read_contact" | "widget_start" | "widget_pair" | "widget_status" | "widget_embedded_signup" | "widget_handoff" | "voip_place" | "voip_answer" | "voip_signal";
1103
+ /** Rules as returned by `GET /platform/sessions/{session}/client-rules`. */
1104
+ export interface ClientRules {
1105
+ /**
1106
+ * Who client tokens may send to. Rules saved before `verified` was retired
1107
+ * may still return `verified`; it cannot be set.
1108
+ */
1109
+ readonly recipientMode: ClientRecipientMode | "verified";
1110
+ /** Comma-separated {@link ClientAction} list. */
1111
+ readonly allowedActions: string;
1112
+ /** Requests per minute per ephemeral id (0 = unlimited). */
1113
+ readonly rateLimit: number;
1114
+ /** Sends per day per ephemeral id (0 = unlimited). */
1115
+ readonly maxDaily: number;
1116
+ /** Comma-separated browser origins allowed to use the token. */
1117
+ readonly allowedOrigins: string;
1118
+ /**
1119
+ * Seconds a sender stays replyable in `conversation` mode after their latest
1120
+ * inbound message (300 to 604800).
1121
+ */
1122
+ readonly conversationTtlSeconds: number;
1123
+ /** Calls: max distinct in-flight calls per token (0 = unlimited). */
1124
+ readonly maxConcurrency: number;
1125
+ /** Polymorfa Calls: call setups per minute per ephemeral id (0 = platform default of 10). */
1126
+ readonly maxSetupsPerMinute: number;
1127
+ /** Calls: comma-separated E.164 destination allowlist (empty = any). */
1128
+ readonly allowedNumber: string;
1129
+ readonly enabled: boolean;
1130
+ }
1131
+ export type GetClientRulesResponse = SuccessEnvelope<ClientRules>;
1132
+ export interface SetClientRulesRequest {
1133
+ readonly recipientMode: ClientRecipientMode;
1134
+ /** Comma-separated {@link ClientAction} list. */
1135
+ readonly allowedActions?: string;
1136
+ /** Requests per minute per ephemeral id; 0 or more (0 = unlimited). */
1137
+ readonly rateLimit?: number;
1138
+ /** Sends per day per ephemeral id; 0 or more (0 = unlimited). */
1139
+ readonly maxDaily?: number;
1140
+ readonly allowedOrigins?: string;
1141
+ readonly enabled: boolean;
1142
+ /**
1143
+ * Seconds a sender stays replyable in `conversation` mode after their latest
1144
+ * inbound message: 300 (5 minutes) to 604800 (7 days). The API default is
1145
+ * 86400 (24 hours).
1146
+ */
1147
+ readonly conversationTtlSeconds?: number;
1148
+ /** Calls: max distinct in-flight calls per token (0 = unlimited). */
1149
+ readonly maxConcurrency?: number;
1150
+ /** Polymorfa Calls: call setups per minute per ephemeral id (0 = platform default). */
1151
+ readonly maxSetupsPerMinute?: number;
1152
+ /** Calls: comma-separated E.164 destination allowlist (empty = any). */
1153
+ readonly allowedNumber?: string;
1154
+ }
1155
+ /**
1156
+ * Who acts in a call when a server credential calls a Calls route. Matches
1157
+ * `[A-Za-z0-9._:@-]{1,128}`; the API uses `default` when omitted. Client
1158
+ * tokens act as their own participant and cannot set this field.
1159
+ */
1160
+ export type VoipParticipantReference = string;
1161
+ /** Body for `POST /messaging/voip/calls`. */
1162
+ export interface VoipPlaceCallRequest {
1163
+ /** Phone number in E.164 form or a WhatsApp user ID. */
1164
+ readonly to: string;
1165
+ /** Session that places the call. Required with a server credential. */
1166
+ readonly session?: string;
1167
+ readonly video?: boolean;
1168
+ /** Claim the call for the placing participant. */
1169
+ readonly exclusive?: boolean;
1170
+ readonly participant?: VoipParticipantReference;
1171
+ }
1172
+ export interface VoipPlaceCallResult {
1173
+ readonly callId: string;
1174
+ readonly session: string;
1175
+ readonly video: boolean;
1176
+ }
1177
+ export type VoipPlaceCallResponse = SuccessEnvelope<VoipPlaceCallResult>;
1178
+ /** Body for `POST /messaging/voip/calls/{callId}/accept`. */
1179
+ export interface VoipAcceptCallRequest {
1180
+ /**
1181
+ * Claim the call. Other participants then receive `409 call_claimed` and
1182
+ * their connections close. Without a claim, later accepts join the call.
1183
+ */
1184
+ readonly exclusive?: boolean;
1185
+ readonly video?: boolean;
1186
+ readonly participant?: VoipParticipantReference;
1187
+ }
1188
+ export interface VoipAcceptCallResult {
1189
+ /** `true` once the call is answered, including when this accept joined it. */
1190
+ readonly answered: boolean;
1191
+ /** Participant reference that answered the call. */
1192
+ readonly answeredBy: string;
1193
+ /** Whether a participant holds an exclusive claim on the call. */
1194
+ readonly exclusive: boolean;
1195
+ }
1196
+ export type VoipAcceptCallResponse = SuccessEnvelope<VoipAcceptCallResult>;
1197
+ /** Body for `POST /messaging/voip/calls/{callId}/leave`. */
1198
+ export interface VoipLeaveCallRequest {
1199
+ /** Media connection to close. Matches `[A-Za-z0-9_-]{8,64}`. */
1200
+ readonly connectionId: string;
1201
+ /** Server credentials only: the participant that owns the connection. */
1202
+ readonly participant?: VoipParticipantReference;
1203
+ }
1204
+ /** SDK that sent a call report. */
1205
+ export interface VoipCallReportClient {
1206
+ /** Package name. Matches `[a-z0-9@/._-]{1,32}`. */
1207
+ readonly sdk: string;
1208
+ /** `MAJOR.MINOR.PATCH` with an optional `-` or `+` suffix, at most 32 characters. */
1209
+ readonly version: string;
1210
+ readonly platform: "browser" | "node" | "other";
1211
+ }
1212
+ /**
1213
+ * Figures an app measured for one connection. Omit what you did not
1214
+ * measure; send at least one.
1215
+ */
1216
+ export interface VoipCallQuality {
1217
+ /** Round-trip time in milliseconds, 0–60000. */
1218
+ readonly rttMs?: number;
1219
+ /** Receive jitter in milliseconds, 0–60000. */
1220
+ readonly jitterMs?: number;
1221
+ /** Packets lost since the connection started. */
1222
+ readonly packetsLost?: number;
1223
+ /** Packets received since the connection started. */
1224
+ readonly packetsReceived?: number;
1225
+ /** Negotiated audio codec, for example `audio/opus`. */
1226
+ readonly audioCodec?: string;
1227
+ readonly videoCodec?: string;
1228
+ /** Local ICE candidate type in use; `relay` means a TURN relay. */
1229
+ readonly candidateType?: "host" | "srflx" | "prflx" | "relay";
1230
+ /** Times this connection reconnected so far, 0–1000. */
1231
+ readonly reconnects?: number;
1232
+ }
1233
+ export type VoipCallErrorCode = "media_permission_denied" | "device_not_found" | "device_in_use" | "ice_failed" | "negotiation_failed" | "media_timeout" | "reconnect_exhausted" | "token_refresh_failed" | "unsupported_browser" | "other";
1234
+ interface VoipCallReportBase {
1235
+ /** The connection the report is about. Matches `[A-Za-z0-9_-]{8,64}`. */
1236
+ readonly connectionId: string;
1237
+ /** Server credentials only: the participant that owns the connection. */
1238
+ readonly participant?: VoipParticipantReference;
1239
+ readonly client?: VoipCallReportClient;
1240
+ }
1241
+ export interface VoipCallQualityReport extends VoipCallReportBase {
1242
+ readonly kind: "quality";
1243
+ readonly quality: VoipCallQuality;
1244
+ }
1245
+ export interface VoipCallErrorReport extends VoipCallReportBase {
1246
+ readonly kind: "error";
1247
+ readonly error: {
1248
+ readonly code: VoipCallErrorCode;
1249
+ };
1250
+ }
1251
+ /** Body for `POST /messaging/voip/calls/{callId}/reports`. */
1252
+ export type VoipCallReportRequest = VoipCallQualityReport | VoipCallErrorReport;
1253
+ /** Body for `POST /messaging/voip/calls/{callId}/reject`. */
1254
+ export interface VoipRejectCallRequest {
1255
+ /** Server credentials only: the participant declining the call. */
1256
+ readonly participant?: VoipParticipantReference;
1257
+ }
1258
+ /** Body for `POST /messaging/voip/calls/{callId}/participants`. */
1259
+ export interface VoipAddParticipantRequest {
1260
+ /** Phone number in E.164 form or a WhatsApp user ID. */
1261
+ readonly to: string;
1262
+ }
1263
+ export type VoipParticipantState = "invited" | "ringing" | "connected" | "left";
1264
+ export interface VoipParticipant {
1265
+ readonly id: string;
1266
+ readonly phoneNumber?: string;
1267
+ readonly bsuid?: string;
1268
+ readonly username?: string;
1269
+ readonly audioMuted: boolean;
1270
+ readonly video: boolean;
1271
+ readonly state: VoipParticipantState;
1272
+ }
1273
+ export type VoipAddParticipantResponse = SuccessEnvelope<VoipParticipant>;
1274
+ /** Call settings for one session (`/platform/sessions/{session}/call-settings`). */
1275
+ export interface SessionCallSettings {
1276
+ /**
1277
+ * Whether the session can place, answer and receive calls. While `false`,
1278
+ * those actions fail with `calls_disabled`, incoming calls are declined and
1279
+ * SIP trunks cannot call through the session. Calls in progress continue.
1280
+ */
1281
+ readonly callsEnabled: boolean;
1282
+ /**
1283
+ * Conference mode, `true` by default. When `true`, every participant you
1284
+ * connect to a call (browser, app and server connections, and SIP trunk
1285
+ * callers) hears the WhatsApp party and each other. When `false`, each
1286
+ * hears only the WhatsApp party. The WhatsApp party always hears all of
1287
+ * your participants, and nobody hears their own audio, including from
1288
+ * their other connections.
1289
+ */
1290
+ readonly conferenceMode: boolean;
1291
+ /**
1292
+ * Where incoming WhatsApp calls ring. `clients` rings your connected
1293
+ * participants; `sip_trunk` also sends each call to `sipTrunkId`.
1294
+ */
1295
+ readonly inboundRoute: CallInboundRoute;
1296
+ /** The SIP trunk that receives incoming calls, or `null` when `inboundRoute` is `clients`. */
1297
+ readonly sipTrunkId: string | null;
1298
+ /** Whether an answer from the SIP trunk claims the call. `true` by default. */
1299
+ readonly sipClaim: boolean;
1300
+ /**
1301
+ * On a Cloud API session, whether Polymorfa Calls answers incoming calls.
1302
+ * `false` by default: your Graph API integration answers them. Sessions on a
1303
+ * linked device ignore it.
1304
+ */
1305
+ readonly hostCloudApiCalls: boolean;
1306
+ /**
1307
+ * Increases on every change; `0` while the session uses the defaults. Send
1308
+ * it as `expectedRevision` so an update cannot overwrite another change.
1309
+ */
1310
+ readonly revision: number;
1311
+ /** ISO 8601 timestamp of the last change, or `null` while the session uses the defaults. */
1312
+ readonly updatedAt: string | null;
1313
+ }
1314
+ export type CallInboundRoute = "clients" | "sip_trunk";
1315
+ /**
1316
+ * Changes the settings you send; omitted settings keep their values. Send at
1317
+ * least one setting.
1318
+ */
1319
+ export interface UpdateSessionCallSettingsRequest {
1320
+ /** `false` turns calling off for the session; `true` turns it back on. */
1321
+ readonly callsEnabled?: boolean;
1322
+ /**
1323
+ * `true` lets the participants you connect hear each other as well as the
1324
+ * WhatsApp party; `false` lets each hear only the WhatsApp party.
1325
+ */
1326
+ readonly conferenceMode?: boolean;
1327
+ /** Where incoming WhatsApp calls ring. `clients` clears the trunk. */
1328
+ readonly inboundRoute?: CallInboundRoute;
1329
+ /**
1330
+ * A trunk of the session's project with direction `outbound` or `both`.
1331
+ * Required when switching to `sip_trunk`; omit it to keep the stored trunk.
1332
+ */
1333
+ readonly sipTrunkId?: string | null;
1334
+ readonly sipClaim?: boolean;
1335
+ /** `true` has Polymorfa Calls answer a Cloud API session's incoming calls. */
1336
+ readonly hostCloudApiCalls?: boolean;
1337
+ /**
1338
+ * Apply the update only if the settings still have this `revision`;
1339
+ * otherwise it fails with `PolymorfaConflictError` (`state_conflict`).
1340
+ */
1341
+ readonly expectedRevision?: number;
1342
+ }
1343
+ export type SessionCallSettingsResponse = SuccessEnvelope<SessionCallSettings>;
1344
+ export type ListSessionsResponse = SuccessEnvelope<readonly Session[]>;
1345
+ export type GetSessionResponse = SuccessEnvelope<Session>;
1346
+ export type UpdateSessionResponse = SuccessEnvelope<Session>;
1347
+ export type GetSessionAccountResponse = SuccessEnvelope<WhatsAppAccount>;
1348
+ export type MessageKind = "text" | "image" | "file" | "voice" | "video" | "poll" | "location" | "contact" | "request_phone_number" | "product" | "product_list" | "order" | "list" | "buttons" | "address_message" | "flow";
1349
+ export interface QuotedMessage {
1350
+ readonly id: string;
1351
+ readonly type?: string;
1352
+ readonly text?: string;
1353
+ }
1354
+ export interface MessageTemplateSend {
1355
+ readonly name: string;
1356
+ readonly language: string;
1357
+ readonly components?: readonly unknown[];
1358
+ }
1359
+ export type ProductMessageMedia = {
1360
+ readonly url: string;
1361
+ readonly base64?: never;
1362
+ readonly mimeType?: string;
1363
+ } | {
1364
+ readonly url?: never;
1365
+ readonly base64: string;
1366
+ readonly mimeType?: string;
1367
+ };
1368
+ export interface ProductMessageContent {
1369
+ readonly businessOwnerId: string;
1370
+ readonly id: string;
1371
+ readonly title: string;
1372
+ readonly description?: string;
1373
+ readonly currencyCode: string;
1374
+ readonly priceAmount1000: number;
1375
+ readonly salePriceAmount1000?: number;
1376
+ readonly retailerId?: string;
1377
+ readonly url?: string;
1378
+ readonly imageCount?: number;
1379
+ readonly image?: ProductMessageMedia;
1380
+ readonly body?: string;
1381
+ readonly footer?: string;
1382
+ }
1383
+ export interface ProductListMessageSection {
1384
+ readonly title?: string;
1385
+ readonly productIds: readonly string[];
1386
+ }
1387
+ export interface ProductListMessageContent {
1388
+ readonly businessOwnerId: string;
1389
+ readonly title: string;
1390
+ readonly description?: string;
1391
+ readonly buttonText: string;
1392
+ readonly footer?: string;
1393
+ readonly sections: readonly ProductListMessageSection[];
1394
+ }
1395
+ export type OrderMessageStatus = "inquiry" | "accepted" | "declined";
1396
+ export interface OrderMessageContent {
1397
+ readonly id: string;
1398
+ readonly thumbnailBase64?: string;
1399
+ readonly itemCount: number;
1400
+ readonly status: OrderMessageStatus;
1401
+ readonly message?: string;
1402
+ readonly title?: string;
1403
+ readonly sellerId: string;
1404
+ readonly token?: string;
1405
+ readonly totalAmount1000: number;
1406
+ readonly totalCurrencyCode: string;
1407
+ readonly catalogType?: string;
1408
+ }
1409
+ export interface ListMessageRow {
1410
+ readonly id: string;
1411
+ readonly title: string;
1412
+ readonly description?: string;
1413
+ }
1414
+ export interface ListMessageSection {
1415
+ readonly title?: string;
1416
+ readonly rows: readonly ListMessageRow[];
1417
+ }
1418
+ export interface ListMessageContent {
1419
+ readonly title: string;
1420
+ readonly description?: string;
1421
+ readonly buttonText: string;
1422
+ readonly footer?: string;
1423
+ readonly sections: readonly ListMessageSection[];
1424
+ }
1425
+ export type MessageButton = {
1426
+ readonly type: "url";
1427
+ readonly text: string;
1428
+ readonly url: string;
1429
+ } | {
1430
+ readonly type: "call";
1431
+ readonly text: string;
1432
+ readonly phoneNumber: string;
1433
+ } | {
1434
+ readonly type: "reply";
1435
+ readonly text: string;
1436
+ readonly id: string;
1437
+ } | {
1438
+ readonly type: "copy";
1439
+ readonly text: string;
1440
+ readonly copyCode: string;
1441
+ } | {
1442
+ readonly type: "catalog";
1443
+ readonly text: string;
1444
+ readonly businessPhoneNumber: string;
1445
+ readonly catalogProductId?: string;
1446
+ };
1447
+ export interface ButtonsMessageContent {
1448
+ readonly title?: string;
1449
+ readonly body: string;
1450
+ readonly footer?: string;
1451
+ readonly buttons: readonly MessageButton[];
1452
+ }
1453
+ export interface AddressMessageContent {
1454
+ readonly body: string;
1455
+ readonly buttonText?: string;
1456
+ readonly footer?: string;
1457
+ readonly country?: string;
1458
+ }
1459
+ export interface FlowNavigateMessageContent {
1460
+ readonly body: string;
1461
+ readonly buttonText: string;
1462
+ readonly footer?: string;
1463
+ readonly id: string;
1464
+ readonly token: string;
1465
+ readonly action: "navigate";
1466
+ readonly screen: string;
1467
+ readonly dataJson?: string;
1468
+ }
1469
+ export interface FlowDataExchangeMessageContent {
1470
+ readonly body: string;
1471
+ readonly buttonText: string;
1472
+ readonly footer?: string;
1473
+ readonly id: string;
1474
+ readonly token: string;
1475
+ readonly action: "data_exchange";
1476
+ readonly screen?: never;
1477
+ readonly dataJson?: never;
1478
+ }
1479
+ export type FlowMessageContent = FlowNavigateMessageContent | FlowDataExchangeMessageContent;
1480
+ export interface ConversationIdentity {
1481
+ readonly id: string;
1482
+ readonly phoneNumber?: string;
1483
+ readonly bsuid?: string;
1484
+ readonly username?: string;
1485
+ }
1486
+ export type ConversationReference = Partial<ConversationIdentity> & ({
1487
+ readonly id: string;
1488
+ } | {
1489
+ readonly phoneNumber: string;
1490
+ } | {
1491
+ readonly bsuid: string;
1492
+ });
1493
+ export interface MessageSendContext {
1494
+ readonly conversation: ConversationReference;
1495
+ readonly isForwarded?: boolean;
1496
+ readonly mentions?: readonly string[];
1497
+ readonly quotedMessage?: QuotedMessage;
1498
+ }
1499
+ export interface SendTextMessageRequest extends MessageSendContext {
1500
+ readonly content: {
1501
+ readonly text: string;
1502
+ };
1503
+ }
1504
+ export type MediaMessageKind = "image" | "file" | "voice" | "video";
1505
+ export type MessageMediaContent<Kind extends MediaMessageKind = "image"> = ({
1506
+ readonly url: string;
1507
+ readonly base64?: never;
1508
+ } | {
1509
+ readonly url?: never;
1510
+ readonly base64: string;
1511
+ }) & {
1512
+ readonly mimeType?: string;
1513
+ readonly caption?: string;
1514
+ } & (Kind extends "file" ? {
1515
+ readonly filename?: string;
1516
+ readonly ptt?: never;
1517
+ } : Kind extends "voice" ? {
1518
+ readonly ptt?: boolean;
1519
+ readonly filename?: never;
1520
+ } : {
1521
+ readonly filename?: never;
1522
+ readonly ptt?: never;
1523
+ });
1524
+ export type SendMediaMessageRequest = MessageSendContext & {
1525
+ readonly content: {
1526
+ readonly image: MessageMediaContent;
1527
+ } | {
1528
+ readonly video: MessageMediaContent;
1529
+ } | {
1530
+ readonly file: MessageMediaContent<"file">;
1531
+ } | {
1532
+ readonly voice: MessageMediaContent<"voice">;
1533
+ };
1534
+ };
1535
+ export interface SendPollMessageRequest extends MessageSendContext {
1536
+ readonly content: {
1537
+ readonly poll: {
1538
+ readonly title: string;
1539
+ readonly options: readonly string[];
1540
+ readonly multiSelect?: boolean;
1541
+ };
1542
+ };
1543
+ }
1544
+ export interface SendLocationMessageRequest extends MessageSendContext {
1545
+ readonly content: {
1546
+ readonly location: {
1547
+ readonly lat: number;
1548
+ readonly long: number;
1549
+ readonly address?: string;
1550
+ };
1551
+ };
1552
+ }
1553
+ export interface SendContactMessageRequest extends MessageSendContext {
1554
+ readonly content: {
1555
+ readonly contact: {
1556
+ readonly vcard: string;
1557
+ };
1558
+ };
1559
+ }
1560
+ export interface SendPhoneNumberRequest extends MessageSendContext {
1561
+ readonly content: {
1562
+ readonly requestPhoneNumber: Readonly<Record<string, never>>;
1563
+ };
1564
+ }
1565
+ export interface SendProductMessageRequest extends MessageSendContext {
1566
+ readonly content: {
1567
+ readonly product: ProductMessageContent;
1568
+ };
1569
+ }
1570
+ export interface SendProductListMessageRequest extends MessageSendContext {
1571
+ readonly content: {
1572
+ readonly productList: ProductListMessageContent;
1573
+ };
1574
+ }
1575
+ export interface SendOrderMessageRequest extends MessageSendContext {
1576
+ readonly content: {
1577
+ readonly order: OrderMessageContent;
1578
+ };
1579
+ }
1580
+ export interface SendListMessageRequest extends MessageSendContext {
1581
+ readonly content: {
1582
+ readonly list: ListMessageContent;
1583
+ };
1584
+ }
1585
+ export interface SendButtonsMessageRequest extends MessageSendContext {
1586
+ readonly content: {
1587
+ readonly buttons: ButtonsMessageContent;
1588
+ };
1589
+ }
1590
+ export interface SendAddressMessageRequest extends MessageSendContext {
1591
+ readonly content: {
1592
+ readonly addressMessage: AddressMessageContent;
1593
+ };
1594
+ }
1595
+ export interface SendFlowMessageRequest extends MessageSendContext {
1596
+ readonly content: {
1597
+ readonly flow: FlowMessageContent;
1598
+ };
1599
+ }
1600
+ export interface SendTemplateMessageRequest extends MessageSendContext {
1601
+ readonly content: {
1602
+ readonly template: MessageTemplateSend;
1603
+ };
1604
+ }
1605
+ export type SendMessageRequest = SendTextMessageRequest | SendMediaMessageRequest | SendPollMessageRequest | SendLocationMessageRequest | SendContactMessageRequest | SendPhoneNumberRequest | SendProductMessageRequest | SendProductListMessageRequest | SendOrderMessageRequest | SendListMessageRequest | SendButtonsMessageRequest | SendAddressMessageRequest | SendFlowMessageRequest | SendTemplateMessageRequest;
1606
+ export interface MessageReceipt {
1607
+ readonly id: string;
1608
+ readonly whatsapp_id: string;
1609
+ readonly conversation: ConversationIdentity;
1610
+ readonly timestamp: string;
1611
+ readonly status: string;
1612
+ }
1613
+ export interface MessageResponse extends MessageReceipt {
1614
+ readonly type: string;
1615
+ readonly content?: SendMessageRequest["content"];
1616
+ readonly mediaId?: string;
1617
+ }
1618
+ export type SendMessageResponse = SuccessEnvelope<MessageResponse>;
1619
+ export type SendReactionResponse = SuccessEnvelope<MessageReceipt>;
1620
+ export type StarMessageResponse = SuccessEnvelope<{
1621
+ readonly status: "OK";
1622
+ }>;
1623
+ export interface SeenRequest {
1624
+ readonly conversation: ConversationReference;
1625
+ readonly id: string;
1626
+ }
1627
+ export interface TypingRequest {
1628
+ readonly conversation: ConversationReference;
1629
+ readonly state: "typing" | "recording" | "paused";
1630
+ }
1631
+ export interface ReactRequest {
1632
+ readonly conversation: ConversationReference;
1633
+ readonly id: string;
1634
+ readonly reaction: string;
1635
+ }
1636
+ export interface StarRequest {
1637
+ readonly conversation: ConversationReference;
1638
+ readonly id: string;
1639
+ readonly star: boolean;
1640
+ }
1641
+ export interface WebhookRetryConfig {
1642
+ readonly attempts: number;
1643
+ readonly delaySeconds: number;
1644
+ readonly policy: "linear" | "exponential" | "constant" | string;
1645
+ }
1646
+ export interface WebhookHeader {
1647
+ readonly name: string;
1648
+ readonly value: string;
1649
+ }
1650
+ export interface Webhook {
1651
+ readonly id: string;
1652
+ readonly tenantId: string;
1653
+ readonly session?: string;
1654
+ readonly url: string;
1655
+ readonly events: readonly string[];
1656
+ readonly retries: WebhookRetryConfig;
1657
+ readonly headers: readonly WebhookHeader[];
1658
+ readonly enabled: boolean;
1659
+ readonly format?: "native" | "meta";
1660
+ readonly createdAt: string;
1661
+ }
1662
+ export interface CreateWebhookRequest {
1663
+ readonly session?: string;
1664
+ readonly url: string;
1665
+ readonly events?: readonly string[];
1666
+ readonly hmacKey?: string;
1667
+ readonly retries?: WebhookRetryConfig;
1668
+ readonly headers?: readonly WebhookHeader[];
1669
+ readonly format?: "native" | "meta";
1670
+ }
1671
+ export interface UpdateWebhookRequest {
1672
+ readonly url?: string;
1673
+ readonly events?: readonly string[];
1674
+ readonly hmacKey?: string;
1675
+ readonly retries?: WebhookRetryConfig;
1676
+ readonly headers?: readonly WebhookHeader[];
1677
+ readonly enabled?: boolean;
1678
+ readonly format?: "native" | "meta";
1679
+ }
1680
+ export type ListWebhooksResponse = SuccessEnvelope<readonly Webhook[]>;
1681
+ export type CreateWebhookResponse = SuccessEnvelope<Webhook>;
1682
+ export type GetWebhookResponse = SuccessEnvelope<Webhook>;
1683
+ export type UpdateWebhookResponse = SuccessEnvelope<Webhook>;
1684
+ export type TemplateSurface = "cloud" | "whatsmeow" | "sandbox";
1685
+ export type TemplateCategory = "MARKETING" | "UTILITY" | "AUTHENTICATION";
1686
+ export type TemplateKind = "standard" | "carousel" | "authentication" | "limited_time_offer";
1687
+ export type TemplateVariableType = "text" | "number" | "currency" | "date_time";
1688
+ export interface TemplateVariable {
1689
+ readonly name: string;
1690
+ readonly type: TemplateVariableType;
1691
+ readonly example: string;
1692
+ }
1693
+ export type TemplateHeader = {
1694
+ readonly format: "none";
1695
+ } | {
1696
+ readonly format: "text";
1697
+ readonly text: string;
1698
+ } | {
1699
+ readonly format: "image" | "video" | "document";
1700
+ readonly example?: string;
1701
+ readonly filename?: string;
1702
+ } | {
1703
+ readonly format: "location";
1704
+ readonly example?: {
1705
+ readonly latitude: number;
1706
+ readonly longitude: number;
1707
+ readonly name?: string;
1708
+ readonly address?: string;
1709
+ };
1710
+ };
1711
+ export type TemplateButton = {
1712
+ readonly type: "quick_reply";
1713
+ readonly text: string;
1714
+ } | {
1715
+ readonly type: "url";
1716
+ readonly text: string;
1717
+ readonly url: string;
1718
+ } | {
1719
+ readonly type: "phone";
1720
+ readonly text: string;
1721
+ readonly phone: string;
1722
+ } | {
1723
+ readonly type: "copy_code";
1724
+ readonly text?: string;
1725
+ readonly example?: string;
1726
+ };
1727
+ export interface TemplateCarouselCard {
1728
+ readonly header: Extract<TemplateHeader, {
1729
+ readonly format: "image" | "video" | "document";
1730
+ }>;
1731
+ readonly body: string;
1732
+ readonly buttons?: readonly TemplateButton[];
1733
+ }
1734
+ export interface TemplateDefinition {
1735
+ readonly version: 1;
1736
+ readonly kind: TemplateKind;
1737
+ readonly category: TemplateCategory;
1738
+ readonly language: string;
1739
+ readonly header?: TemplateHeader;
1740
+ readonly body: string;
1741
+ readonly footer?: string;
1742
+ readonly buttons?: readonly TemplateButton[];
1743
+ readonly carousel?: {
1744
+ readonly cards: readonly TemplateCarouselCard[];
1745
+ };
1746
+ readonly authentication?: {
1747
+ readonly otpType: "copy_code" | "one_tap";
1748
+ readonly codeExample?: string;
1749
+ readonly addSecurityRecommendation?: boolean;
1750
+ readonly codeExpirationMinutes?: number;
1751
+ };
1752
+ readonly limitedTimeOffer?: {
1753
+ readonly text: string;
1754
+ readonly hasExpiration: boolean;
1755
+ };
1756
+ readonly variables: readonly TemplateVariable[];
1757
+ }
1758
+ export interface ProjectTemplate {
1759
+ readonly id: string;
1760
+ readonly name: string;
1761
+ readonly category: string;
1762
+ readonly language: string;
1763
+ readonly status: string;
1764
+ readonly kind: string;
1765
+ readonly definition?: TemplateDefinition | null;
1766
+ readonly sampleValues?: Readonly<Record<string, string>> | null;
1767
+ readonly cloudLinks: readonly unknown[];
1768
+ readonly createdAt: number;
1769
+ readonly updatedAt: number;
1770
+ }
1771
+ export interface CreateProjectTemplateRequest {
1772
+ readonly name: string;
1773
+ readonly definition: TemplateDefinition;
1774
+ readonly sampleValues?: Readonly<Record<string, string>>;
1775
+ }
1776
+ export interface UpdateProjectTemplateRequest {
1777
+ readonly name?: string;
1778
+ readonly status?: string;
1779
+ readonly definition?: TemplateDefinition;
1780
+ readonly sampleValues?: Readonly<Record<string, string>>;
1781
+ }
1782
+ export interface PreviewProjectTemplateRequest {
1783
+ readonly values?: Readonly<Record<string, string>>;
1784
+ readonly surface?: TemplateSurface;
1785
+ }
1786
+ export interface SubmitProjectTemplateRequest {
1787
+ readonly session: string;
1788
+ }
1789
+ export type ListProjectTemplatesResponse = SuccessEnvelope<readonly ProjectTemplate[]>;
1790
+ export type ProjectTemplateResponse = SuccessEnvelope<ProjectTemplate>;
1791
+ export type ProjectTemplateOperationResponse = SuccessEnvelope<Readonly<Record<string, unknown>>>;
1792
+ export {};
1793
+ //# sourceMappingURL=types.d.ts.map