@mobilerun/sdk 5.2.1 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/client.d.mts +13 -7
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +13 -7
  5. package/client.d.ts.map +1 -1
  6. package/client.js +9 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +9 -3
  9. package/client.mjs.map +1 -1
  10. package/core/streaming.d.mts +33 -0
  11. package/core/streaming.d.mts.map +1 -0
  12. package/core/streaming.d.ts +33 -0
  13. package/core/streaming.d.ts.map +1 -0
  14. package/core/streaming.js +263 -0
  15. package/core/streaming.js.map +1 -0
  16. package/core/streaming.mjs +258 -0
  17. package/core/streaming.mjs.map +1 -0
  18. package/internal/decoders/line.d.mts +17 -0
  19. package/internal/decoders/line.d.mts.map +1 -0
  20. package/internal/decoders/line.d.ts +17 -0
  21. package/internal/decoders/line.d.ts.map +1 -0
  22. package/internal/decoders/line.js +113 -0
  23. package/internal/decoders/line.js.map +1 -0
  24. package/internal/decoders/line.mjs +108 -0
  25. package/internal/decoders/line.mjs.map +1 -0
  26. package/internal/parse.d.mts.map +1 -1
  27. package/internal/parse.d.ts.map +1 -1
  28. package/internal/parse.js +10 -0
  29. package/internal/parse.js.map +1 -1
  30. package/internal/parse.mjs +10 -0
  31. package/internal/parse.mjs.map +1 -1
  32. package/internal/request-options.d.mts +2 -0
  33. package/internal/request-options.d.mts.map +1 -1
  34. package/internal/request-options.d.ts +2 -0
  35. package/internal/request-options.d.ts.map +1 -1
  36. package/internal/request-options.js.map +1 -1
  37. package/internal/request-options.mjs.map +1 -1
  38. package/internal/tslib.js +18 -18
  39. package/package.json +11 -1
  40. package/resources/apps.d.mts +2 -2
  41. package/resources/apps.d.mts.map +1 -1
  42. package/resources/apps.d.ts +2 -2
  43. package/resources/apps.d.ts.map +1 -1
  44. package/resources/assistant/assistant.d.mts +10 -0
  45. package/resources/assistant/assistant.d.mts.map +1 -0
  46. package/resources/assistant/assistant.d.ts +10 -0
  47. package/resources/assistant/assistant.d.ts.map +1 -0
  48. package/resources/assistant/assistant.js +17 -0
  49. package/resources/assistant/assistant.js.map +1 -0
  50. package/resources/assistant/assistant.mjs +12 -0
  51. package/resources/assistant/assistant.mjs.map +1 -0
  52. package/resources/assistant/conversations.d.mts +295 -0
  53. package/resources/assistant/conversations.d.mts.map +1 -0
  54. package/resources/assistant/conversations.d.ts +295 -0
  55. package/resources/assistant/conversations.d.ts.map +1 -0
  56. package/resources/assistant/conversations.js +109 -0
  57. package/resources/assistant/conversations.js.map +1 -0
  58. package/resources/assistant/conversations.mjs +105 -0
  59. package/resources/assistant/conversations.mjs.map +1 -0
  60. package/resources/assistant/index.d.mts +3 -0
  61. package/resources/assistant/index.d.mts.map +1 -0
  62. package/resources/assistant/index.d.ts +3 -0
  63. package/resources/assistant/index.d.ts.map +1 -0
  64. package/resources/assistant/index.js +9 -0
  65. package/resources/assistant/index.js.map +1 -0
  66. package/resources/assistant/index.mjs +4 -0
  67. package/resources/assistant/index.mjs.map +1 -0
  68. package/resources/assistant.d.mts +2 -0
  69. package/resources/assistant.d.mts.map +1 -0
  70. package/resources/assistant.d.ts +2 -0
  71. package/resources/assistant.d.ts.map +1 -0
  72. package/resources/assistant.js +6 -0
  73. package/resources/assistant.js.map +1 -0
  74. package/resources/assistant.mjs +3 -0
  75. package/resources/assistant.mjs.map +1 -0
  76. package/resources/devices/clipboard.d.mts +40 -0
  77. package/resources/devices/clipboard.d.mts.map +1 -0
  78. package/resources/devices/clipboard.d.ts +40 -0
  79. package/resources/devices/clipboard.d.ts.map +1 -0
  80. package/resources/devices/clipboard.js +50 -0
  81. package/resources/devices/clipboard.js.map +1 -0
  82. package/resources/devices/clipboard.mjs +46 -0
  83. package/resources/devices/clipboard.mjs.map +1 -0
  84. package/resources/devices/devices.d.mts +5 -0
  85. package/resources/devices/devices.d.mts.map +1 -1
  86. package/resources/devices/devices.d.ts +5 -0
  87. package/resources/devices/devices.d.ts.map +1 -1
  88. package/resources/devices/devices.js +4 -0
  89. package/resources/devices/devices.js.map +1 -1
  90. package/resources/devices/devices.mjs +4 -0
  91. package/resources/devices/devices.mjs.map +1 -1
  92. package/resources/devices/index.d.mts +1 -0
  93. package/resources/devices/index.d.mts.map +1 -1
  94. package/resources/devices/index.d.ts +1 -0
  95. package/resources/devices/index.d.ts.map +1 -1
  96. package/resources/devices/index.js +3 -1
  97. package/resources/devices/index.js.map +1 -1
  98. package/resources/devices/index.mjs +1 -0
  99. package/resources/devices/index.mjs.map +1 -1
  100. package/resources/esims/esims.d.mts +45 -45
  101. package/resources/esims/esims.d.mts.map +1 -1
  102. package/resources/esims/esims.d.ts +45 -45
  103. package/resources/esims/esims.d.ts.map +1 -1
  104. package/resources/esims/esims.js +3 -3
  105. package/resources/esims/esims.js.map +1 -1
  106. package/resources/esims/esims.mjs +3 -3
  107. package/resources/esims/esims.mjs.map +1 -1
  108. package/resources/esims/index.d.mts +1 -1
  109. package/resources/esims/index.d.mts.map +1 -1
  110. package/resources/esims/index.d.ts +1 -1
  111. package/resources/esims/index.d.ts.map +1 -1
  112. package/resources/esims/index.js.map +1 -1
  113. package/resources/esims/index.mjs.map +1 -1
  114. package/resources/esims/messages.d.mts +15 -20
  115. package/resources/esims/messages.d.mts.map +1 -1
  116. package/resources/esims/messages.d.ts +15 -20
  117. package/resources/esims/messages.d.ts.map +1 -1
  118. package/resources/files.d.mts +126 -0
  119. package/resources/files.d.mts.map +1 -0
  120. package/resources/files.d.ts +126 -0
  121. package/resources/files.d.ts.map +1 -0
  122. package/resources/files.js +68 -0
  123. package/resources/files.js.map +1 -0
  124. package/resources/files.mjs +64 -0
  125. package/resources/files.mjs.map +1 -0
  126. package/resources/index.d.mts +5 -3
  127. package/resources/index.d.mts.map +1 -1
  128. package/resources/index.d.ts +5 -3
  129. package/resources/index.d.ts.map +1 -1
  130. package/resources/index.js +7 -3
  131. package/resources/index.js.map +1 -1
  132. package/resources/index.mjs +3 -1
  133. package/resources/index.mjs.map +1 -1
  134. package/resources/mailboxes/index.d.mts +3 -0
  135. package/resources/mailboxes/index.d.mts.map +1 -0
  136. package/resources/mailboxes/index.d.ts +3 -0
  137. package/resources/mailboxes/index.d.ts.map +1 -0
  138. package/resources/mailboxes/index.js +9 -0
  139. package/resources/mailboxes/index.js.map +1 -0
  140. package/resources/mailboxes/index.mjs +4 -0
  141. package/resources/mailboxes/index.mjs.map +1 -0
  142. package/resources/mailboxes/mailboxes.d.mts +366 -0
  143. package/resources/mailboxes/mailboxes.d.mts.map +1 -0
  144. package/resources/mailboxes/mailboxes.d.ts +366 -0
  145. package/resources/mailboxes/mailboxes.d.ts.map +1 -0
  146. package/resources/mailboxes/mailboxes.js +146 -0
  147. package/resources/mailboxes/mailboxes.js.map +1 -0
  148. package/resources/mailboxes/mailboxes.mjs +141 -0
  149. package/resources/mailboxes/mailboxes.mjs.map +1 -0
  150. package/resources/mailboxes/messages.d.mts +82 -0
  151. package/resources/mailboxes/messages.d.mts.map +1 -0
  152. package/resources/mailboxes/messages.d.ts +82 -0
  153. package/resources/mailboxes/messages.d.ts.map +1 -0
  154. package/resources/mailboxes/messages.js +39 -0
  155. package/resources/mailboxes/messages.js.map +1 -0
  156. package/resources/mailboxes/messages.mjs +35 -0
  157. package/resources/mailboxes/messages.mjs.map +1 -0
  158. package/resources/mailboxes.d.mts +2 -0
  159. package/resources/mailboxes.d.mts.map +1 -0
  160. package/resources/mailboxes.d.ts +2 -0
  161. package/resources/mailboxes.d.ts.map +1 -0
  162. package/resources/mailboxes.js +6 -0
  163. package/resources/mailboxes.js.map +1 -0
  164. package/resources/mailboxes.mjs +3 -0
  165. package/resources/mailboxes.mjs.map +1 -0
  166. package/resources/messages/conversations.d.mts +18 -23
  167. package/resources/messages/conversations.d.mts.map +1 -1
  168. package/resources/messages/conversations.d.ts +18 -23
  169. package/resources/messages/conversations.d.ts.map +1 -1
  170. package/resources/messages/messages.d.mts +15 -20
  171. package/resources/messages/messages.d.mts.map +1 -1
  172. package/resources/messages/messages.d.ts +15 -20
  173. package/resources/messages/messages.d.ts.map +1 -1
  174. package/resources/messages/messages.js.map +1 -1
  175. package/resources/messages/messages.mjs.map +1 -1
  176. package/resources/models.d.mts +20 -5
  177. package/resources/models.d.mts.map +1 -1
  178. package/resources/models.d.ts +20 -5
  179. package/resources/models.d.ts.map +1 -1
  180. package/resources/models.js +1 -1
  181. package/resources/models.mjs +1 -1
  182. package/resources/numbers/index.d.mts +1 -1
  183. package/resources/numbers/index.d.mts.map +1 -1
  184. package/resources/numbers/index.d.ts +1 -1
  185. package/resources/numbers/index.d.ts.map +1 -1
  186. package/resources/numbers/index.js.map +1 -1
  187. package/resources/numbers/index.mjs.map +1 -1
  188. package/resources/numbers/messages.d.mts +15 -27
  189. package/resources/numbers/messages.d.mts.map +1 -1
  190. package/resources/numbers/messages.d.ts +15 -27
  191. package/resources/numbers/messages.d.ts.map +1 -1
  192. package/resources/numbers/messages.js.map +1 -1
  193. package/resources/numbers/messages.mjs.map +1 -1
  194. package/resources/numbers/numbers.d.mts +70 -22
  195. package/resources/numbers/numbers.d.mts.map +1 -1
  196. package/resources/numbers/numbers.d.ts +70 -22
  197. package/resources/numbers/numbers.d.ts.map +1 -1
  198. package/resources/numbers/numbers.js +17 -0
  199. package/resources/numbers/numbers.js.map +1 -1
  200. package/resources/numbers/numbers.mjs +17 -0
  201. package/resources/numbers/numbers.mjs.map +1 -1
  202. package/resources/store/apps.d.mts +2 -2
  203. package/resources/store/apps.d.mts.map +1 -1
  204. package/resources/store/apps.d.ts +2 -2
  205. package/resources/store/apps.d.ts.map +1 -1
  206. package/resources/workflows/events.d.mts +1 -0
  207. package/resources/workflows/events.d.mts.map +1 -1
  208. package/resources/workflows/events.d.ts +1 -0
  209. package/resources/workflows/events.d.ts.map +1 -1
  210. package/resources/workflows/executions.d.mts +21 -0
  211. package/resources/workflows/executions.d.mts.map +1 -1
  212. package/resources/workflows/executions.d.ts +21 -0
  213. package/resources/workflows/executions.d.ts.map +1 -1
  214. package/resources/workflows/flows/flows.d.mts +8 -0
  215. package/resources/workflows/flows/flows.d.mts.map +1 -1
  216. package/resources/workflows/flows/flows.d.ts +8 -0
  217. package/resources/workflows/flows/flows.d.ts.map +1 -1
  218. package/resources/workflows/flows/flows.js.map +1 -1
  219. package/resources/workflows/flows/flows.mjs.map +1 -1
  220. package/src/client.ts +74 -4
  221. package/src/core/streaming.ts +315 -0
  222. package/src/internal/decoders/line.ts +135 -0
  223. package/src/internal/parse.ts +14 -0
  224. package/src/internal/request-options.ts +2 -0
  225. package/src/resources/apps.ts +2 -2
  226. package/src/resources/assistant/assistant.ts +59 -0
  227. package/src/resources/assistant/conversations.ts +524 -0
  228. package/src/resources/assistant/index.ts +26 -0
  229. package/src/resources/assistant.ts +3 -0
  230. package/src/resources/devices/clipboard.ts +87 -0
  231. package/src/resources/devices/devices.ts +13 -0
  232. package/src/resources/devices/index.ts +6 -0
  233. package/src/resources/esims/esims.ts +63 -57
  234. package/src/resources/esims/index.ts +1 -0
  235. package/src/resources/esims/messages.ts +24 -30
  236. package/src/resources/files.ts +225 -0
  237. package/src/resources/index.ts +33 -1
  238. package/src/resources/mailboxes/index.ts +26 -0
  239. package/src/resources/mailboxes/mailboxes.ts +618 -0
  240. package/src/resources/mailboxes/messages.ts +134 -0
  241. package/src/resources/mailboxes.ts +3 -0
  242. package/src/resources/messages/conversations.ts +28 -34
  243. package/src/resources/messages/messages.ts +24 -30
  244. package/src/resources/models.ts +22 -7
  245. package/src/resources/numbers/index.ts +2 -0
  246. package/src/resources/numbers/messages.ts +24 -43
  247. package/src/resources/numbers/numbers.ts +97 -21
  248. package/src/resources/store/apps.ts +2 -2
  249. package/src/resources/workflows/events.ts +2 -0
  250. package/src/resources/workflows/executions.ts +27 -0
  251. package/src/resources/workflows/flows/flows.ts +16 -0
  252. package/src/streaming.ts +2 -0
  253. package/src/version.ts +1 -1
  254. package/streaming.d.mts +3 -0
  255. package/streaming.d.mts.map +1 -0
  256. package/streaming.d.ts +3 -0
  257. package/streaming.d.ts.map +1 -0
  258. package/streaming.js +6 -0
  259. package/streaming.js.map +1 -0
  260. package/streaming.mjs +3 -0
  261. package/streaming.mjs.map +1 -0
  262. package/version.d.mts +1 -1
  263. package/version.d.ts +1 -1
  264. package/version.js +1 -1
  265. package/version.mjs +1 -1
  266. package/resources/agents.d.mts +0 -27
  267. package/resources/agents.d.mts.map +0 -1
  268. package/resources/agents.d.ts +0 -27
  269. package/resources/agents.d.ts.map +0 -1
  270. package/resources/agents.js +0 -15
  271. package/resources/agents.js.map +0 -1
  272. package/resources/agents.mjs +0 -11
  273. package/resources/agents.mjs.map +0 -1
  274. package/src/resources/agents.ts +0 -42
@@ -0,0 +1,618 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as Shared from '../shared';
5
+ import * as MessagesAPI from './messages';
6
+ import {
7
+ MessageListParams,
8
+ MessageListResponse,
9
+ MessageRetrieveParams,
10
+ MessageRetrieveResponse,
11
+ Messages,
12
+ } from './messages';
13
+ import { APIPromise } from '../../core/api-promise';
14
+ import { RequestOptions } from '../../internal/request-options';
15
+ import { path } from '../../internal/utils/path';
16
+
17
+ export class Mailboxes extends APIResource {
18
+ messages: MessagesAPI.Messages = new MessagesAPI.Messages(this._client);
19
+
20
+ /**
21
+ * Reserves a permanently-allocated, individually-rented mailbox and starts an
22
+ * Autumn rental checkout. An optional localPart selects the full address local
23
+ * part; omitting it keeps the default random, non-guessable mx\_-prefixed address.
24
+ * The address is withheld until the first payment is confirmed. Idempotent on
25
+ * (owner, clientRequestId): same key + payload replays (200); a conflicting or
26
+ * already-held local part returns 409. 201 when the checkout URL is already
27
+ * persisted, otherwise 202 (poll GET for the URL).
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const mailbox = await client.mailboxes.create({
32
+ * clientRequestId: 'x',
33
+ * });
34
+ * ```
35
+ */
36
+ create(body: MailboxCreateParams, options?: RequestOptions): APIPromise<MailboxCreateResponse> {
37
+ return this._client.post('/mailboxes', { body, ...options });
38
+ }
39
+
40
+ /**
41
+ * Get a mailbox
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * const mailbox = await client.mailboxes.retrieve(
46
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
47
+ * );
48
+ * ```
49
+ */
50
+ retrieve(mailboxID: string, options?: RequestOptions): APIPromise<MailboxRetrieveResponse> {
51
+ return this._client.get(path`/mailboxes/${mailboxID}`, options);
52
+ }
53
+
54
+ /**
55
+ * Updates the label of a mailbox.
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * const mailbox = await client.mailboxes.update(
60
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
61
+ * { label: 'label' },
62
+ * );
63
+ * ```
64
+ */
65
+ update(
66
+ mailboxID: string,
67
+ body: MailboxUpdateParams,
68
+ options?: RequestOptions,
69
+ ): APIPromise<MailboxUpdateResponse> {
70
+ return this._client.patch(path`/mailboxes/${mailboxID}`, { body, ...options });
71
+ }
72
+
73
+ /**
74
+ * Lists the caller-owned mailboxes with page-based pagination.
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * const mailboxes = await client.mailboxes.list();
79
+ * ```
80
+ */
81
+ list(
82
+ query: MailboxListParams | null | undefined = {},
83
+ options?: RequestOptions,
84
+ ): APIPromise<MailboxListResponse> {
85
+ return this._client.get('/mailboxes', { query, ...options });
86
+ }
87
+
88
+ /**
89
+ * For paid rent, schedules end-of-cycle cancellation. For an included generation,
90
+ * archives immediately and releases its package seat. This never deletes the
91
+ * mailbox, its address, or its messages — the address is permanently reserved.
92
+ * Idempotent.
93
+ *
94
+ * @example
95
+ * ```ts
96
+ * const mailbox = await client.mailboxes.delete(
97
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
98
+ * );
99
+ * ```
100
+ */
101
+ delete(mailboxID: string, options?: RequestOptions): APIPromise<MailboxDeleteResponse> {
102
+ return this._client.delete(path`/mailboxes/${mailboxID}`, options);
103
+ }
104
+
105
+ /**
106
+ * Returns the authoritative number of package-funded mailbox claims currently
107
+ * available after local reservations.
108
+ *
109
+ * @example
110
+ * ```ts
111
+ * const response = await client.mailboxes.capacity();
112
+ * ```
113
+ */
114
+ capacity(options?: RequestOptions): APIPromise<MailboxCapacityResponse> {
115
+ return this._client.get('/mailboxes/capacity', options);
116
+ }
117
+
118
+ /**
119
+ * Returns the highest-confidence, most recent OTP for the mailbox, restricted to
120
+ * messages of completed/active paid intervals. Does not wait server-side (SDKs
121
+ * poll). 200 with the best code, 204 when none matches.
122
+ *
123
+ * @example
124
+ * ```ts
125
+ * const response = await client.mailboxes.otp(
126
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
127
+ * );
128
+ * ```
129
+ */
130
+ otp(
131
+ mailboxID: string,
132
+ query: MailboxOtpParams | null | undefined = {},
133
+ options?: RequestOptions,
134
+ ): APIPromise<MailboxOtpResponse> {
135
+ return this._client.get(path`/mailboxes/${mailboxID}/otp`, { query, ...options });
136
+ }
137
+
138
+ /**
139
+ * Starts a new generation on an archived mailbox, reusing the same permanent
140
+ * address. Uses included capacity first unless paid rent is requested.
141
+ *
142
+ * @example
143
+ * ```ts
144
+ * const response = await client.mailboxes.restart(
145
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
146
+ * );
147
+ * ```
148
+ */
149
+ restart(
150
+ mailboxID: string,
151
+ body: MailboxRestartParams | null | undefined = {},
152
+ options?: RequestOptions,
153
+ ): APIPromise<MailboxRestartResponse> {
154
+ return this._client.post(path`/mailboxes/${mailboxID}/restart`, { body, ...options });
155
+ }
156
+
157
+ /**
158
+ * Retracts a scheduled end-of-cycle cancellation for the current generation. Only
159
+ * valid while cancellation is pending.
160
+ *
161
+ * @example
162
+ * ```ts
163
+ * const response = await client.mailboxes.uncancel(
164
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
165
+ * );
166
+ * ```
167
+ */
168
+ uncancel(mailboxID: string, options?: RequestOptions): APIPromise<MailboxUncancelResponse> {
169
+ return this._client.post(path`/mailboxes/${mailboxID}/uncancel`, options);
170
+ }
171
+ }
172
+
173
+ export interface MailboxCreateResponse {
174
+ data: MailboxCreateResponse.Data;
175
+ }
176
+
177
+ export namespace MailboxCreateResponse {
178
+ export interface Data {
179
+ id: string;
180
+
181
+ address: string | null;
182
+
183
+ billingMode: 'rent' | 'included';
184
+
185
+ cancelAtPeriodEnd: boolean;
186
+
187
+ checkoutExpiresAt: string | null;
188
+
189
+ checkoutUrl: string | null;
190
+
191
+ createdAt: string;
192
+
193
+ currentPeriodEnd: string | null;
194
+
195
+ inboundMessages: Data.InboundMessages;
196
+
197
+ label: string | null;
198
+
199
+ status:
200
+ | 'provisioning'
201
+ | 'awaiting_payment'
202
+ | 'active'
203
+ | 'cancel_scheduled'
204
+ | 'archived'
205
+ | 'billing_error';
206
+ }
207
+
208
+ export namespace Data {
209
+ export interface InboundMessages {
210
+ exhausted: boolean;
211
+
212
+ included: number;
213
+
214
+ resetsAt: string | null;
215
+
216
+ used: number;
217
+ }
218
+ }
219
+ }
220
+
221
+ export interface MailboxRetrieveResponse {
222
+ data: MailboxRetrieveResponse.Data;
223
+ }
224
+
225
+ export namespace MailboxRetrieveResponse {
226
+ export interface Data {
227
+ id: string;
228
+
229
+ address: string | null;
230
+
231
+ billingMode: 'rent' | 'included';
232
+
233
+ cancelAtPeriodEnd: boolean;
234
+
235
+ checkoutExpiresAt: string | null;
236
+
237
+ checkoutUrl: string | null;
238
+
239
+ createdAt: string;
240
+
241
+ currentPeriodEnd: string | null;
242
+
243
+ inboundMessages: Data.InboundMessages;
244
+
245
+ label: string | null;
246
+
247
+ status:
248
+ | 'provisioning'
249
+ | 'awaiting_payment'
250
+ | 'active'
251
+ | 'cancel_scheduled'
252
+ | 'archived'
253
+ | 'billing_error';
254
+ }
255
+
256
+ export namespace Data {
257
+ export interface InboundMessages {
258
+ exhausted: boolean;
259
+
260
+ included: number;
261
+
262
+ resetsAt: string | null;
263
+
264
+ used: number;
265
+ }
266
+ }
267
+ }
268
+
269
+ export interface MailboxUpdateResponse {
270
+ data: MailboxUpdateResponse.Data;
271
+ }
272
+
273
+ export namespace MailboxUpdateResponse {
274
+ export interface Data {
275
+ id: string;
276
+
277
+ address: string | null;
278
+
279
+ billingMode: 'rent' | 'included';
280
+
281
+ cancelAtPeriodEnd: boolean;
282
+
283
+ checkoutExpiresAt: string | null;
284
+
285
+ checkoutUrl: string | null;
286
+
287
+ createdAt: string;
288
+
289
+ currentPeriodEnd: string | null;
290
+
291
+ inboundMessages: Data.InboundMessages;
292
+
293
+ label: string | null;
294
+
295
+ status:
296
+ | 'provisioning'
297
+ | 'awaiting_payment'
298
+ | 'active'
299
+ | 'cancel_scheduled'
300
+ | 'archived'
301
+ | 'billing_error';
302
+ }
303
+
304
+ export namespace Data {
305
+ export interface InboundMessages {
306
+ exhausted: boolean;
307
+
308
+ included: number;
309
+
310
+ resetsAt: string | null;
311
+
312
+ used: number;
313
+ }
314
+ }
315
+ }
316
+
317
+ export interface MailboxListResponse {
318
+ items: Array<MailboxListResponse.Item>;
319
+
320
+ pagination: Shared.Pagination;
321
+ }
322
+
323
+ export namespace MailboxListResponse {
324
+ export interface Item {
325
+ id: string;
326
+
327
+ address: string | null;
328
+
329
+ billingMode: 'rent' | 'included';
330
+
331
+ cancelAtPeriodEnd: boolean;
332
+
333
+ checkoutExpiresAt: string | null;
334
+
335
+ checkoutUrl: string | null;
336
+
337
+ createdAt: string;
338
+
339
+ currentPeriodEnd: string | null;
340
+
341
+ inboundMessages: Item.InboundMessages;
342
+
343
+ label: string | null;
344
+
345
+ status:
346
+ | 'provisioning'
347
+ | 'awaiting_payment'
348
+ | 'active'
349
+ | 'cancel_scheduled'
350
+ | 'archived'
351
+ | 'billing_error';
352
+ }
353
+
354
+ export namespace Item {
355
+ export interface InboundMessages {
356
+ exhausted: boolean;
357
+
358
+ included: number;
359
+
360
+ resetsAt: string | null;
361
+
362
+ used: number;
363
+ }
364
+ }
365
+ }
366
+
367
+ export interface MailboxDeleteResponse {
368
+ data: MailboxDeleteResponse.Data;
369
+ }
370
+
371
+ export namespace MailboxDeleteResponse {
372
+ export interface Data {
373
+ id: string;
374
+
375
+ address: string | null;
376
+
377
+ billingMode: 'rent' | 'included';
378
+
379
+ cancelAtPeriodEnd: boolean;
380
+
381
+ checkoutExpiresAt: string | null;
382
+
383
+ checkoutUrl: string | null;
384
+
385
+ createdAt: string;
386
+
387
+ currentPeriodEnd: string | null;
388
+
389
+ inboundMessages: Data.InboundMessages;
390
+
391
+ label: string | null;
392
+
393
+ status:
394
+ | 'provisioning'
395
+ | 'awaiting_payment'
396
+ | 'active'
397
+ | 'cancel_scheduled'
398
+ | 'archived'
399
+ | 'billing_error';
400
+ }
401
+
402
+ export namespace Data {
403
+ export interface InboundMessages {
404
+ exhausted: boolean;
405
+
406
+ included: number;
407
+
408
+ resetsAt: string | null;
409
+
410
+ used: number;
411
+ }
412
+ }
413
+ }
414
+
415
+ export interface MailboxCapacityResponse {
416
+ data: MailboxCapacityResponse.Data;
417
+ }
418
+
419
+ export namespace MailboxCapacityResponse {
420
+ export interface Data {
421
+ includedRemaining: number;
422
+ }
423
+ }
424
+
425
+ export interface MailboxOtpResponse {
426
+ data: MailboxOtpResponse.Data;
427
+ }
428
+
429
+ export namespace MailboxOtpResponse {
430
+ export interface Data {
431
+ /**
432
+ * String to preserve leading zeros
433
+ */
434
+ code: string;
435
+
436
+ confidence: 'high' | 'medium' | 'low';
437
+
438
+ messageId: string;
439
+
440
+ receivedAt: string;
441
+
442
+ sender: string | null;
443
+
444
+ subject: string | null;
445
+ }
446
+ }
447
+
448
+ export interface MailboxRestartResponse {
449
+ data: MailboxRestartResponse.Data;
450
+ }
451
+
452
+ export namespace MailboxRestartResponse {
453
+ export interface Data {
454
+ id: string;
455
+
456
+ address: string | null;
457
+
458
+ billingMode: 'rent' | 'included';
459
+
460
+ cancelAtPeriodEnd: boolean;
461
+
462
+ checkoutExpiresAt: string | null;
463
+
464
+ checkoutUrl: string | null;
465
+
466
+ createdAt: string;
467
+
468
+ currentPeriodEnd: string | null;
469
+
470
+ inboundMessages: Data.InboundMessages;
471
+
472
+ label: string | null;
473
+
474
+ status:
475
+ | 'provisioning'
476
+ | 'awaiting_payment'
477
+ | 'active'
478
+ | 'cancel_scheduled'
479
+ | 'archived'
480
+ | 'billing_error';
481
+ }
482
+
483
+ export namespace Data {
484
+ export interface InboundMessages {
485
+ exhausted: boolean;
486
+
487
+ included: number;
488
+
489
+ resetsAt: string | null;
490
+
491
+ used: number;
492
+ }
493
+ }
494
+ }
495
+
496
+ export interface MailboxUncancelResponse {
497
+ data: MailboxUncancelResponse.Data;
498
+ }
499
+
500
+ export namespace MailboxUncancelResponse {
501
+ export interface Data {
502
+ id: string;
503
+
504
+ address: string | null;
505
+
506
+ billingMode: 'rent' | 'included';
507
+
508
+ cancelAtPeriodEnd: boolean;
509
+
510
+ checkoutExpiresAt: string | null;
511
+
512
+ checkoutUrl: string | null;
513
+
514
+ createdAt: string;
515
+
516
+ currentPeriodEnd: string | null;
517
+
518
+ inboundMessages: Data.InboundMessages;
519
+
520
+ label: string | null;
521
+
522
+ status:
523
+ | 'provisioning'
524
+ | 'awaiting_payment'
525
+ | 'active'
526
+ | 'cancel_scheduled'
527
+ | 'archived'
528
+ | 'billing_error';
529
+ }
530
+
531
+ export namespace Data {
532
+ export interface InboundMessages {
533
+ exhausted: boolean;
534
+
535
+ included: number;
536
+
537
+ resetsAt: string | null;
538
+
539
+ used: number;
540
+ }
541
+ }
542
+ }
543
+
544
+ export interface MailboxCreateParams {
545
+ clientRequestId: string;
546
+
547
+ /**
548
+ * Funding preference. Omit or use included for included-first activation; rent
549
+ * always preserves package capacity and starts paid checkout.
550
+ */
551
+ billingPreference?: 'included' | 'rent';
552
+
553
+ label?: string;
554
+
555
+ /**
556
+ * Optional full mailbox local part (the address before "@"). Trimmed and
557
+ * lowercased before validation. Omit for a random, non-guessable mx\_-prefixed
558
+ * address.
559
+ */
560
+ localPart?: string;
561
+ }
562
+
563
+ export interface MailboxUpdateParams {
564
+ label: string | null;
565
+ }
566
+
567
+ export interface MailboxListParams {
568
+ page?: number;
569
+
570
+ pageSize?: number;
571
+ }
572
+
573
+ export interface MailboxOtpParams {
574
+ after?: string;
575
+
576
+ maxLength?: number;
577
+
578
+ minLength?: number;
579
+
580
+ sender?: string;
581
+ }
582
+
583
+ export interface MailboxRestartParams {
584
+ /**
585
+ * Funding preference. Omit or use included for included-first activation; rent
586
+ * always preserves package capacity and starts paid checkout.
587
+ */
588
+ billingPreference?: 'included' | 'rent';
589
+ }
590
+
591
+ Mailboxes.Messages = Messages;
592
+
593
+ export declare namespace Mailboxes {
594
+ export {
595
+ type MailboxCreateResponse as MailboxCreateResponse,
596
+ type MailboxRetrieveResponse as MailboxRetrieveResponse,
597
+ type MailboxUpdateResponse as MailboxUpdateResponse,
598
+ type MailboxListResponse as MailboxListResponse,
599
+ type MailboxDeleteResponse as MailboxDeleteResponse,
600
+ type MailboxCapacityResponse as MailboxCapacityResponse,
601
+ type MailboxOtpResponse as MailboxOtpResponse,
602
+ type MailboxRestartResponse as MailboxRestartResponse,
603
+ type MailboxUncancelResponse as MailboxUncancelResponse,
604
+ type MailboxCreateParams as MailboxCreateParams,
605
+ type MailboxUpdateParams as MailboxUpdateParams,
606
+ type MailboxListParams as MailboxListParams,
607
+ type MailboxOtpParams as MailboxOtpParams,
608
+ type MailboxRestartParams as MailboxRestartParams,
609
+ };
610
+
611
+ export {
612
+ Messages as Messages,
613
+ type MessageRetrieveResponse as MessageRetrieveResponse,
614
+ type MessageListResponse as MessageListResponse,
615
+ type MessageRetrieveParams as MessageRetrieveParams,
616
+ type MessageListParams as MessageListParams,
617
+ };
618
+ }