spinupmail 0.1.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.
@@ -0,0 +1,615 @@
1
+ import { z } from "zod";
2
+
3
+ //#region ../contracts/src/index.d.ts
4
+ declare const domainConfigSchema: z.ZodObject<{
5
+ items: z.ZodArray<z.ZodString>;
6
+ default: z.ZodNullable<z.ZodString>;
7
+ forcedLocalPartPrefix: z.ZodNullable<z.ZodString>;
8
+ maxReceivedEmailsPerOrganization: z.ZodNumber;
9
+ maxReceivedEmailsPerAddress: z.ZodNumber;
10
+ }, z.core.$strip>;
11
+ declare const emailAddressSchema: z.ZodObject<{
12
+ id: z.ZodString;
13
+ address: z.ZodString;
14
+ localPart: z.ZodString;
15
+ domain: z.ZodString;
16
+ meta: z.ZodOptional<z.ZodUnknown>;
17
+ emailCount: z.ZodNumber;
18
+ allowedFromDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
19
+ blockedSenderDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
20
+ inboundRatePolicy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
21
+ senderDomainSoftMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
22
+ senderDomainSoftWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
23
+ senderDomainBlockMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
24
+ senderDomainBlockWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
25
+ senderAddressBlockMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
26
+ senderAddressBlockWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
27
+ inboxBlockMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
28
+ inboxBlockWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
29
+ dedupeWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
30
+ initialBlockSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
31
+ maxBlockSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
32
+ }, z.core.$strip>>>;
33
+ maxReceivedEmailCount: z.ZodNullable<z.ZodNumber>;
34
+ maxReceivedEmailAction: z.ZodNullable<z.ZodEnum<{
35
+ cleanAll: "cleanAll";
36
+ rejectNew: "rejectNew";
37
+ }>>;
38
+ createdAt: z.ZodNullable<z.ZodString>;
39
+ createdAtMs: z.ZodNullable<z.ZodNumber>;
40
+ expiresAt: z.ZodNullable<z.ZodString>;
41
+ expiresAtMs: z.ZodNullable<z.ZodNumber>;
42
+ lastReceivedAt: z.ZodNullable<z.ZodString>;
43
+ lastReceivedAtMs: z.ZodNullable<z.ZodNumber>;
44
+ }, z.core.$strip>;
45
+ declare const createEmailAddressResponseSchema: z.ZodObject<{
46
+ id: z.ZodString;
47
+ address: z.ZodString;
48
+ localPart: z.ZodString;
49
+ domain: z.ZodString;
50
+ meta: z.ZodOptional<z.ZodUnknown>;
51
+ emailCount: z.ZodNumber;
52
+ allowedFromDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
53
+ blockedSenderDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
54
+ inboundRatePolicy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
55
+ senderDomainSoftMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
56
+ senderDomainSoftWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
57
+ senderDomainBlockMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
58
+ senderDomainBlockWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
59
+ senderAddressBlockMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
60
+ senderAddressBlockWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
61
+ inboxBlockMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
62
+ inboxBlockWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
63
+ dedupeWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
64
+ initialBlockSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
65
+ maxBlockSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
66
+ }, z.core.$strip>>>;
67
+ maxReceivedEmailCount: z.ZodNullable<z.ZodNumber>;
68
+ maxReceivedEmailAction: z.ZodNullable<z.ZodEnum<{
69
+ cleanAll: "cleanAll";
70
+ rejectNew: "rejectNew";
71
+ }>>;
72
+ createdAt: z.ZodNullable<z.ZodString>;
73
+ createdAtMs: z.ZodNullable<z.ZodNumber>;
74
+ expiresAt: z.ZodNullable<z.ZodString>;
75
+ expiresAtMs: z.ZodNullable<z.ZodNumber>;
76
+ lastReceivedAt: z.ZodNullable<z.ZodString>;
77
+ lastReceivedAtMs: z.ZodNullable<z.ZodNumber>;
78
+ }, z.core.$strip>;
79
+ declare const emailAddressListResponseSchema: z.ZodObject<{
80
+ items: z.ZodArray<z.ZodObject<{
81
+ id: z.ZodString;
82
+ address: z.ZodString;
83
+ localPart: z.ZodString;
84
+ domain: z.ZodString;
85
+ meta: z.ZodOptional<z.ZodUnknown>;
86
+ emailCount: z.ZodNumber;
87
+ allowedFromDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
88
+ blockedSenderDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
89
+ inboundRatePolicy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
90
+ senderDomainSoftMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
91
+ senderDomainSoftWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
92
+ senderDomainBlockMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
93
+ senderDomainBlockWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
94
+ senderAddressBlockMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
95
+ senderAddressBlockWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
96
+ inboxBlockMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
97
+ inboxBlockWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
98
+ dedupeWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
99
+ initialBlockSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
100
+ maxBlockSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
101
+ }, z.core.$strip>>>;
102
+ maxReceivedEmailCount: z.ZodNullable<z.ZodNumber>;
103
+ maxReceivedEmailAction: z.ZodNullable<z.ZodEnum<{
104
+ cleanAll: "cleanAll";
105
+ rejectNew: "rejectNew";
106
+ }>>;
107
+ createdAt: z.ZodNullable<z.ZodString>;
108
+ createdAtMs: z.ZodNullable<z.ZodNumber>;
109
+ expiresAt: z.ZodNullable<z.ZodString>;
110
+ expiresAtMs: z.ZodNullable<z.ZodNumber>;
111
+ lastReceivedAt: z.ZodNullable<z.ZodString>;
112
+ lastReceivedAtMs: z.ZodNullable<z.ZodNumber>;
113
+ }, z.core.$strip>>;
114
+ page: z.ZodNumber;
115
+ pageSize: z.ZodNumber;
116
+ totalItems: z.ZodNumber;
117
+ addressLimit: z.ZodNumber;
118
+ totalPages: z.ZodNumber;
119
+ sortBy: z.ZodEnum<{
120
+ createdAt: "createdAt";
121
+ address: "address";
122
+ lastReceivedAt: "lastReceivedAt";
123
+ }>;
124
+ sortDirection: z.ZodEnum<{
125
+ asc: "asc";
126
+ desc: "desc";
127
+ }>;
128
+ }, z.core.$strip>;
129
+ declare const listEmailAddressesParamsSchema: z.ZodObject<{
130
+ page: z.ZodOptional<z.ZodNumber>;
131
+ pageSize: z.ZodOptional<z.ZodNumber>;
132
+ search: z.ZodOptional<z.ZodString>;
133
+ sortBy: z.ZodOptional<z.ZodEnum<{
134
+ createdAt: "createdAt";
135
+ address: "address";
136
+ lastReceivedAt: "lastReceivedAt";
137
+ }>>;
138
+ sortDirection: z.ZodOptional<z.ZodEnum<{
139
+ asc: "asc";
140
+ desc: "desc";
141
+ }>>;
142
+ }, z.core.$strip>;
143
+ declare const listRecentAddressActivityParamsSchema: z.ZodObject<{
144
+ limit: z.ZodOptional<z.ZodNumber>;
145
+ cursor: z.ZodOptional<z.ZodString>;
146
+ search: z.ZodOptional<z.ZodString>;
147
+ sortBy: z.ZodOptional<z.ZodEnum<{
148
+ createdAt: "createdAt";
149
+ recentActivity: "recentActivity";
150
+ }>>;
151
+ sortDirection: z.ZodOptional<z.ZodEnum<{
152
+ asc: "asc";
153
+ desc: "desc";
154
+ }>>;
155
+ }, z.core.$strip>;
156
+ declare const recentAddressActivityResponseSchema: z.ZodObject<{
157
+ items: z.ZodArray<z.ZodObject<{
158
+ id: z.ZodString;
159
+ address: z.ZodString;
160
+ localPart: z.ZodString;
161
+ domain: z.ZodString;
162
+ meta: z.ZodOptional<z.ZodUnknown>;
163
+ emailCount: z.ZodNumber;
164
+ allowedFromDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
165
+ blockedSenderDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
166
+ inboundRatePolicy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
167
+ senderDomainSoftMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
168
+ senderDomainSoftWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
169
+ senderDomainBlockMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
170
+ senderDomainBlockWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
171
+ senderAddressBlockMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
172
+ senderAddressBlockWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
173
+ inboxBlockMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
174
+ inboxBlockWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
175
+ dedupeWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
176
+ initialBlockSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
177
+ maxBlockSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
178
+ }, z.core.$strip>>>;
179
+ maxReceivedEmailCount: z.ZodNullable<z.ZodNumber>;
180
+ maxReceivedEmailAction: z.ZodNullable<z.ZodEnum<{
181
+ cleanAll: "cleanAll";
182
+ rejectNew: "rejectNew";
183
+ }>>;
184
+ createdAt: z.ZodNullable<z.ZodString>;
185
+ createdAtMs: z.ZodNullable<z.ZodNumber>;
186
+ expiresAt: z.ZodNullable<z.ZodString>;
187
+ expiresAtMs: z.ZodNullable<z.ZodNumber>;
188
+ lastReceivedAt: z.ZodNullable<z.ZodString>;
189
+ lastReceivedAtMs: z.ZodNullable<z.ZodNumber>;
190
+ }, z.core.$strip>>;
191
+ nextCursor: z.ZodNullable<z.ZodString>;
192
+ totalItems: z.ZodNumber;
193
+ }, z.core.$strip>;
194
+ declare const createEmailAddressRequestSchema: z.ZodObject<{
195
+ localPart: z.ZodString;
196
+ ttlMinutes: z.ZodOptional<z.ZodNumber>;
197
+ meta: z.ZodOptional<z.ZodUnknown>;
198
+ domain: z.ZodOptional<z.ZodString>;
199
+ allowedFromDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
200
+ blockedSenderDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
201
+ inboundRatePolicy: z.ZodOptional<z.ZodObject<{
202
+ senderDomainSoftMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
203
+ senderDomainSoftWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
204
+ senderDomainBlockMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
205
+ senderDomainBlockWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
206
+ senderAddressBlockMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
207
+ senderAddressBlockWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
208
+ inboxBlockMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
209
+ inboxBlockWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
210
+ dedupeWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
211
+ initialBlockSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
212
+ maxBlockSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
213
+ }, z.core.$strip>>;
214
+ maxReceivedEmailCount: z.ZodOptional<z.ZodNumber>;
215
+ maxReceivedEmailAction: z.ZodOptional<z.ZodEnum<{
216
+ cleanAll: "cleanAll";
217
+ rejectNew: "rejectNew";
218
+ }>>;
219
+ acceptedRiskNotice: z.ZodLiteral<true>;
220
+ }, z.core.$strip>;
221
+ declare const updateEmailAddressRequestSchema: z.ZodObject<{
222
+ localPart: z.ZodOptional<z.ZodString>;
223
+ ttlMinutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
224
+ meta: z.ZodOptional<z.ZodUnknown>;
225
+ domain: z.ZodOptional<z.ZodString>;
226
+ allowedFromDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
227
+ blockedSenderDomains: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
228
+ inboundRatePolicy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
229
+ senderDomainSoftMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
230
+ senderDomainSoftWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
231
+ senderDomainBlockMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
232
+ senderDomainBlockWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
233
+ senderAddressBlockMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
234
+ senderAddressBlockWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
235
+ inboxBlockMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
236
+ inboxBlockWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
237
+ dedupeWindowSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
238
+ initialBlockSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
239
+ maxBlockSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
240
+ }, z.core.$strip>>>;
241
+ maxReceivedEmailCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
242
+ maxReceivedEmailAction: z.ZodOptional<z.ZodEnum<{
243
+ cleanAll: "cleanAll";
244
+ rejectNew: "rejectNew";
245
+ }>>;
246
+ }, z.core.$strip>;
247
+ declare const deleteEmailAddressResponseSchema: z.ZodObject<{
248
+ id: z.ZodString;
249
+ address: z.ZodString;
250
+ deleted: z.ZodLiteral<true>;
251
+ }, z.core.$strip>;
252
+ declare const emailListItemSchema: z.ZodObject<{
253
+ id: z.ZodString;
254
+ addressId: z.ZodString;
255
+ to: z.ZodString;
256
+ from: z.ZodString;
257
+ sender: z.ZodOptional<z.ZodNullable<z.ZodString>>;
258
+ senderLabel: z.ZodString;
259
+ subject: z.ZodOptional<z.ZodNullable<z.ZodString>>;
260
+ messageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
261
+ rawSize: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
262
+ rawTruncated: z.ZodBoolean;
263
+ isSample: z.ZodBoolean;
264
+ hasHtml: z.ZodBoolean;
265
+ hasText: z.ZodBoolean;
266
+ attachmentCount: z.ZodNumber;
267
+ receivedAt: z.ZodNullable<z.ZodString>;
268
+ receivedAtMs: z.ZodNullable<z.ZodNumber>;
269
+ }, z.core.$strip>;
270
+ declare const emailListResponseSchema: z.ZodObject<{
271
+ address: z.ZodString;
272
+ addressId: z.ZodString;
273
+ items: z.ZodArray<z.ZodObject<{
274
+ id: z.ZodString;
275
+ addressId: z.ZodString;
276
+ to: z.ZodString;
277
+ from: z.ZodString;
278
+ sender: z.ZodOptional<z.ZodNullable<z.ZodString>>;
279
+ senderLabel: z.ZodString;
280
+ subject: z.ZodOptional<z.ZodNullable<z.ZodString>>;
281
+ messageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
282
+ rawSize: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
283
+ rawTruncated: z.ZodBoolean;
284
+ isSample: z.ZodBoolean;
285
+ hasHtml: z.ZodBoolean;
286
+ hasText: z.ZodBoolean;
287
+ attachmentCount: z.ZodNumber;
288
+ receivedAt: z.ZodNullable<z.ZodString>;
289
+ receivedAtMs: z.ZodNullable<z.ZodNumber>;
290
+ }, z.core.$strip>>;
291
+ }, z.core.$strip>;
292
+ declare const listEmailsParamsSchema: z.ZodObject<{
293
+ address: z.ZodOptional<z.ZodString>;
294
+ addressId: z.ZodOptional<z.ZodString>;
295
+ search: z.ZodOptional<z.ZodString>;
296
+ limit: z.ZodOptional<z.ZodNumber>;
297
+ order: z.ZodOptional<z.ZodEnum<{
298
+ asc: "asc";
299
+ desc: "desc";
300
+ }>>;
301
+ after: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
302
+ before: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
303
+ }, z.core.$strip>;
304
+ declare const emailDetailSchema: z.ZodObject<{
305
+ id: z.ZodString;
306
+ addressId: z.ZodString;
307
+ address: z.ZodOptional<z.ZodString>;
308
+ to: z.ZodString;
309
+ from: z.ZodString;
310
+ sender: z.ZodOptional<z.ZodNullable<z.ZodString>>;
311
+ senderLabel: z.ZodString;
312
+ subject: z.ZodOptional<z.ZodNullable<z.ZodString>>;
313
+ messageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
314
+ headers: z.ZodUnknown;
315
+ html: z.ZodOptional<z.ZodNullable<z.ZodString>>;
316
+ text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
317
+ raw: z.ZodOptional<z.ZodNullable<z.ZodString>>;
318
+ rawSize: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
319
+ rawTruncated: z.ZodBoolean;
320
+ isSample: z.ZodBoolean;
321
+ rawDownloadPath: z.ZodOptional<z.ZodString>;
322
+ attachments: z.ZodArray<z.ZodObject<{
323
+ id: z.ZodString;
324
+ filename: z.ZodString;
325
+ contentType: z.ZodString;
326
+ size: z.ZodNumber;
327
+ disposition: z.ZodNullable<z.ZodString>;
328
+ contentId: z.ZodNullable<z.ZodString>;
329
+ inlinePath: z.ZodString;
330
+ downloadPath: z.ZodString;
331
+ }, z.core.$strip>>;
332
+ receivedAt: z.ZodNullable<z.ZodString>;
333
+ receivedAtMs: z.ZodNullable<z.ZodNumber>;
334
+ }, z.core.$strip>;
335
+ declare const deleteEmailResponseSchema: z.ZodObject<{
336
+ id: z.ZodString;
337
+ deleted: z.ZodLiteral<true>;
338
+ }, z.core.$strip>;
339
+ declare const emailActivityResponseSchema: z.ZodObject<{
340
+ timezone: z.ZodString;
341
+ daily: z.ZodArray<z.ZodObject<{
342
+ date: z.ZodString;
343
+ count: z.ZodNumber;
344
+ }, z.core.$strip>>;
345
+ }, z.core.$strip>;
346
+ declare const emailSummaryResponseSchema: z.ZodObject<{
347
+ totalEmailCount: z.ZodNumber;
348
+ attachmentCount: z.ZodNumber;
349
+ attachmentSizeTotal: z.ZodNumber;
350
+ attachmentSizeLimit: z.ZodNumber;
351
+ topDomains: z.ZodArray<z.ZodObject<{
352
+ domain: z.ZodString;
353
+ count: z.ZodNumber;
354
+ }, z.core.$strip>>;
355
+ busiestInboxes: z.ZodArray<z.ZodObject<{
356
+ addressId: z.ZodString;
357
+ address: z.ZodString;
358
+ count: z.ZodNumber;
359
+ }, z.core.$strip>>;
360
+ dormantInboxes: z.ZodArray<z.ZodObject<{
361
+ addressId: z.ZodString;
362
+ address: z.ZodString;
363
+ createdAt: z.ZodNullable<z.ZodString>;
364
+ }, z.core.$strip>>;
365
+ }, z.core.$strip>;
366
+ type DomainConfig = z.infer<typeof domainConfigSchema>;
367
+ type EmailAddress = z.infer<typeof emailAddressSchema>;
368
+ type EmailAddressListResponse = z.infer<typeof emailAddressListResponseSchema>;
369
+ type ListEmailAddressesParams = z.infer<typeof listEmailAddressesParamsSchema>;
370
+ type ListRecentAddressActivityParams = z.infer<typeof listRecentAddressActivityParamsSchema>;
371
+ type RecentAddressActivityResponse = z.infer<typeof recentAddressActivityResponseSchema>;
372
+ type CreateEmailAddressRequest = z.infer<typeof createEmailAddressRequestSchema>;
373
+ type CreateEmailAddressResponse = z.infer<typeof createEmailAddressResponseSchema>;
374
+ type UpdateEmailAddressRequest = z.infer<typeof updateEmailAddressRequestSchema>;
375
+ type DeleteEmailAddressResponse = z.infer<typeof deleteEmailAddressResponseSchema>;
376
+ type EmailListItem = z.infer<typeof emailListItemSchema>;
377
+ type EmailListResponse = z.infer<typeof emailListResponseSchema>;
378
+ type ListEmailsParams = z.infer<typeof listEmailsParamsSchema>;
379
+ type EmailDetail = z.infer<typeof emailDetailSchema>;
380
+ type DeleteEmailResponse = z.infer<typeof deleteEmailResponseSchema>;
381
+ type EmailActivityResponse = z.infer<typeof emailActivityResponseSchema>;
382
+ type EmailSummaryResponse = z.infer<typeof emailSummaryResponseSchema>;
383
+ //#endregion
384
+ //#region src/file.d.ts
385
+ declare class SpinupMailFile {
386
+ readonly filename: string | null;
387
+ readonly contentType: string | null;
388
+ readonly contentLength: number | null;
389
+ readonly response: Response;
390
+ constructor(response: Response);
391
+ arrayBuffer(): Promise<ArrayBuffer>;
392
+ text(): Promise<string>;
393
+ blob(): Promise<Blob>;
394
+ }
395
+ //#endregion
396
+ //#region src/client.d.ts
397
+ type FetchLike = typeof fetch;
398
+ type OrganizationScopedOptions = {
399
+ organizationId?: string;
400
+ signal?: AbortSignal;
401
+ };
402
+ type InboxAddressSelector = {
403
+ address?: string;
404
+ addressId?: string;
405
+ };
406
+ /**
407
+ * Initializes the SpinupMail SDK.
408
+ *
409
+ * `apiKey` defaults to `process.env.SPINUPMAIL_API_KEY`.
410
+ * `baseUrl` defaults to `process.env.SPINUPMAIL_BASE_URL` or `https://api.spinupmail.com`.
411
+ * `organizationId` defaults to `process.env.SPINUPMAIL_ORGANIZATION_ID` or `process.env.SPINUPMAIL_ORG_ID`.
412
+ */
413
+ type SpinupMailOptions = {
414
+ apiKey?: string;
415
+ baseUrl?: string;
416
+ organizationId?: string;
417
+ fetch?: FetchLike;
418
+ headers?: HeadersInit;
419
+ };
420
+ /** Lists and paginates inbox addresses in the active organization. */
421
+ type ListEmailAddressesOptions = ListEmailAddressesParams & OrganizationScopedOptions;
422
+ /** Reads the recent-activity inbox feed in the active organization. */
423
+ type ListRecentAddressActivityOptions = ListRecentAddressActivityParams & OrganizationScopedOptions;
424
+ /** Fetches a single inbox address by ID. */
425
+ type GetEmailAddressOptions = OrganizationScopedOptions;
426
+ /** Per-call options for inbox creation. */
427
+ type CreateEmailAddressOptions = OrganizationScopedOptions;
428
+ /**
429
+ * Creates a SpinupMail inbox.
430
+ *
431
+ * If `localPart` is omitted, the SDK generates a random valid local part
432
+ * before sending the request.
433
+ */
434
+ type CreateEmailAddressInput = Omit<CreateEmailAddressRequest, "localPart"> & {
435
+ localPart?: string;
436
+ };
437
+ /** Per-call options for inbox updates. */
438
+ type UpdateEmailAddressOptions = OrganizationScopedOptions;
439
+ /** Per-call options for inbox deletion. */
440
+ type DeleteEmailAddressOptions = OrganizationScopedOptions;
441
+ /** Lists emails for a single inbox, optionally filtered by received time. */
442
+ type ListEmailsOptions = Omit<ListEmailsParams, "after" | "before"> & OrganizationScopedOptions & {
443
+ /** Only include emails received after this timestamp. Accepts ISO strings, epoch milliseconds, or `Date`. */after?: EmailTimestampFilter; /** Only include emails received before this timestamp. Accepts ISO strings, epoch milliseconds, or `Date`. */
444
+ before?: EmailTimestampFilter;
445
+ };
446
+ /** Fetches a single stored email. */
447
+ type GetEmailOptions = OrganizationScopedOptions & {
448
+ raw?: boolean;
449
+ };
450
+ /** Deletes a single stored email. */
451
+ type DeleteEmailOptions = OrganizationScopedOptions;
452
+ /** Downloads the raw MIME source for an email. */
453
+ type GetEmailRawOptions = OrganizationScopedOptions;
454
+ /** Downloads one attachment from a stored email. */
455
+ type GetEmailAttachmentOptions = OrganizationScopedOptions & {
456
+ inline?: boolean;
457
+ };
458
+ /** Fetches organization email activity stats. */
459
+ type GetEmailActivityOptions = OrganizationScopedOptions & {
460
+ days?: number;
461
+ timezone?: string;
462
+ };
463
+ /** Fetches organization email summary stats. */
464
+ type GetEmailSummaryOptions = OrganizationScopedOptions;
465
+ /** Timestamp filter accepted by inbox listing and polling helpers. */
466
+ type EmailTimestampFilter = string | number | Date;
467
+ /**
468
+ * Polls an inbox until a matching email appears or the timeout is reached.
469
+ *
470
+ * Provide either `address` or `addressId`.
471
+ */
472
+ type InboxPollOptions = InboxAddressSelector & OrganizationScopedOptions & {
473
+ search?: string;
474
+ limit?: number;
475
+ order?: "asc" | "desc"; /** Case-insensitive substring match against the email subject. */
476
+ subjectIncludes?: string; /** Case-insensitive substring match against the recipient address. */
477
+ toIncludes?: string; /** Case-insensitive substring match against `from`, `sender`, or `senderLabel`. */
478
+ fromIncludes?: string; /** Only include emails received after this timestamp. Accepts ISO strings, epoch milliseconds, or `Date`. */
479
+ after?: EmailTimestampFilter; /** Only include emails received before this timestamp. Accepts ISO strings, epoch milliseconds, or `Date`. */
480
+ before?: EmailTimestampFilter;
481
+ timeoutMs?: number;
482
+ intervalMs?: number;
483
+ match?: (email: EmailListItem) => boolean;
484
+ };
485
+ /**
486
+ * Waits for a matching email and optionally filters against the fetched body.
487
+ *
488
+ * `bodyIncludes` and `matchDetail` are evaluated after the SDK fetches email
489
+ * detail for candidate messages that already passed the list-level filters.
490
+ */
491
+ type WaitForEmailOptions = InboxPollOptions & {
492
+ /** Case-insensitive substring match against the concatenated HTML and text body. */bodyIncludes?: string; /** Deletes the email after fetching the matching detail payload. */
493
+ deleteAfterRead?: boolean; /** Additional predicate evaluated against the fetched email detail payload. */
494
+ matchDetail?: (email: EmailDetail) => boolean;
495
+ };
496
+ /** Result returned by `inboxes.poll()`. */
497
+ type InboxPollResult = {
498
+ response: EmailListResponse;
499
+ items: EmailListItem[];
500
+ freshItems: EmailListItem[];
501
+ matchedEmail: EmailListItem | null;
502
+ timedOut: boolean;
503
+ attempts: number;
504
+ elapsedMs: number;
505
+ polledAt: string;
506
+ };
507
+ interface SpinupMailDomainsApi {
508
+ /** Fetches configured receiving domains and retention limits. */
509
+ get(): Promise<DomainConfig>;
510
+ }
511
+ interface SpinupMailAddressesApi {
512
+ /** Lists inbox addresses in the current organization. */
513
+ list(options?: ListEmailAddressesOptions): Promise<EmailAddressListResponse>;
514
+ /** Fetches all inbox addresses by following all pages. */
515
+ listAll(options?: ListEmailAddressesOptions): Promise<EmailAddress[]>;
516
+ /** Lists inboxes ordered by recent activity using cursor pagination. */
517
+ listRecentActivity(options?: ListRecentAddressActivityOptions): Promise<RecentAddressActivityResponse>;
518
+ /** Fetches a single inbox address by ID. */
519
+ get(addressId: string, options?: GetEmailAddressOptions): Promise<EmailAddress>;
520
+ /** Creates an inbox address in the current organization. */
521
+ create(payload: CreateEmailAddressInput, options?: CreateEmailAddressOptions): Promise<CreateEmailAddressResponse>;
522
+ /** Updates an existing inbox address. */
523
+ update(addressId: string, payload: UpdateEmailAddressRequest, options?: UpdateEmailAddressOptions): Promise<EmailAddress>;
524
+ /** Deletes an inbox address and its stored contents. */
525
+ delete(addressId: string, options?: DeleteEmailAddressOptions): Promise<DeleteEmailAddressResponse>;
526
+ }
527
+ interface SpinupMailEmailsApi {
528
+ /** Lists emails for a single inbox. */
529
+ list(options: ListEmailsOptions): Promise<EmailListResponse>;
530
+ /** Fetches one parsed email including bodies and attachment metadata. */
531
+ get(emailId: string, options?: GetEmailOptions): Promise<EmailDetail>;
532
+ /** Deletes one stored email. */
533
+ delete(emailId: string, options?: DeleteEmailOptions): Promise<DeleteEmailResponse>;
534
+ /** Downloads the raw MIME source for an email. */
535
+ getRaw(emailId: string, options?: GetEmailRawOptions): Promise<SpinupMailFile>;
536
+ /** Downloads an attachment from an email. */
537
+ getAttachment(emailId: string, attachmentId: string, options?: GetEmailAttachmentOptions): Promise<SpinupMailFile>;
538
+ }
539
+ interface SpinupMailStatsApi {
540
+ /** Returns daily email activity counts for the organization. */
541
+ getEmailActivity(options?: GetEmailActivityOptions): Promise<EmailActivityResponse>;
542
+ /** Returns aggregate storage and inbox summary stats for the organization. */
543
+ getEmailSummary(options?: GetEmailSummaryOptions): Promise<EmailSummaryResponse>;
544
+ }
545
+ interface SpinupMailInboxesApi {
546
+ /** Polls an inbox and returns the latest response plus polling metadata. */
547
+ poll(options: InboxPollOptions): Promise<InboxPollResult>;
548
+ /** Waits until a matching email arrives, then returns the fetched email detail. */
549
+ waitForEmail(options: WaitForEmailOptions): Promise<EmailDetail>;
550
+ }
551
+ interface SpinupMailClient {
552
+ /** Domain and retention configuration endpoints. */
553
+ domains: SpinupMailDomainsApi;
554
+ /** Inbox address lifecycle endpoints. */
555
+ addresses: SpinupMailAddressesApi;
556
+ /** Email retrieval and download endpoints. */
557
+ emails: SpinupMailEmailsApi;
558
+ /** Organization-level reporting endpoints. */
559
+ stats: SpinupMailStatsApi;
560
+ /** High-level inbox polling helpers. */
561
+ inboxes: SpinupMailInboxesApi;
562
+ }
563
+ /**
564
+ * API-key SDK for SpinupMail.
565
+ *
566
+ * Typical usage:
567
+ *
568
+ * ```ts
569
+ * const spinupmail = new SpinupMail();
570
+ * const address = await spinupmail.addresses.create({ acceptedRiskNotice: true });
571
+ * const email = await spinupmail.inboxes.waitForEmail({ addressId: address.id });
572
+ * ```
573
+ */
574
+ declare class SpinupMail {
575
+ readonly domains: SpinupMailClient["domains"];
576
+ readonly addresses: SpinupMailClient["addresses"];
577
+ readonly emails: SpinupMailClient["emails"];
578
+ readonly stats: SpinupMailClient["stats"];
579
+ readonly inboxes: SpinupMailClient["inboxes"];
580
+ /** Creates a new SDK client using constructor options or environment defaults. */
581
+ constructor(options?: string | SpinupMailOptions);
582
+ }
583
+ //#endregion
584
+ //#region src/errors.d.ts
585
+ declare class SpinupMailError extends Error {
586
+ constructor(message: string, options?: ErrorOptions);
587
+ }
588
+ declare class SpinupMailValidationError extends SpinupMailError {
589
+ readonly source: "request" | "response";
590
+ readonly issues: string[];
591
+ constructor(args: {
592
+ message: string;
593
+ source: "request" | "response";
594
+ issues?: string[];
595
+ cause?: unknown;
596
+ });
597
+ }
598
+ declare class SpinupMailApiError extends SpinupMailError {
599
+ readonly status: number;
600
+ readonly response: Response;
601
+ readonly body?: unknown;
602
+ constructor(args: {
603
+ message: string;
604
+ status: number;
605
+ response: Response;
606
+ body?: unknown;
607
+ });
608
+ }
609
+ declare class SpinupMailTimeoutError extends SpinupMailError {
610
+ readonly timeoutMs: number;
611
+ constructor(message: string, timeoutMs: number, options?: ErrorOptions);
612
+ }
613
+ //#endregion
614
+ export { type CreateEmailAddressInput, type CreateEmailAddressOptions, type CreateEmailAddressRequest, type CreateEmailAddressResponse, type DeleteEmailAddressOptions, type DeleteEmailAddressResponse, type DeleteEmailOptions, type DeleteEmailResponse, type DomainConfig, type EmailActivityResponse, type EmailAddress, type EmailAddressListResponse, type EmailDetail, type EmailListItem, type EmailListResponse, type EmailSummaryResponse, type EmailTimestampFilter, type GetEmailActivityOptions, type GetEmailAddressOptions, type GetEmailAttachmentOptions, type GetEmailOptions, type GetEmailRawOptions, type GetEmailSummaryOptions, type InboxPollOptions, type InboxPollResult, type ListEmailAddressesOptions, type ListEmailsOptions, type ListRecentAddressActivityOptions, type RecentAddressActivityResponse, SpinupMail, type SpinupMailAddressesApi, SpinupMailApiError, type SpinupMailClient, type SpinupMailDomainsApi, type SpinupMailEmailsApi, SpinupMailError, SpinupMailFile, type SpinupMailInboxesApi, type SpinupMailOptions, type SpinupMailStatsApi, SpinupMailTimeoutError, SpinupMailValidationError, type UpdateEmailAddressOptions, type UpdateEmailAddressRequest, type WaitForEmailOptions };
615
+ //# sourceMappingURL=index.d.cts.map