@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,897 @@
1
+ export interface DataEnvelope<T> {
2
+ readonly data: T;
3
+ }
4
+ export type PlatformPayload = Readonly<Record<string, unknown>>;
5
+ export type CustomerStatus = "active" | "archiving" | "archived";
6
+ export interface Customer {
7
+ readonly id: string;
8
+ readonly orgId: string;
9
+ readonly projectId: string;
10
+ readonly name: string | null;
11
+ readonly externalCustomerId: string | null;
12
+ readonly status: CustomerStatus;
13
+ readonly isDefault: boolean;
14
+ readonly archivedAt: number | null;
15
+ readonly createdAt: number;
16
+ readonly updatedAt: number;
17
+ }
18
+ export interface CustomerSummary extends Customer {
19
+ readonly numberCount: number;
20
+ readonly connectedNumberCount: number;
21
+ readonly activePairingLinkState: string | null;
22
+ readonly lastActivityAt: number | null;
23
+ readonly needsAttention: boolean;
24
+ }
25
+ export interface CustomersStatus {
26
+ readonly enabled: boolean;
27
+ readonly enabledAt: number | null;
28
+ readonly enabledBy: string | null;
29
+ readonly defaultCustomer: Customer | null;
30
+ }
31
+ export interface CustomersEnablement extends CustomersStatus {
32
+ readonly migratedNumberCount: number;
33
+ }
34
+ export interface CustomerProjectRequest {
35
+ readonly projectId?: string;
36
+ }
37
+ export interface CreateCustomerRequest {
38
+ readonly projectId?: string;
39
+ readonly name?: string | null;
40
+ readonly externalCustomerId?: string | null;
41
+ }
42
+ export interface UpdateCustomerRequest {
43
+ readonly projectId?: string;
44
+ readonly name?: string | null;
45
+ readonly externalCustomerId?: string | null;
46
+ }
47
+ export interface ListCustomersParams {
48
+ readonly projectId: string;
49
+ readonly cursor?: string;
50
+ readonly limit?: number;
51
+ readonly search?: string;
52
+ readonly status?: CustomerStatus | "all";
53
+ readonly isDefault?: boolean;
54
+ readonly hasNumbers?: boolean;
55
+ readonly needsAttention?: boolean;
56
+ }
57
+ export interface CustomerListPage {
58
+ readonly nextCursor: string | null;
59
+ readonly hasMore: boolean;
60
+ }
61
+ export interface CustomerListEnvelope {
62
+ readonly data: readonly CustomerSummary[];
63
+ readonly page: CustomerListPage;
64
+ }
65
+ export interface CustomerNumber {
66
+ readonly id: string;
67
+ readonly customerId: string;
68
+ readonly sessionId: string;
69
+ readonly name: string | null;
70
+ readonly phoneMasked: string | null;
71
+ readonly status: string;
72
+ readonly backend: string | null;
73
+ readonly createdAt: number;
74
+ }
75
+ export interface CustomerEventMetadata {
76
+ readonly fields?: readonly ("name" | "phone" | "externalCustomerId")[];
77
+ }
78
+ export interface CustomerEvent {
79
+ readonly id: string;
80
+ readonly action: string;
81
+ readonly fromStatus: string | null;
82
+ readonly toStatus: string | null;
83
+ readonly sessionId: string | null;
84
+ readonly pairingLinkId: string | null;
85
+ readonly metadata: CustomerEventMetadata;
86
+ readonly occurredAt: number;
87
+ }
88
+ export type CustomerPairingMethod = "qr" | "phone";
89
+ export type CustomerPairingLocale = "en" | "pt-BR";
90
+ export type CustomerPairingTheme = "light" | "dark" | "system";
91
+ export type CustomerPairingLinkStatus = "active" | "opened" | "connecting" | "connected" | "failed" | "expired" | "revoked";
92
+ export interface CustomerPairingLink {
93
+ readonly id: string;
94
+ readonly orgId: string;
95
+ readonly projectId: string;
96
+ readonly customerId: string;
97
+ readonly expectedPhoneMasked: string | null;
98
+ readonly methods: readonly CustomerPairingMethod[];
99
+ readonly locale: CustomerPairingLocale | null;
100
+ readonly theme: CustomerPairingTheme | null;
101
+ readonly expiresAt: number;
102
+ readonly status: CustomerPairingLinkStatus;
103
+ readonly attemptCount: number;
104
+ readonly maxAttempts: number;
105
+ readonly pendingSessionId: string | null;
106
+ readonly createdBy: string | null;
107
+ readonly reservedAt: number | null;
108
+ readonly openedAt: number | null;
109
+ readonly connectingAt: number | null;
110
+ readonly connectedAt: number | null;
111
+ readonly failedAt: number | null;
112
+ readonly expiredAt: number | null;
113
+ readonly revokedAt: number | null;
114
+ readonly lastErrorCode: string | null;
115
+ readonly failedExchangeCount: number;
116
+ readonly phoneMismatchCount: number;
117
+ readonly createdAt: number;
118
+ readonly updatedAt: number;
119
+ }
120
+ export interface CreatedCustomerPairingLink extends CustomerPairingLink {
121
+ /** Returned once. An idempotent replay returns null. */
122
+ readonly url: string | null;
123
+ }
124
+ export interface CreateCustomerPairingLinkRequest {
125
+ readonly projectId?: string;
126
+ readonly expectedPhone?: string | null;
127
+ readonly methods?: readonly CustomerPairingMethod[];
128
+ readonly expiresInSeconds?: number;
129
+ }
130
+ export interface ListCustomerEventsParams {
131
+ readonly projectId: string;
132
+ readonly limit?: number;
133
+ }
134
+ export interface TransferCustomerNumberRequest {
135
+ readonly projectId: string;
136
+ readonly sourceCustomerId: string;
137
+ readonly confirm: true;
138
+ }
139
+ export interface ListCampaignsParams {
140
+ readonly projectId: string;
141
+ readonly projectSlug?: string;
142
+ }
143
+ export interface Organization {
144
+ readonly id: string;
145
+ readonly externalId: string;
146
+ readonly name: string;
147
+ readonly slug: string | null;
148
+ readonly email: string;
149
+ readonly timezone: string | null;
150
+ readonly creditBalanceCents: number;
151
+ readonly lowBalanceThresholdCents: number;
152
+ readonly billingEmail: string | null;
153
+ readonly status: string | null;
154
+ readonly plan: string | null;
155
+ readonly planStatus: string | null;
156
+ readonly isActive: boolean;
157
+ readonly createdAt: number;
158
+ readonly updatedAt: number;
159
+ }
160
+ export type BillingCurrency = "USD" | "BRL" | "INR";
161
+ export interface BillingBalance {
162
+ readonly balanceCents: number;
163
+ readonly preferredCurrency: BillingCurrency;
164
+ }
165
+ export interface BillingUsage {
166
+ readonly activeNumbers: number;
167
+ readonly totalChargedCents: number;
168
+ }
169
+ export interface BillingTransaction {
170
+ readonly id: string;
171
+ readonly amountCents: number;
172
+ readonly balanceAfterCents: number;
173
+ readonly type: string;
174
+ readonly description: string;
175
+ readonly sessionId: string | null;
176
+ readonly projectId: string | null;
177
+ readonly tier: string | null;
178
+ readonly currency: string | null;
179
+ readonly paymentStatus: "paid" | "refunded";
180
+ readonly createdAt: number;
181
+ }
182
+ export interface TierPricing {
183
+ readonly id: string;
184
+ readonly tier: string;
185
+ readonly dailyRateCents: number;
186
+ readonly label: string;
187
+ readonly description: string;
188
+ readonly features: readonly string[];
189
+ }
190
+ /** Metadata for an organization server API key. Raw key material is never returned. */
191
+ export interface ApiKey {
192
+ readonly _id: string;
193
+ readonly _creationTime: number;
194
+ readonly id: string;
195
+ readonly keyId: string;
196
+ readonly start: string;
197
+ readonly last4: string;
198
+ readonly orgId: string;
199
+ readonly label: string;
200
+ readonly scopes: number;
201
+ readonly source: string;
202
+ readonly expiresAt: number;
203
+ readonly lastUsed?: number;
204
+ readonly isActive: boolean;
205
+ }
206
+ export interface ApiKeyDeactivation {
207
+ readonly ok: true;
208
+ readonly keyId: string;
209
+ }
210
+ export type OrganizationMemberRole = "owner" | "admin" | "member";
211
+ export interface OrganizationMember {
212
+ readonly _id: string;
213
+ readonly _creationTime: number;
214
+ readonly orgId: string;
215
+ readonly userId: string;
216
+ readonly email: string;
217
+ readonly name: string | null;
218
+ readonly role: OrganizationMemberRole;
219
+ readonly status: string;
220
+ readonly invitedAt: number | null;
221
+ readonly joinedAt: number | null;
222
+ }
223
+ export interface ListAuditLogsParams {
224
+ readonly action?: string;
225
+ readonly resource?: string;
226
+ /** The live API bounds this value to 1 through 500 and defaults it to 100. */
227
+ readonly limit?: number;
228
+ }
229
+ export interface AuditLog {
230
+ readonly id: string;
231
+ readonly actorEmail: string;
232
+ readonly actorUserId: string | null;
233
+ readonly actorRole: string | null;
234
+ readonly action: string;
235
+ readonly resource: string;
236
+ readonly projectId: string | null;
237
+ readonly projectName: string | null;
238
+ readonly ip: string | null;
239
+ readonly userAgent: string | null;
240
+ readonly duration: number | null;
241
+ readonly source: string | null;
242
+ readonly description: string | null;
243
+ readonly result: string;
244
+ readonly metadata: unknown;
245
+ readonly createdAt: number;
246
+ }
247
+ export type SessionBanStatus = "active" | "lifted";
248
+ export interface SessionBan {
249
+ readonly id: string;
250
+ readonly sessionName: string;
251
+ readonly banCode: number | null;
252
+ readonly banReason: string | null;
253
+ readonly banExpiresAt: number | null;
254
+ readonly occurredAt: number;
255
+ readonly status: SessionBanStatus;
256
+ }
257
+ export interface SecurityIncident {
258
+ readonly id: string;
259
+ readonly keyId: string;
260
+ readonly tokenType: string;
261
+ readonly source: string;
262
+ readonly url: string | null;
263
+ readonly ref: string | null;
264
+ readonly resolution: string;
265
+ readonly detectedAt: number;
266
+ readonly acknowledgedAt: number | null;
267
+ readonly acknowledgedBy: string | null;
268
+ readonly createdAt: number;
269
+ }
270
+ export interface SecurityIncidentAcknowledgement {
271
+ readonly acknowledged: true;
272
+ }
273
+ /** Project-token metadata. The bearer token itself is never returned. */
274
+ export interface ProjectToken {
275
+ readonly id: string;
276
+ readonly start: string;
277
+ readonly last4: string;
278
+ readonly label: string | null;
279
+ readonly scopes: number;
280
+ readonly expiresAt: number | null;
281
+ readonly createdAt: number;
282
+ readonly lastUsedAt: number | null;
283
+ readonly revokedAt: number | null;
284
+ }
285
+ export interface ProjectIcon {
286
+ readonly type: string;
287
+ readonly value: string;
288
+ readonly color?: string;
289
+ readonly storageId?: string;
290
+ }
291
+ export interface Project {
292
+ readonly id: string;
293
+ readonly orgId: string;
294
+ readonly name: string;
295
+ readonly slug: string;
296
+ readonly icon: ProjectIcon | Readonly<Record<string, unknown>>;
297
+ readonly defaultTier: string;
298
+ readonly isActive: boolean;
299
+ readonly stage: "development" | "production";
300
+ }
301
+ /** A project as returned by creation; new projects always start in development. */
302
+ export interface CreatedProject extends Project {
303
+ readonly stage: "development";
304
+ }
305
+ export interface ProjectWithStats {
306
+ readonly _id: string;
307
+ readonly _creationTime: number;
308
+ readonly orgId: string;
309
+ readonly name: string;
310
+ readonly slug: string;
311
+ readonly icon: ProjectIcon | Readonly<Record<string, unknown>>;
312
+ readonly defaultTier: string;
313
+ readonly isActive: boolean;
314
+ readonly stage: "development" | "production";
315
+ readonly activeSessions: number;
316
+ readonly totalSessions: number;
317
+ readonly totalMessages: number;
318
+ readonly lastActivity: number | null;
319
+ readonly iconUrl: string | null;
320
+ }
321
+ export type ProjectDefaultTier = "free" | "standard" | "pro";
322
+ /** Icon accepted by `projects.create`. */
323
+ export interface ProjectIconInput {
324
+ readonly type: "emoji" | "icon" | "image";
325
+ readonly value: string;
326
+ readonly color?: string;
327
+ readonly storageId?: string;
328
+ }
329
+ export interface CreateProjectRequest {
330
+ readonly name: string;
331
+ readonly icon?: ProjectIconInput;
332
+ readonly defaultTier?: ProjectDefaultTier;
333
+ }
334
+ /** The project returned by `projects.create`, always in development. */
335
+ export interface CreatedProject {
336
+ readonly id: string;
337
+ readonly orgId: string;
338
+ readonly name: string;
339
+ readonly slug: string;
340
+ readonly icon: ProjectIcon;
341
+ readonly defaultTier: ProjectDefaultTier;
342
+ readonly isActive: boolean;
343
+ readonly stage: "development";
344
+ }
345
+ export interface ProductionBusiness {
346
+ readonly name: string;
347
+ readonly website: string;
348
+ readonly supportEmail: string;
349
+ }
350
+ export interface ProductionEnrollmentRequest {
351
+ readonly business: ProductionBusiness;
352
+ }
353
+ export interface ProductionEnrollmentResult {
354
+ readonly id: string;
355
+ readonly orgId: string;
356
+ readonly name: string;
357
+ readonly slug: string;
358
+ readonly stage: "development";
359
+ readonly operationId: string;
360
+ readonly enrollmentStatus: "requested" | "approval_required" | "provisioning" | "ready";
361
+ /** The team's billing mode after the request; enrollment upgrades it. */
362
+ readonly billingMode: "payg";
363
+ }
364
+ export interface ProductionEnrollmentCommandResult {
365
+ readonly operationId: string;
366
+ readonly action: "approve" | "cancel";
367
+ readonly accepted: true;
368
+ }
369
+ export type SessionTier = "free" | "standard" | "pro" | "scale";
370
+ export interface PlatformSession {
371
+ readonly _id: string;
372
+ readonly _creationTime: number;
373
+ readonly projectId: string;
374
+ readonly sessionId: string;
375
+ readonly name: string;
376
+ readonly phone: string | null;
377
+ readonly platform: string | null;
378
+ readonly isBusiness: boolean;
379
+ readonly testMode: boolean;
380
+ readonly tierOverride: SessionTier | null;
381
+ readonly status: string;
382
+ readonly messageCount: number;
383
+ readonly lastActiveAt: number | null;
384
+ /** Charged rolling-window expiry in epoch milliseconds; null if never charged. */
385
+ readonly paidUntil: number | null;
386
+ }
387
+ export interface ManagedSession {
388
+ readonly id: string;
389
+ readonly sessionId: string;
390
+ readonly status: string;
391
+ readonly tierOverride: SessionTier | null;
392
+ }
393
+ export interface ListPlatformSessionsParams {
394
+ readonly projectId?: string;
395
+ }
396
+ export interface SessionProjectContext {
397
+ readonly projectId?: string;
398
+ }
399
+ export interface SessionStartResult {
400
+ readonly starting: true;
401
+ readonly sessionId: string;
402
+ }
403
+ export interface SessionStopResult {
404
+ readonly stopping: true;
405
+ readonly sessionId: string;
406
+ }
407
+ export interface SessionRemoveResult {
408
+ readonly removed: true;
409
+ readonly sessionId: string;
410
+ }
411
+ /** A source-bounded batch of 1 through 100 session UUIDs or stable slugs. */
412
+ export interface SessionBatchRequest {
413
+ readonly projectId?: string;
414
+ readonly sessionIds: readonly string[];
415
+ }
416
+ /** Number of matching sessions for which an asynchronous stop was requested. */
417
+ export interface SessionBatchStopResult {
418
+ readonly stopping: number;
419
+ }
420
+ /** Number of matching sessions permanently removed from management storage. */
421
+ export interface SessionBatchRemoveResult {
422
+ readonly removed: number;
423
+ }
424
+ export interface SessionTierOverrideRequest {
425
+ readonly projectId?: string;
426
+ readonly quoteId: string;
427
+ }
428
+ export interface NumberTierQuoteRequest {
429
+ readonly projectId?: string;
430
+ readonly tierOverride: "free" | "standard" | "pro" | null;
431
+ }
432
+ export interface NumberTierChange {
433
+ readonly id: string;
434
+ readonly status: "quoted" | "queued" | "applied" | "rejected";
435
+ readonly failureReason: string | null;
436
+ readonly expiresAtMs: number;
437
+ readonly quote: {
438
+ readonly tier: string;
439
+ readonly tierOverride: string | null;
440
+ /** Credits, with up to six decimal places; this is not a cash amount. */
441
+ readonly amountCents: number;
442
+ readonly priceVersion: string;
443
+ readonly action: "upgrade" | "downgrade" | "configure";
444
+ readonly effectiveAtMs: number;
445
+ readonly replacesWindowId: string | null;
446
+ };
447
+ }
448
+ export interface CursorPageMetadata {
449
+ readonly nextCursor: string | null;
450
+ readonly hasMore: boolean;
451
+ }
452
+ export interface CursorEnvelope<T> {
453
+ readonly data: readonly T[];
454
+ readonly page: CursorPageMetadata;
455
+ }
456
+ export type BanSafeHealthBand = "good" | "fair" | "poor" | "failing" | "unknown";
457
+ export type BanSafeHealthState = "healthy" | "limited" | "restricted" | "banned";
458
+ export type BanSafeHealthSource = "rules_v1" | "ml_model" | "unavailable";
459
+ export type BanSafeHealthReliability = "rules_based" | "validated" | "unavailable";
460
+ export type BanSafeHealthUnavailableReason = "no_active_model" | "invalid_active_model" | "insufficient_fresh_features";
461
+ export type BanSafeEnforcementRung = "none" | "notify" | "throttle" | "block_cold" | "suspend";
462
+ export type BanSafeAppealState = "none" | "requested" | "granted" | "denied";
463
+ export interface BanSafeHealthProbabilities {
464
+ readonly healthy: number;
465
+ readonly limited: number;
466
+ readonly restricted: number;
467
+ readonly banned: number;
468
+ }
469
+ export type BanSafeHealthExplanationGroup = "direct_condition" | "delivery" | "connection" | "conduct" | "cadence";
470
+ export interface BanSafeHealthExplanationFactor {
471
+ readonly group: BanSafeHealthExplanationGroup;
472
+ readonly key: string;
473
+ readonly penalty: number;
474
+ readonly observedValue: number;
475
+ readonly sampleSize: number;
476
+ }
477
+ export interface BanSafeHealthExplanation {
478
+ readonly penalties: {
479
+ readonly conduct: number;
480
+ readonly delivery: number;
481
+ readonly connection: number;
482
+ readonly restriction: number;
483
+ readonly total: number;
484
+ };
485
+ readonly factors: readonly BanSafeHealthExplanationFactor[];
486
+ readonly measuredGroups: readonly BanSafeHealthExplanationGroup[];
487
+ readonly missingGroups: readonly BanSafeHealthExplanationGroup[];
488
+ }
489
+ export interface BanSafeObservedAccountState {
490
+ readonly state: BanSafeHealthState;
491
+ readonly observedAt: string;
492
+ readonly source: "account_check" | "restriction_event";
493
+ }
494
+ export interface BanSafeHealthProjection {
495
+ readonly health: number | null;
496
+ readonly band: BanSafeHealthBand;
497
+ readonly healthSource: BanSafeHealthSource;
498
+ readonly healthEstimatorVersion: string | null;
499
+ readonly healthModelVersion: string | null;
500
+ readonly healthEvaluatedAt: string | null;
501
+ readonly healthFeatureCoverage: number | null;
502
+ readonly healthReliability: BanSafeHealthReliability;
503
+ readonly healthUnavailableReason: BanSafeHealthUnavailableReason | null;
504
+ readonly healthProbabilities: BanSafeHealthProbabilities | null;
505
+ readonly mostLikelyHealthState: BanSafeHealthState | null;
506
+ readonly healthExplanation: BanSafeHealthExplanation | null;
507
+ readonly observedAccountState: BanSafeObservedAccountState | null;
508
+ }
509
+ export interface BanSafeNumberEnforcement {
510
+ readonly rung: BanSafeEnforcementRung;
511
+ readonly previousRung: BanSafeEnforcementRung;
512
+ readonly organizationFloor: BanSafeEnforcementRung;
513
+ readonly reason: string;
514
+ readonly source: "automatic" | "operator";
515
+ readonly throughputPerMinute: number | null;
516
+ readonly blocksUnsolicited: boolean;
517
+ readonly suspended: boolean;
518
+ readonly startedAt: string;
519
+ readonly eligibleLiftAt: string | null;
520
+ readonly exitProgress: number;
521
+ readonly blockingFindings: readonly string[];
522
+ readonly operatorHold: boolean;
523
+ readonly appealState: BanSafeAppealState;
524
+ readonly state: "applied" | "applying";
525
+ }
526
+ export interface BanSafeNumber extends BanSafeHealthProjection {
527
+ readonly sessionId: string;
528
+ readonly session: string;
529
+ readonly phoneNumber: string;
530
+ readonly projectId: string;
531
+ readonly enforcement: BanSafeNumberEnforcement | null;
532
+ }
533
+ export interface WarmupCurvePoint {
534
+ readonly day: number;
535
+ readonly allowance: number;
536
+ }
537
+ export interface BanSafeNumberWarmup {
538
+ readonly enabled: boolean;
539
+ readonly tenureSource: "history" | "link" | "plan" | null;
540
+ readonly tenureDay: number;
541
+ readonly allowance: number | null;
542
+ readonly sentToday: number | null;
543
+ readonly resetsAt: string | null;
544
+ readonly curve: readonly WarmupCurvePoint[];
545
+ }
546
+ export interface BanSafeNumberDetail extends BanSafeNumber {
547
+ readonly warmup: BanSafeNumberWarmup;
548
+ readonly findings: readonly BanSafeFinding[];
549
+ readonly liftRequires: string | null;
550
+ readonly appealState: BanSafeAppealState;
551
+ }
552
+ export interface BanSafeHealthPoint extends Omit<BanSafeHealthProjection, "band" | "healthEvaluatedAt"> {
553
+ readonly band: BanSafeHealthBand | null;
554
+ readonly healthEvaluatedAt: string;
555
+ }
556
+ export interface BanSafeHealthHistory {
557
+ readonly sessionId: string;
558
+ readonly session: string;
559
+ readonly points: readonly BanSafeHealthPoint[];
560
+ }
561
+ export type BanSafeFindingStatus = "open" | "acknowledged" | "resolved" | "not_measured";
562
+ export type BanSafeFindingSeverity = "info" | "warning" | "critical";
563
+ export interface BanSafeFinding {
564
+ readonly id: string | null;
565
+ readonly key: string;
566
+ readonly title: string;
567
+ readonly summary: string;
568
+ readonly fix: string;
569
+ readonly status: BanSafeFindingStatus;
570
+ readonly severity: BanSafeFindingSeverity | null;
571
+ readonly occurrences: number;
572
+ readonly reopenedCount: number;
573
+ readonly evidence: Readonly<Record<string, number>>;
574
+ readonly sessionId: string;
575
+ readonly session: string;
576
+ readonly phoneNumber: string;
577
+ readonly firstSeenAt: string | null;
578
+ readonly lastSeenAt: string | null;
579
+ readonly acknowledgedAt: string | null;
580
+ readonly acknowledgedBy: string | null;
581
+ readonly acknowledgementNote: string | null;
582
+ readonly snoozedUntil: string | null;
583
+ readonly resolvedAt: string | null;
584
+ readonly resolveReason: "clean" | "key_retired" | "number_removed" | "stale" | null;
585
+ }
586
+ export interface BanSafeEnforcementSummary extends BanSafeHealthProjection {
587
+ readonly sessionId: string;
588
+ readonly session: string;
589
+ readonly phoneNumber: string;
590
+ readonly projectId: string;
591
+ readonly rung: BanSafeEnforcementRung;
592
+ readonly previousRung: BanSafeEnforcementRung;
593
+ readonly organizationFloor: BanSafeEnforcementRung;
594
+ readonly reason: string;
595
+ readonly source: "automatic" | "operator";
596
+ readonly throughputPerMinute: number | null;
597
+ readonly blocksUnsolicited: boolean;
598
+ readonly suspended: boolean;
599
+ /** Present when the API also returns the nested enforcement projection. */
600
+ readonly enforcement?: BanSafeNumberEnforcement | null;
601
+ readonly blockingFindings: readonly string[];
602
+ readonly startedAt: string;
603
+ readonly eligibleLiftAt: string | null;
604
+ readonly liftRequires: string;
605
+ readonly operatorHold: boolean;
606
+ readonly appealState: BanSafeAppealState;
607
+ readonly state: "applied" | "applying";
608
+ }
609
+ export type BanSafeIncidentKind = "cap_warning" | "cap_reached" | "timelock" | "temporary_ban" | "permanent_ban" | "connect_blocked" | "customer_report";
610
+ export interface BanSafeIncident {
611
+ readonly id: string;
612
+ readonly sessionId: string;
613
+ readonly session: string;
614
+ readonly phoneNumber: string;
615
+ readonly projectId: string;
616
+ readonly kind: BanSafeIncidentKind;
617
+ readonly source: "runtime" | "customer";
618
+ readonly resolution: string;
619
+ readonly ambiguous: boolean;
620
+ readonly startedAt: string;
621
+ readonly endsAt: string | null;
622
+ readonly closedAt: string | null;
623
+ readonly closedBy: string | null;
624
+ readonly claimId: string | null;
625
+ readonly note: string | null;
626
+ readonly reportedBy: string | null;
627
+ readonly createdAt: string;
628
+ }
629
+ export interface ReportBanSafeIncidentRequest {
630
+ readonly session: string;
631
+ readonly occurredAt?: string;
632
+ readonly note?: string;
633
+ }
634
+ export interface BanSafeIncidentReceipt {
635
+ readonly incidentId: string;
636
+ readonly created: boolean;
637
+ readonly sessionId: string;
638
+ readonly session: string;
639
+ readonly occurredAt: string;
640
+ }
641
+ export type BanSafeClaimStatus = "filed" | "under_review" | "approved" | "denied" | "paid" | "reversed";
642
+ export type BanSafeClaimVerdict = "other_device" | "customer_conduct" | "shared_network" | "ours" | "inconclusive";
643
+ export interface BanSafeClaimEvidence {
644
+ readonly attributionRuleVersion: number | null;
645
+ readonly windowDays: number;
646
+ readonly deviceEvidence: boolean;
647
+ readonly otherDevices: number;
648
+ readonly restrictedInWindow: boolean;
649
+ readonly criticalFindingDays: number;
650
+ readonly sharedConnection: boolean;
651
+ readonly measuredHours: number;
652
+ }
653
+ export interface BanSafeClaim {
654
+ readonly id: string;
655
+ readonly incidentId: string;
656
+ readonly sessionId: string;
657
+ readonly session: string;
658
+ readonly phoneNumber: string;
659
+ readonly projectId: string;
660
+ readonly status: BanSafeClaimStatus;
661
+ readonly verdict: BanSafeClaimVerdict;
662
+ readonly windowStart: string;
663
+ readonly windowEnd: string;
664
+ /** Credit quantity consumed inside the window; up to six decimal places. */
665
+ readonly measuredCents: number;
666
+ /** Maximum credit quantity this claim can return; up to six decimal places. */
667
+ readonly capCents: number;
668
+ /** Credit quantity this claim returns; up to six decimal places. */
669
+ readonly amountCents: number;
670
+ readonly evidence: BanSafeClaimEvidence;
671
+ readonly summary: string;
672
+ readonly reason: string;
673
+ readonly decidedAt: string | null;
674
+ readonly paidAt: string | null;
675
+ readonly createdAt: string;
676
+ }
677
+ export interface ListBanSafeHealthParams {
678
+ readonly projectId?: string;
679
+ readonly cursor?: string;
680
+ readonly limit?: number;
681
+ }
682
+ export interface ListBanSafeHealthHistoryParams {
683
+ readonly since?: string;
684
+ readonly limit?: number;
685
+ }
686
+ export interface ListBanSafeFindingsParams extends ListBanSafeHealthParams {
687
+ readonly session?: string;
688
+ readonly status?: Exclude<BanSafeFindingStatus, "not_measured">;
689
+ readonly severity?: BanSafeFindingSeverity;
690
+ }
691
+ export interface ListBanSafeEnforcementParams extends ListBanSafeHealthParams {
692
+ readonly rung?: BanSafeEnforcementRung;
693
+ }
694
+ export interface ListBanSafeIncidentsParams extends ListBanSafeHealthParams {
695
+ readonly session?: string;
696
+ }
697
+ export interface ListBanSafeClaimsParams extends ListBanSafeHealthParams {
698
+ readonly session?: string;
699
+ readonly status?: BanSafeClaimStatus;
700
+ }
701
+ export type BanSafeSignalKind = "number" | "boolean" | "enum" | "histogram" | "code_counts";
702
+ export type BanSafeSignalUnit = "count" | "milliseconds" | "unix_milliseconds" | "ratio" | "none";
703
+ export interface BanSafeSignalDefinition {
704
+ readonly key: string;
705
+ readonly label: string;
706
+ readonly group: string;
707
+ readonly kind: BanSafeSignalKind;
708
+ readonly unit: BanSafeSignalUnit;
709
+ readonly description: string;
710
+ }
711
+ export interface BanSafeSignal extends BanSafeSignalDefinition {
712
+ readonly measured: boolean;
713
+ readonly value: number | boolean | string | readonly number[] | null;
714
+ readonly sampleSize: number | null;
715
+ readonly codes: readonly {
716
+ readonly code: number;
717
+ readonly count: number;
718
+ }[] | null;
719
+ }
720
+ export type BanSafeCollectionState = "fresh" | "stale" | "not_collected" | "unsupported";
721
+ export interface BanSafeCollectionStatus {
722
+ readonly state: BanSafeCollectionState;
723
+ readonly latestFlushedAt: string | null;
724
+ readonly latestReceivedAt: string | null;
725
+ readonly freshUntil: string | null;
726
+ readonly recordVersion: number | null;
727
+ readonly collectorVersion: number | null;
728
+ readonly partial: boolean | null;
729
+ readonly droppedRecords: number | null;
730
+ }
731
+ export interface BanSafeTelemetrySnapshot {
732
+ readonly bucketStart: string;
733
+ readonly flushedAt: string;
734
+ readonly receivedAt: string;
735
+ readonly partial: boolean;
736
+ readonly recordVersion: number | null;
737
+ readonly signals: readonly BanSafeSignal[];
738
+ }
739
+ export interface BanSafeCollectionSession {
740
+ readonly sessionId: string;
741
+ readonly session: string;
742
+ readonly projectId: string;
743
+ readonly collection: BanSafeCollectionStatus;
744
+ }
745
+ export interface BanSafeTelemetryDetail extends BanSafeCollectionSession {
746
+ readonly snapshot: BanSafeTelemetrySnapshot | null;
747
+ }
748
+ export interface ListBanSafeTelemetryHistoryParams {
749
+ readonly since?: string;
750
+ readonly until?: string;
751
+ readonly cursor?: string;
752
+ readonly limit?: number;
753
+ }
754
+ export type ListBanSafeCollectionParams = ListBanSafeHealthParams;
755
+ export type BanSafeHealthActionMode = "apply" | "clear";
756
+ export type BanSafeHealthActionKind = "stop" | "slow_down" | "log_out" | "email" | "webhook";
757
+ export type BanSafeHealthActionStatus = "pending" | "running" | "succeeded" | "failed" | "cancelled";
758
+ export type BanSafeHealthActionOutcome = "applied" | "cleared" | "notification_queued" | "superseded" | "expired" | "not_applied" | "delivery_failed";
759
+ export interface BanSafeHealthAction {
760
+ readonly id: string;
761
+ readonly sessionId: string;
762
+ readonly session: string;
763
+ readonly projectId: string;
764
+ readonly mode: BanSafeHealthActionMode;
765
+ readonly action: BanSafeHealthActionKind;
766
+ readonly status: BanSafeHealthActionStatus;
767
+ readonly health: number;
768
+ readonly threshold: number;
769
+ readonly healthSource: Exclude<BanSafeHealthSource, "unavailable">;
770
+ readonly estimatorVersion: string;
771
+ readonly modelVersion: string | null;
772
+ readonly slowDownMps: number | null;
773
+ readonly evaluatedAt: string;
774
+ readonly createdAt: string;
775
+ readonly completedAt: string | null;
776
+ readonly outcome: BanSafeHealthActionOutcome | null;
777
+ }
778
+ export interface ListBanSafeHealthActionsParams extends ListBanSafeHealthParams {
779
+ readonly session?: string;
780
+ readonly status?: BanSafeHealthActionStatus;
781
+ }
782
+ export type BanSafeHealthEnvelope = CursorEnvelope<BanSafeNumber>;
783
+ export type BanSafeFindingsEnvelope = CursorEnvelope<BanSafeFinding>;
784
+ export type BanSafeEnforcementEnvelope = CursorEnvelope<BanSafeEnforcementSummary>;
785
+ export type BanSafeIncidentsEnvelope = CursorEnvelope<BanSafeIncident>;
786
+ export type BanSafeClaimsEnvelope = CursorEnvelope<BanSafeClaim>;
787
+ export type BanSafeTelemetryHistoryEnvelope = CursorEnvelope<BanSafeTelemetrySnapshot>;
788
+ export type BanSafeCollectionEnvelope = CursorEnvelope<BanSafeCollectionSession>;
789
+ export type BanSafeHealthActionsEnvelope = CursorEnvelope<BanSafeHealthAction>;
790
+ export type SafeModePresence = "dark" | "online_while_sending" | "online_hours";
791
+ export type SafeModeTyping = "off" | "before_text" | "before_all";
792
+ export type SafeModeReads = "off" | "replied_chats" | "all_inbound";
793
+ export type SafeModePacing = "off" | "jittered" | "conversation";
794
+ export interface SafeModeSettings {
795
+ readonly presence: SafeModePresence;
796
+ readonly typing: SafeModeTyping;
797
+ readonly reads: SafeModeReads;
798
+ readonly pacing: SafeModePacing;
799
+ readonly onlineStart: number;
800
+ readonly onlineEnd: number;
801
+ }
802
+ export interface UpdateProjectSafeModeRequest {
803
+ readonly presence?: SafeModePresence;
804
+ readonly typing?: SafeModeTyping;
805
+ readonly reads?: SafeModeReads;
806
+ readonly pacing?: SafeModePacing;
807
+ readonly onlineStart?: number;
808
+ readonly onlineEnd?: number;
809
+ }
810
+ export interface ProjectSafeMode {
811
+ readonly projectId: string;
812
+ readonly ceiling: SafeModeSettings;
813
+ readonly entitled: boolean;
814
+ readonly entitlementReason: string | null;
815
+ }
816
+ export interface SafeModeOverride {
817
+ readonly presence: SafeModePresence | "inherit";
818
+ readonly typing: SafeModeTyping | "inherit";
819
+ readonly reads: SafeModeReads | "inherit";
820
+ readonly pacing: SafeModePacing | "inherit";
821
+ }
822
+ export interface SafeModeApplied {
823
+ readonly observedAt: string;
824
+ readonly presence: string | null;
825
+ readonly typing: string | null;
826
+ readonly reads: string | null;
827
+ readonly pacing: string | null;
828
+ }
829
+ export interface SessionSafeMode {
830
+ readonly session: string;
831
+ readonly projectId: string;
832
+ readonly project: SafeModeSettings;
833
+ readonly override: SafeModeOverride;
834
+ readonly effective: SafeModeSettings;
835
+ readonly applied: SafeModeApplied | null;
836
+ readonly mismatch: boolean;
837
+ readonly entitled: boolean;
838
+ readonly entitlementReason: string | null;
839
+ }
840
+ export interface UpdateSessionSafeModeRequest {
841
+ readonly presence?: SafeModePresence | "inherit";
842
+ readonly typing?: SafeModeTyping | "inherit";
843
+ readonly reads?: SafeModeReads | "inherit";
844
+ readonly pacing?: SafeModePacing | "inherit";
845
+ }
846
+ export interface WarmupPlanSettings {
847
+ readonly enabled: boolean;
848
+ readonly warmupDays: number;
849
+ readonly dailyStart: number;
850
+ }
851
+ export interface ProjectWarmupPlan {
852
+ readonly projectId: string;
853
+ readonly plan: WarmupPlanSettings;
854
+ readonly ceiling: number;
855
+ readonly curve: readonly WarmupCurvePoint[];
856
+ readonly entitled: boolean;
857
+ readonly entitlementReason: string | null;
858
+ }
859
+ export interface UpdateProjectWarmupPlanRequest {
860
+ readonly enabled?: boolean;
861
+ readonly warmupDays?: number;
862
+ readonly dailyStart?: number;
863
+ }
864
+ export interface ProjectInsuranceEvidence {
865
+ readonly projectId: string;
866
+ readonly enabled: boolean;
867
+ readonly banInsuranceIncluded: boolean;
868
+ }
869
+ export interface UpdateProjectInsuranceEvidenceRequest {
870
+ readonly enabled: boolean;
871
+ }
872
+ export type ProjectHealthSessionAction = "none" | "stop" | "slow_down" | "log_out";
873
+ export interface ProjectHealthPolicyIntegrations {
874
+ readonly emailConfigured: boolean;
875
+ readonly webhookConfigured: boolean;
876
+ }
877
+ export interface ProjectHealthPolicy {
878
+ readonly projectId: string;
879
+ readonly version: number;
880
+ readonly enabled: boolean;
881
+ readonly threshold: number;
882
+ readonly sessionAction: ProjectHealthSessionAction;
883
+ readonly slowDownMps: number | null;
884
+ readonly emailNotification: boolean;
885
+ readonly webhookNotification: boolean;
886
+ readonly integrations: ProjectHealthPolicyIntegrations;
887
+ }
888
+ export interface UpdateProjectHealthPolicyRequest {
889
+ readonly version: number;
890
+ readonly enabled: boolean;
891
+ readonly threshold: number;
892
+ readonly sessionAction: ProjectHealthSessionAction;
893
+ readonly slowDownMps: number | null;
894
+ readonly emailNotification: boolean;
895
+ readonly webhookNotification: boolean;
896
+ }
897
+ //# sourceMappingURL=types.d.ts.map