@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,366 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as Shared from "../shared.js";
3
+ import * as MessagesAPI from "./messages.js";
4
+ import { MessageListParams, MessageListResponse, MessageRetrieveParams, MessageRetrieveResponse, Messages } from "./messages.js";
5
+ import { APIPromise } from "../../core/api-promise.js";
6
+ import { RequestOptions } from "../../internal/request-options.js";
7
+ export declare class Mailboxes extends APIResource {
8
+ messages: MessagesAPI.Messages;
9
+ /**
10
+ * Reserves a permanently-allocated, individually-rented mailbox and starts an
11
+ * Autumn rental checkout. An optional localPart selects the full address local
12
+ * part; omitting it keeps the default random, non-guessable mx\_-prefixed address.
13
+ * The address is withheld until the first payment is confirmed. Idempotent on
14
+ * (owner, clientRequestId): same key + payload replays (200); a conflicting or
15
+ * already-held local part returns 409. 201 when the checkout URL is already
16
+ * persisted, otherwise 202 (poll GET for the URL).
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const mailbox = await client.mailboxes.create({
21
+ * clientRequestId: 'x',
22
+ * });
23
+ * ```
24
+ */
25
+ create(body: MailboxCreateParams, options?: RequestOptions): APIPromise<MailboxCreateResponse>;
26
+ /**
27
+ * Get a mailbox
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const mailbox = await client.mailboxes.retrieve(
32
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
33
+ * );
34
+ * ```
35
+ */
36
+ retrieve(mailboxID: string, options?: RequestOptions): APIPromise<MailboxRetrieveResponse>;
37
+ /**
38
+ * Updates the label of a mailbox.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const mailbox = await client.mailboxes.update(
43
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
44
+ * { label: 'label' },
45
+ * );
46
+ * ```
47
+ */
48
+ update(mailboxID: string, body: MailboxUpdateParams, options?: RequestOptions): APIPromise<MailboxUpdateResponse>;
49
+ /**
50
+ * Lists the caller-owned mailboxes with page-based pagination.
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * const mailboxes = await client.mailboxes.list();
55
+ * ```
56
+ */
57
+ list(query?: MailboxListParams | null | undefined, options?: RequestOptions): APIPromise<MailboxListResponse>;
58
+ /**
59
+ * For paid rent, schedules end-of-cycle cancellation. For an included generation,
60
+ * archives immediately and releases its package seat. This never deletes the
61
+ * mailbox, its address, or its messages — the address is permanently reserved.
62
+ * Idempotent.
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * const mailbox = await client.mailboxes.delete(
67
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
68
+ * );
69
+ * ```
70
+ */
71
+ delete(mailboxID: string, options?: RequestOptions): APIPromise<MailboxDeleteResponse>;
72
+ /**
73
+ * Returns the authoritative number of package-funded mailbox claims currently
74
+ * available after local reservations.
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * const response = await client.mailboxes.capacity();
79
+ * ```
80
+ */
81
+ capacity(options?: RequestOptions): APIPromise<MailboxCapacityResponse>;
82
+ /**
83
+ * Returns the highest-confidence, most recent OTP for the mailbox, restricted to
84
+ * messages of completed/active paid intervals. Does not wait server-side (SDKs
85
+ * poll). 200 with the best code, 204 when none matches.
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * const response = await client.mailboxes.otp(
90
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
91
+ * );
92
+ * ```
93
+ */
94
+ otp(mailboxID: string, query?: MailboxOtpParams | null | undefined, options?: RequestOptions): APIPromise<MailboxOtpResponse>;
95
+ /**
96
+ * Starts a new generation on an archived mailbox, reusing the same permanent
97
+ * address. Uses included capacity first unless paid rent is requested.
98
+ *
99
+ * @example
100
+ * ```ts
101
+ * const response = await client.mailboxes.restart(
102
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
103
+ * );
104
+ * ```
105
+ */
106
+ restart(mailboxID: string, body?: MailboxRestartParams | null | undefined, options?: RequestOptions): APIPromise<MailboxRestartResponse>;
107
+ /**
108
+ * Retracts a scheduled end-of-cycle cancellation for the current generation. Only
109
+ * valid while cancellation is pending.
110
+ *
111
+ * @example
112
+ * ```ts
113
+ * const response = await client.mailboxes.uncancel(
114
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
115
+ * );
116
+ * ```
117
+ */
118
+ uncancel(mailboxID: string, options?: RequestOptions): APIPromise<MailboxUncancelResponse>;
119
+ }
120
+ export interface MailboxCreateResponse {
121
+ data: MailboxCreateResponse.Data;
122
+ }
123
+ export declare namespace MailboxCreateResponse {
124
+ interface Data {
125
+ id: string;
126
+ address: string | null;
127
+ billingMode: 'rent' | 'included';
128
+ cancelAtPeriodEnd: boolean;
129
+ checkoutExpiresAt: string | null;
130
+ checkoutUrl: string | null;
131
+ createdAt: string;
132
+ currentPeriodEnd: string | null;
133
+ inboundMessages: Data.InboundMessages;
134
+ label: string | null;
135
+ status: 'provisioning' | 'awaiting_payment' | 'active' | 'cancel_scheduled' | 'archived' | 'billing_error';
136
+ }
137
+ namespace Data {
138
+ interface InboundMessages {
139
+ exhausted: boolean;
140
+ included: number;
141
+ resetsAt: string | null;
142
+ used: number;
143
+ }
144
+ }
145
+ }
146
+ export interface MailboxRetrieveResponse {
147
+ data: MailboxRetrieveResponse.Data;
148
+ }
149
+ export declare namespace MailboxRetrieveResponse {
150
+ interface Data {
151
+ id: string;
152
+ address: string | null;
153
+ billingMode: 'rent' | 'included';
154
+ cancelAtPeriodEnd: boolean;
155
+ checkoutExpiresAt: string | null;
156
+ checkoutUrl: string | null;
157
+ createdAt: string;
158
+ currentPeriodEnd: string | null;
159
+ inboundMessages: Data.InboundMessages;
160
+ label: string | null;
161
+ status: 'provisioning' | 'awaiting_payment' | 'active' | 'cancel_scheduled' | 'archived' | 'billing_error';
162
+ }
163
+ namespace Data {
164
+ interface InboundMessages {
165
+ exhausted: boolean;
166
+ included: number;
167
+ resetsAt: string | null;
168
+ used: number;
169
+ }
170
+ }
171
+ }
172
+ export interface MailboxUpdateResponse {
173
+ data: MailboxUpdateResponse.Data;
174
+ }
175
+ export declare namespace MailboxUpdateResponse {
176
+ interface Data {
177
+ id: string;
178
+ address: string | null;
179
+ billingMode: 'rent' | 'included';
180
+ cancelAtPeriodEnd: boolean;
181
+ checkoutExpiresAt: string | null;
182
+ checkoutUrl: string | null;
183
+ createdAt: string;
184
+ currentPeriodEnd: string | null;
185
+ inboundMessages: Data.InboundMessages;
186
+ label: string | null;
187
+ status: 'provisioning' | 'awaiting_payment' | 'active' | 'cancel_scheduled' | 'archived' | 'billing_error';
188
+ }
189
+ namespace Data {
190
+ interface InboundMessages {
191
+ exhausted: boolean;
192
+ included: number;
193
+ resetsAt: string | null;
194
+ used: number;
195
+ }
196
+ }
197
+ }
198
+ export interface MailboxListResponse {
199
+ items: Array<MailboxListResponse.Item>;
200
+ pagination: Shared.Pagination;
201
+ }
202
+ export declare namespace MailboxListResponse {
203
+ interface Item {
204
+ id: string;
205
+ address: string | null;
206
+ billingMode: 'rent' | 'included';
207
+ cancelAtPeriodEnd: boolean;
208
+ checkoutExpiresAt: string | null;
209
+ checkoutUrl: string | null;
210
+ createdAt: string;
211
+ currentPeriodEnd: string | null;
212
+ inboundMessages: Item.InboundMessages;
213
+ label: string | null;
214
+ status: 'provisioning' | 'awaiting_payment' | 'active' | 'cancel_scheduled' | 'archived' | 'billing_error';
215
+ }
216
+ namespace Item {
217
+ interface InboundMessages {
218
+ exhausted: boolean;
219
+ included: number;
220
+ resetsAt: string | null;
221
+ used: number;
222
+ }
223
+ }
224
+ }
225
+ export interface MailboxDeleteResponse {
226
+ data: MailboxDeleteResponse.Data;
227
+ }
228
+ export declare namespace MailboxDeleteResponse {
229
+ interface Data {
230
+ id: string;
231
+ address: string | null;
232
+ billingMode: 'rent' | 'included';
233
+ cancelAtPeriodEnd: boolean;
234
+ checkoutExpiresAt: string | null;
235
+ checkoutUrl: string | null;
236
+ createdAt: string;
237
+ currentPeriodEnd: string | null;
238
+ inboundMessages: Data.InboundMessages;
239
+ label: string | null;
240
+ status: 'provisioning' | 'awaiting_payment' | 'active' | 'cancel_scheduled' | 'archived' | 'billing_error';
241
+ }
242
+ namespace Data {
243
+ interface InboundMessages {
244
+ exhausted: boolean;
245
+ included: number;
246
+ resetsAt: string | null;
247
+ used: number;
248
+ }
249
+ }
250
+ }
251
+ export interface MailboxCapacityResponse {
252
+ data: MailboxCapacityResponse.Data;
253
+ }
254
+ export declare namespace MailboxCapacityResponse {
255
+ interface Data {
256
+ includedRemaining: number;
257
+ }
258
+ }
259
+ export interface MailboxOtpResponse {
260
+ data: MailboxOtpResponse.Data;
261
+ }
262
+ export declare namespace MailboxOtpResponse {
263
+ interface Data {
264
+ /**
265
+ * String to preserve leading zeros
266
+ */
267
+ code: string;
268
+ confidence: 'high' | 'medium' | 'low';
269
+ messageId: string;
270
+ receivedAt: string;
271
+ sender: string | null;
272
+ subject: string | null;
273
+ }
274
+ }
275
+ export interface MailboxRestartResponse {
276
+ data: MailboxRestartResponse.Data;
277
+ }
278
+ export declare namespace MailboxRestartResponse {
279
+ interface Data {
280
+ id: string;
281
+ address: string | null;
282
+ billingMode: 'rent' | 'included';
283
+ cancelAtPeriodEnd: boolean;
284
+ checkoutExpiresAt: string | null;
285
+ checkoutUrl: string | null;
286
+ createdAt: string;
287
+ currentPeriodEnd: string | null;
288
+ inboundMessages: Data.InboundMessages;
289
+ label: string | null;
290
+ status: 'provisioning' | 'awaiting_payment' | 'active' | 'cancel_scheduled' | 'archived' | 'billing_error';
291
+ }
292
+ namespace Data {
293
+ interface InboundMessages {
294
+ exhausted: boolean;
295
+ included: number;
296
+ resetsAt: string | null;
297
+ used: number;
298
+ }
299
+ }
300
+ }
301
+ export interface MailboxUncancelResponse {
302
+ data: MailboxUncancelResponse.Data;
303
+ }
304
+ export declare namespace MailboxUncancelResponse {
305
+ interface Data {
306
+ id: string;
307
+ address: string | null;
308
+ billingMode: 'rent' | 'included';
309
+ cancelAtPeriodEnd: boolean;
310
+ checkoutExpiresAt: string | null;
311
+ checkoutUrl: string | null;
312
+ createdAt: string;
313
+ currentPeriodEnd: string | null;
314
+ inboundMessages: Data.InboundMessages;
315
+ label: string | null;
316
+ status: 'provisioning' | 'awaiting_payment' | 'active' | 'cancel_scheduled' | 'archived' | 'billing_error';
317
+ }
318
+ namespace Data {
319
+ interface InboundMessages {
320
+ exhausted: boolean;
321
+ included: number;
322
+ resetsAt: string | null;
323
+ used: number;
324
+ }
325
+ }
326
+ }
327
+ export interface MailboxCreateParams {
328
+ clientRequestId: string;
329
+ /**
330
+ * Funding preference. Omit or use included for included-first activation; rent
331
+ * always preserves package capacity and starts paid checkout.
332
+ */
333
+ billingPreference?: 'included' | 'rent';
334
+ label?: string;
335
+ /**
336
+ * Optional full mailbox local part (the address before "@"). Trimmed and
337
+ * lowercased before validation. Omit for a random, non-guessable mx\_-prefixed
338
+ * address.
339
+ */
340
+ localPart?: string;
341
+ }
342
+ export interface MailboxUpdateParams {
343
+ label: string | null;
344
+ }
345
+ export interface MailboxListParams {
346
+ page?: number;
347
+ pageSize?: number;
348
+ }
349
+ export interface MailboxOtpParams {
350
+ after?: string;
351
+ maxLength?: number;
352
+ minLength?: number;
353
+ sender?: string;
354
+ }
355
+ export interface MailboxRestartParams {
356
+ /**
357
+ * Funding preference. Omit or use included for included-first activation; rent
358
+ * always preserves package capacity and starts paid checkout.
359
+ */
360
+ billingPreference?: 'included' | 'rent';
361
+ }
362
+ export declare namespace Mailboxes {
363
+ export { type MailboxCreateResponse as MailboxCreateResponse, type MailboxRetrieveResponse as MailboxRetrieveResponse, type MailboxUpdateResponse as MailboxUpdateResponse, type MailboxListResponse as MailboxListResponse, type MailboxDeleteResponse as MailboxDeleteResponse, type MailboxCapacityResponse as MailboxCapacityResponse, type MailboxOtpResponse as MailboxOtpResponse, type MailboxRestartResponse as MailboxRestartResponse, type MailboxUncancelResponse as MailboxUncancelResponse, type MailboxCreateParams as MailboxCreateParams, type MailboxUpdateParams as MailboxUpdateParams, type MailboxListParams as MailboxListParams, type MailboxOtpParams as MailboxOtpParams, type MailboxRestartParams as MailboxRestartParams, };
364
+ export { Messages as Messages, type MessageRetrieveResponse as MessageRetrieveResponse, type MessageListResponse as MessageListResponse, type MessageRetrieveParams as MessageRetrieveParams, type MessageListParams as MessageListParams, };
365
+ }
366
+ //# sourceMappingURL=mailboxes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mailboxes.d.ts","sourceRoot":"","sources":["../../src/resources/mailboxes/mailboxes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,MAAM,qBAAkB;AACpC,OAAO,KAAK,WAAW,sBAAmB;AAC1C,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,QAAQ,EACT,sBAAmB;AACpB,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE,qBAAa,SAAU,SAAQ,WAAW;IACxC,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAA0C;IAExE;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;I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oB,IAAI,oBAAoB,GAClD,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Mailboxes = void 0;
5
+ const tslib_1 = require("../../internal/tslib.js");
6
+ const resource_1 = require("../../core/resource.js");
7
+ const MessagesAPI = tslib_1.__importStar(require("./messages.js"));
8
+ const messages_1 = require("./messages.js");
9
+ const path_1 = require("../../internal/utils/path.js");
10
+ class Mailboxes extends resource_1.APIResource {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.messages = new MessagesAPI.Messages(this._client);
14
+ }
15
+ /**
16
+ * Reserves a permanently-allocated, individually-rented mailbox and starts an
17
+ * Autumn rental checkout. An optional localPart selects the full address local
18
+ * part; omitting it keeps the default random, non-guessable mx\_-prefixed address.
19
+ * The address is withheld until the first payment is confirmed. Idempotent on
20
+ * (owner, clientRequestId): same key + payload replays (200); a conflicting or
21
+ * already-held local part returns 409. 201 when the checkout URL is already
22
+ * persisted, otherwise 202 (poll GET for the URL).
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const mailbox = await client.mailboxes.create({
27
+ * clientRequestId: 'x',
28
+ * });
29
+ * ```
30
+ */
31
+ create(body, options) {
32
+ return this._client.post('/mailboxes', { body, ...options });
33
+ }
34
+ /**
35
+ * Get a mailbox
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const mailbox = await client.mailboxes.retrieve(
40
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
41
+ * );
42
+ * ```
43
+ */
44
+ retrieve(mailboxID, options) {
45
+ return this._client.get((0, path_1.path) `/mailboxes/${mailboxID}`, options);
46
+ }
47
+ /**
48
+ * Updates the label of a mailbox.
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * const mailbox = await client.mailboxes.update(
53
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
54
+ * { label: 'label' },
55
+ * );
56
+ * ```
57
+ */
58
+ update(mailboxID, body, options) {
59
+ return this._client.patch((0, path_1.path) `/mailboxes/${mailboxID}`, { body, ...options });
60
+ }
61
+ /**
62
+ * Lists the caller-owned mailboxes with page-based pagination.
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * const mailboxes = await client.mailboxes.list();
67
+ * ```
68
+ */
69
+ list(query = {}, options) {
70
+ return this._client.get('/mailboxes', { query, ...options });
71
+ }
72
+ /**
73
+ * For paid rent, schedules end-of-cycle cancellation. For an included generation,
74
+ * archives immediately and releases its package seat. This never deletes the
75
+ * mailbox, its address, or its messages — the address is permanently reserved.
76
+ * Idempotent.
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * const mailbox = await client.mailboxes.delete(
81
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
82
+ * );
83
+ * ```
84
+ */
85
+ delete(mailboxID, options) {
86
+ return this._client.delete((0, path_1.path) `/mailboxes/${mailboxID}`, options);
87
+ }
88
+ /**
89
+ * Returns the authoritative number of package-funded mailbox claims currently
90
+ * available after local reservations.
91
+ *
92
+ * @example
93
+ * ```ts
94
+ * const response = await client.mailboxes.capacity();
95
+ * ```
96
+ */
97
+ capacity(options) {
98
+ return this._client.get('/mailboxes/capacity', options);
99
+ }
100
+ /**
101
+ * Returns the highest-confidence, most recent OTP for the mailbox, restricted to
102
+ * messages of completed/active paid intervals. Does not wait server-side (SDKs
103
+ * poll). 200 with the best code, 204 when none matches.
104
+ *
105
+ * @example
106
+ * ```ts
107
+ * const response = await client.mailboxes.otp(
108
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
109
+ * );
110
+ * ```
111
+ */
112
+ otp(mailboxID, query = {}, options) {
113
+ return this._client.get((0, path_1.path) `/mailboxes/${mailboxID}/otp`, { query, ...options });
114
+ }
115
+ /**
116
+ * Starts a new generation on an archived mailbox, reusing the same permanent
117
+ * address. Uses included capacity first unless paid rent is requested.
118
+ *
119
+ * @example
120
+ * ```ts
121
+ * const response = await client.mailboxes.restart(
122
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
123
+ * );
124
+ * ```
125
+ */
126
+ restart(mailboxID, body = {}, options) {
127
+ return this._client.post((0, path_1.path) `/mailboxes/${mailboxID}/restart`, { body, ...options });
128
+ }
129
+ /**
130
+ * Retracts a scheduled end-of-cycle cancellation for the current generation. Only
131
+ * valid while cancellation is pending.
132
+ *
133
+ * @example
134
+ * ```ts
135
+ * const response = await client.mailboxes.uncancel(
136
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
137
+ * );
138
+ * ```
139
+ */
140
+ uncancel(mailboxID, options) {
141
+ return this._client.post((0, path_1.path) `/mailboxes/${mailboxID}/uncancel`, options);
142
+ }
143
+ }
144
+ exports.Mailboxes = Mailboxes;
145
+ Mailboxes.Messages = messages_1.Messages;
146
+ //# sourceMappingURL=mailboxes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mailboxes.js","sourceRoot":"","sources":["../../src/resources/mailboxes/mailboxes.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAElD,mEAA0C;AAC1C,4CAMoB;AAGpB,uDAAiD;AAEjD,MAAa,SAAU,SAAQ,sBAAW;IAA1C;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAyJ1E,CAAC;IAvJC;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,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wB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,cAAc,SAAS,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxF,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAiB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,cAAc,SAAS,WAAW,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;CACF;AA1JD,8BA0JC;AAoaD,SAAS,CAAC,QAAQ,GAAG,mBAAQ,CAAC"}
@@ -0,0 +1,141 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import * as MessagesAPI from "./messages.mjs";
4
+ import { Messages, } from "./messages.mjs";
5
+ import { path } from "../../internal/utils/path.mjs";
6
+ export class Mailboxes extends APIResource {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.messages = new MessagesAPI.Messages(this._client);
10
+ }
11
+ /**
12
+ * Reserves a permanently-allocated, individually-rented mailbox and starts an
13
+ * Autumn rental checkout. An optional localPart selects the full address local
14
+ * part; omitting it keeps the default random, non-guessable mx\_-prefixed address.
15
+ * The address is withheld until the first payment is confirmed. Idempotent on
16
+ * (owner, clientRequestId): same key + payload replays (200); a conflicting or
17
+ * already-held local part returns 409. 201 when the checkout URL is already
18
+ * persisted, otherwise 202 (poll GET for the URL).
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const mailbox = await client.mailboxes.create({
23
+ * clientRequestId: 'x',
24
+ * });
25
+ * ```
26
+ */
27
+ create(body, options) {
28
+ return this._client.post('/mailboxes', { body, ...options });
29
+ }
30
+ /**
31
+ * Get a mailbox
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const mailbox = await client.mailboxes.retrieve(
36
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
37
+ * );
38
+ * ```
39
+ */
40
+ retrieve(mailboxID, options) {
41
+ return this._client.get(path `/mailboxes/${mailboxID}`, options);
42
+ }
43
+ /**
44
+ * Updates the label of a mailbox.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const mailbox = await client.mailboxes.update(
49
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
50
+ * { label: 'label' },
51
+ * );
52
+ * ```
53
+ */
54
+ update(mailboxID, body, options) {
55
+ return this._client.patch(path `/mailboxes/${mailboxID}`, { body, ...options });
56
+ }
57
+ /**
58
+ * Lists the caller-owned mailboxes with page-based pagination.
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * const mailboxes = await client.mailboxes.list();
63
+ * ```
64
+ */
65
+ list(query = {}, options) {
66
+ return this._client.get('/mailboxes', { query, ...options });
67
+ }
68
+ /**
69
+ * For paid rent, schedules end-of-cycle cancellation. For an included generation,
70
+ * archives immediately and releases its package seat. This never deletes the
71
+ * mailbox, its address, or its messages — the address is permanently reserved.
72
+ * Idempotent.
73
+ *
74
+ * @example
75
+ * ```ts
76
+ * const mailbox = await client.mailboxes.delete(
77
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
78
+ * );
79
+ * ```
80
+ */
81
+ delete(mailboxID, options) {
82
+ return this._client.delete(path `/mailboxes/${mailboxID}`, options);
83
+ }
84
+ /**
85
+ * Returns the authoritative number of package-funded mailbox claims currently
86
+ * available after local reservations.
87
+ *
88
+ * @example
89
+ * ```ts
90
+ * const response = await client.mailboxes.capacity();
91
+ * ```
92
+ */
93
+ capacity(options) {
94
+ return this._client.get('/mailboxes/capacity', options);
95
+ }
96
+ /**
97
+ * Returns the highest-confidence, most recent OTP for the mailbox, restricted to
98
+ * messages of completed/active paid intervals. Does not wait server-side (SDKs
99
+ * poll). 200 with the best code, 204 when none matches.
100
+ *
101
+ * @example
102
+ * ```ts
103
+ * const response = await client.mailboxes.otp(
104
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
105
+ * );
106
+ * ```
107
+ */
108
+ otp(mailboxID, query = {}, options) {
109
+ return this._client.get(path `/mailboxes/${mailboxID}/otp`, { query, ...options });
110
+ }
111
+ /**
112
+ * Starts a new generation on an archived mailbox, reusing the same permanent
113
+ * address. Uses included capacity first unless paid rent is requested.
114
+ *
115
+ * @example
116
+ * ```ts
117
+ * const response = await client.mailboxes.restart(
118
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
119
+ * );
120
+ * ```
121
+ */
122
+ restart(mailboxID, body = {}, options) {
123
+ return this._client.post(path `/mailboxes/${mailboxID}/restart`, { body, ...options });
124
+ }
125
+ /**
126
+ * Retracts a scheduled end-of-cycle cancellation for the current generation. Only
127
+ * valid while cancellation is pending.
128
+ *
129
+ * @example
130
+ * ```ts
131
+ * const response = await client.mailboxes.uncancel(
132
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
133
+ * );
134
+ * ```
135
+ */
136
+ uncancel(mailboxID, options) {
137
+ return this._client.post(path `/mailboxes/${mailboxID}/uncancel`, options);
138
+ }
139
+ }
140
+ Mailboxes.Messages = Messages;
141
+ //# sourceMappingURL=mailboxes.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mailboxes.mjs","sourceRoot":"","sources":["../../src/resources/mailboxes/mailboxes.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAElD,OAAO,KAAK,WAAW,uBAAmB;AAC1C,OAAO,EAKL,QAAQ,GACT,uBAAmB;AAGpB,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD,MAAM,OAAO,SAAU,SAAQ,WAAW;IAA1C;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAyJ1E,CAAC;IAvJC;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI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