mailpit-api 1.1.0 → 1.2.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,550 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ exports.MailpitClient = void 0;
46
+ const axios_1 = __importStar(require("axios"));
47
+ /**
48
+ * Client for interacting with the {@link https://mailpit.axllent.org/docs/api-v1/ | Mailpit API}.
49
+ * @example
50
+ * ```typescript
51
+ * import { MailpitClient } from "mailpit-api";
52
+ * const mailpit = new MailpitClient("http://localhost:8025");
53
+ * console.log(await mailpit.getInfo());
54
+ * ```
55
+ */
56
+ class MailpitClient {
57
+ /**
58
+ * Creates an instance of {@link MailpitClient}.
59
+ * @param baseURL - The base URL of the Mailpit API.
60
+ * @param auth - Optional authentication credentials.
61
+ * @param auth.username - The username for basic authentication.
62
+ * @param auth.password - The password for basic authentication.
63
+ * @example No Auth
64
+ * ```typescript
65
+ * const mailpit = new MailpitClient("http://localhost:8025");
66
+ * ```
67
+ * @example Basic Auth
68
+ * ```typescript
69
+ * const mailpit = new MailpitClient("http://localhost:8025", {
70
+ * username: "admin",
71
+ * password: "supersecret",
72
+ * });
73
+ * ```
74
+ */
75
+ constructor(baseURL, auth) {
76
+ this.axiosInstance = axios_1.default.create({
77
+ baseURL,
78
+ auth,
79
+ validateStatus: function (status) {
80
+ return status === 200;
81
+ },
82
+ });
83
+ }
84
+ handleRequest(request_1) {
85
+ return __awaiter(this, arguments, void 0, function* (request, options = { fullResponse: false }) {
86
+ var _a, _b, _c;
87
+ try {
88
+ const response = yield request();
89
+ return options.fullResponse ? response : response.data;
90
+ }
91
+ catch (error) {
92
+ if ((0, axios_1.isAxiosError)(error)) {
93
+ const url = ((_a = error.config) === null || _a === void 0 ? void 0 : _a.url) || "UNKNOWN URL";
94
+ const method = ((_c = (_b = error.config) === null || _b === void 0 ? void 0 : _b.method) === null || _c === void 0 ? void 0 : _c.toUpperCase()) || "UNKNOWN METHOD";
95
+ if (error.response) {
96
+ // Server responded with a status other than 2xx
97
+ throw new Error(`Mailpit API Error: ${error.response.status.toString()} ${error.response.statusText} at ${method} ${url}: ${JSON.stringify(error.response.data)}`);
98
+ }
99
+ else if (error.request) {
100
+ // Request was made but no response was received
101
+ throw new Error(`Mailpit API Error: No response received from server at ${method} ${url}`);
102
+ }
103
+ else {
104
+ // Something happened in setting up the request
105
+ throw new Error(`Mailpit API Error: ${error.toString()} at ${method} ${url}`);
106
+ }
107
+ }
108
+ else {
109
+ throw new Error(`Unexpected Error: ${error}`);
110
+ }
111
+ }
112
+ });
113
+ }
114
+ /**
115
+ * Retrieves information about the Mailpit instance.
116
+ *
117
+ * @returns Basic runtime information, message totals and latest release version.
118
+ * @example
119
+ * ```typescript
120
+ * const info = await mailpit.getInfo();
121
+ * ```
122
+ */
123
+ getInfo() {
124
+ return __awaiter(this, void 0, void 0, function* () {
125
+ return yield this.handleRequest(() => this.axiosInstance.get("/api/v1/info"));
126
+ });
127
+ }
128
+ /**
129
+ * Retrieves the configuration of the Mailpit web UI.
130
+ * @remarks Intended for web UI only!
131
+ * @returns Configuration settings
132
+ * @example
133
+ * ```typescript
134
+ * const config = await mailpit.getConfiguration();
135
+ * ```
136
+ */
137
+ getConfiguration() {
138
+ return __awaiter(this, void 0, void 0, function* () {
139
+ return yield this.handleRequest(() => this.axiosInstance.get("/api/v1/webui"));
140
+ });
141
+ }
142
+ /**
143
+ * Retrieves a summary of a specific message and marks it as read.
144
+ * @param id - The message database ID. Defaults to `latest` to return the latest message.
145
+ * @returns Message summary
146
+ * @example
147
+ * ```typescript
148
+ * const message = await mailpit.getMessageSummary();
149
+ * ```
150
+ */
151
+ getMessageSummary() {
152
+ return __awaiter(this, arguments, void 0, function* (id = "latest") {
153
+ return yield this.handleRequest(() => this.axiosInstance.get(`/api/v1/message/${id}`));
154
+ });
155
+ }
156
+ /**
157
+ * Retrieves the headers of a specific message.
158
+ * @remarks Header keys are returned alphabetically.
159
+ * @param id - The message database ID. Defaults to `latest` to return the latest message.
160
+ * @returns Message headers
161
+ * @example
162
+ * ```typescript
163
+ * const headers = await mailpit.getMessageHeaders();
164
+ * ```
165
+ */
166
+ getMessageHeaders() {
167
+ return __awaiter(this, arguments, void 0, function* (id = "latest") {
168
+ return yield this.handleRequest(() => this.axiosInstance.get(`/api/v1/message/${id}/headers`));
169
+ });
170
+ }
171
+ /**
172
+ * Retrieves a specific attachment from a message.
173
+ * @param id - Message database ID or "latest"
174
+ * @param partID - The attachment part ID
175
+ * @returns Attachment as binary data and the content type
176
+ * @example
177
+ * ```typescript
178
+ * const message = await mailpit.getMessageSummary();
179
+ * if (message.Attachments.length) {
180
+ * const attachment = await mailpit.getMessageAttachment(message.ID, message.Attachments[0].PartID);
181
+ * // Do something with the attachment data
182
+ * }
183
+ * ```
184
+ */
185
+ getMessageAttachment(id, partID) {
186
+ return __awaiter(this, void 0, void 0, function* () {
187
+ const response = yield this.handleRequest(() => this.axiosInstance.get(`/api/v1/message/${id}/part/${partID}`, { responseType: "arraybuffer" }), { fullResponse: true });
188
+ return {
189
+ data: response.data,
190
+ contentType: response.headers["content-type"],
191
+ };
192
+ });
193
+ }
194
+ /**
195
+ * Generates a cropped 180x120 JPEG thumbnail of an image attachment from a message.
196
+ * Only image attachments are supported.
197
+ * @remarks
198
+ * If the image is smaller than 180x120 then the image is padded.
199
+ * If the attachment is not an image then a blank image is returned.
200
+ * @param id - Message database ID or "latest"
201
+ * @param partID - The attachment part ID
202
+ * @returns Image attachment thumbnail as binary data and the content type
203
+ * @example
204
+ * ```typescript
205
+ * const message = await mailpit.getMessageSummary();
206
+ * if (message.Attachments.length) {
207
+ * const thumbnail = await mailpit.getAttachmentThumbnail(message.ID, message.Attachments[0].PartID);
208
+ * // Do something with the thumbnail data
209
+ * }
210
+ * ```
211
+ */
212
+ getAttachmentThumbnail(id, partID) {
213
+ return __awaiter(this, void 0, void 0, function* () {
214
+ const response = yield this.handleRequest(() => this.axiosInstance.get(`/api/v1/message/${id}/part/${partID}/thumb`, {
215
+ responseType: "arraybuffer",
216
+ }), { fullResponse: true });
217
+ return {
218
+ data: response.data,
219
+ contentType: response.headers["content-type"],
220
+ };
221
+ });
222
+ }
223
+ /**
224
+ * Retrieves the full email message source as plain text.
225
+ * @param id - The message database ID. Defaults to `latest` to return the latest message.
226
+ * @returns Plain text message source
227
+ * @example
228
+ * ```typescript
229
+ * const messageSource = await mailpit.getMessageSource();
230
+ * ```
231
+ */
232
+ getMessageSource() {
233
+ return __awaiter(this, arguments, void 0, function* (id = "latest") {
234
+ return yield this.handleRequest(() => this.axiosInstance.get(`/api/v1/message/${id}/raw`));
235
+ });
236
+ }
237
+ /**
238
+ * Release a message via a pre-configured external SMTP server.
239
+ * @remarks This is only enabled if message relaying has been configured.
240
+ * @param id - The message database ID. Use `latest` to return the latest message.
241
+ * @param relayTo - Array of email addresses to relay the message to
242
+ * @returns Plain text "ok" response
243
+ * @example
244
+ * ```typescript
245
+ * const message = await mailpit.releaseMessage("latest", ["user1@example.test", "user2@example.test"]);
246
+ * ```
247
+ */
248
+ releaseMessage(id, relayTo) {
249
+ return __awaiter(this, void 0, void 0, function* () {
250
+ return yield this.handleRequest(() => this.axiosInstance.post(`/api/v1/message/${id}/release`, relayTo));
251
+ });
252
+ }
253
+ /**
254
+ * Sends a message
255
+ * @param sendReqest - The request containing the message details.
256
+ * @returns Response containing database messsage ID
257
+ * @example
258
+ * ```typescript
259
+ * await mailpit.sendMessage(
260
+ * From: { Email: "user@example.test", Name: "First LastName" },
261
+ * To: [{ Email: "rec@example.test", Name: "Recipient Name"}, {Email: "another@example.test"}],
262
+ * Subject: "Test Email",
263
+ * );
264
+ * ```
265
+ */
266
+ sendMessage(sendReqest) {
267
+ return __awaiter(this, void 0, void 0, function* () {
268
+ return yield this.handleRequest(() => this.axiosInstance.post(`/api/v1/send`, sendReqest));
269
+ });
270
+ }
271
+ /**
272
+ * Retrieves a list of message summaries ordered from newest to oldest.
273
+ * @remarks Only contains the number of attachments and a snippet of the message body.
274
+ * @see {@link MailpitClient.getMessageSummary | getMessageSummary()} for more attachment and body details for a specific message.
275
+ * @param start - The pagination offset. Defaults to `0`.
276
+ * @param limit - The number of messages to retrieve. Defaults to `50`.
277
+ * @returns A list of message summaries
278
+ * @example
279
+ * ```typescript
280
+ * const messages = await.listMessages();
281
+ * ```
282
+ */
283
+ listMessages() {
284
+ return __awaiter(this, arguments, void 0, function* (start = 0, limit = 50) {
285
+ return yield this.handleRequest(() => this.axiosInstance.get(`/api/v1/messages`, { params: { start, limit } }));
286
+ });
287
+ }
288
+ /**
289
+ * Set the read status of messages.
290
+ * @param readStatus - The request containing the message database IDs and read status.
291
+ * @param readStatus.Read - The read status to set. Defaults to `false`.
292
+ * @param readStatus.IDs - The IDs of the messages to update. If not set then all messages are updated.
293
+ * @returns Plain text "ok" response
294
+ * @example
295
+ * ```typescript
296
+ * // Set all messages as unread
297
+ * await mailpit.setReadStatus();
298
+ *
299
+ * // Set all messages as read
300
+ * await mailpit.setReadStatus({ Read: true });
301
+ *
302
+ * // Set specific messages as read
303
+ * await mailpit.setReadStatus({ IDs: ["1", "2", "3"], Read: true });
304
+ * ```
305
+ */
306
+ setReadStatus(readStatus) {
307
+ return __awaiter(this, void 0, void 0, function* () {
308
+ return yield this.handleRequest(() => this.axiosInstance.put(`/api/v1/messages`, readStatus));
309
+ });
310
+ }
311
+ /**
312
+ * Delete individual or all messages.
313
+ * @remarks If no `IDs` are provided then all messages are deleted.
314
+ * @param deleteRequest - The request containing the message database IDs to delete.
315
+ * @returns Plain text "ok" response
316
+ * @example
317
+ * ```typescript
318
+ * // Delete all messages
319
+ * await mailpit.deleteMessages();
320
+ *
321
+ * // Delete specific messages
322
+ * await mailpit.deleteMessages({ IDs: ["1", "2", "3"] });
323
+ * ```
324
+ */
325
+ deleteMessages(deleteRequest) {
326
+ return __awaiter(this, void 0, void 0, function* () {
327
+ return yield this.handleRequest(() => this.axiosInstance.delete(`/api/v1/messages`, {
328
+ data: deleteRequest,
329
+ }));
330
+ });
331
+ }
332
+ /**
333
+ * Retrieve messages matching a search, sorted by received date (descending).
334
+ * @see {@link https://mailpit.axllent.org/docs/usage/search-filters/ | Search filters}
335
+ * @remarks Only contains the number of attachments and a snippet of the message body.
336
+ * @see {@link MailpitClient.getMessageSummary | getMessageSummary()} for more attachment and body details for a specific message.
337
+ * @param search - The search request containing the query and optional parameters.
338
+ * @returns A list of message summaries matching the search criteria.
339
+ * @example
340
+ * ```typescript
341
+ * // Search for messages from a the domain example.test
342
+ * const messages = await mailpit.searchMessages({query: "from:example.test"});
343
+ * ```
344
+ */
345
+ searchMessages(search) {
346
+ return __awaiter(this, void 0, void 0, function* () {
347
+ return yield this.handleRequest(() => this.axiosInstance.get(`/api/v1/search`, {
348
+ params: search,
349
+ }));
350
+ });
351
+ }
352
+ /**
353
+ * Delete all messages matching a search.
354
+ * @see {@link https://mailpit.axllent.org/docs/usage/search-filters/ | Search filters}
355
+ * @param search - The search request containing the query.
356
+ * @returns Plain text "ok" response
357
+ * @example
358
+ * ```typescript
359
+ * // Delete all messages from the domain example.test
360
+ * await mailpit.deleteMessagesBySearch({query: "from:example.test"});
361
+ * ```
362
+ */
363
+ deleteMessagesBySearch(search) {
364
+ return __awaiter(this, void 0, void 0, function* () {
365
+ return yield this.handleRequest(() => this.axiosInstance.delete(`/api/v1/search`, { params: search }));
366
+ });
367
+ }
368
+ /**
369
+ * Performs an HTML check on a specific message.
370
+ * @param id - The message database ID. Defaults to `latest` to return the latest message.
371
+ * @returns The summary of the message HTML checker
372
+ * @example
373
+ * ```typescript
374
+ * const htmlCheck = await mailpit.htmlCheck();
375
+ * ```
376
+ */
377
+ htmlCheck() {
378
+ return __awaiter(this, arguments, void 0, function* (id = "latest") {
379
+ return yield this.handleRequest(() => this.axiosInstance.get(`/api/v1/message/${id}/html-check`));
380
+ });
381
+ }
382
+ /**
383
+ * Performs a link check on a specific message.
384
+ * @param id - The message database ID. Defaults to `latest` to return the latest message.
385
+ * @param follow - Whether to follow links. Defaults to `false`.
386
+ * @returns The summary of the message Link checker.
387
+ * @example
388
+ * ```typescript
389
+ * const linkCheck = await mailpit.linkCheck();
390
+ * ```
391
+ */
392
+ linkCheck() {
393
+ return __awaiter(this, arguments, void 0, function* (id = "latest", follow = "false") {
394
+ return yield this.handleRequest(() => this.axiosInstance.get(`/api/v1/message/${id}/link-check`, { params: { follow } }));
395
+ });
396
+ }
397
+ /**
398
+ * Performs a SpamAssassin check (if enabled) on a specific message.
399
+ * @param id - The message database ID. Defaults to `latest` to return the latest message.
400
+ * @returns The SpamAssassin summary (if enabled)
401
+ * @example
402
+ * ```typescript
403
+ * const spamAssassinCheck = await mailpit.spamAssassinCheck();
404
+ * ```
405
+ */
406
+ spamAssassinCheck() {
407
+ return __awaiter(this, arguments, void 0, function* (id = "latest") {
408
+ return yield this.handleRequest(() => this.axiosInstance.get(`/api/v1/message/${id}/sa-check`));
409
+ });
410
+ }
411
+ /**
412
+ * Retrieves a list of all the unique tags.
413
+ * @returns All unique message tags
414
+ * @example
415
+ * ```typescript
416
+ * const tags = await mailpit.getTags();
417
+ * ```
418
+ */
419
+ getTags() {
420
+ return __awaiter(this, void 0, void 0, function* () {
421
+ return yield this.handleRequest(() => this.axiosInstance.get(`/api/v1/tags`));
422
+ });
423
+ }
424
+ /**
425
+ * Sets and removes tag(s) on message(s). This will overwrite any existing tags for selected message database IDs.
426
+ * @param request - The request containing the message IDs and tags. To remove all tags from a message, pass an empty `Tags` array or exclude `Tags` entirely.
427
+ * @remarks
428
+ * Tags are limited to the following characters: `a-z`, `A-Z`, `0-9`, `-`, `.`, `spaces`, and `_`, and must be a minimum of 1 character.
429
+ * Other characters are silently stripped from the tag.
430
+ * @returns Plain text "ok" response
431
+ * @example
432
+ * ```typescript
433
+ * // Set tags on message(s)
434
+ * await mailpit.setTags({ IDs: ["1", "2", "3"], Tags: ["tag1", "tag2"] });
435
+ * // Remove tags from message(s)
436
+ * await mailpit.setTags({ IDs: ["1", "2", "3"]});
437
+ * ```
438
+ */
439
+ setTags(request) {
440
+ return __awaiter(this, void 0, void 0, function* () {
441
+ return yield this.handleRequest(() => this.axiosInstance.put(`/api/v1/tags`, request));
442
+ });
443
+ }
444
+ /**
445
+ * Renames an existing tag.
446
+ * @param tag - The current name of the tag.
447
+ * @param newTagName - A new name for the tag.
448
+ * @remarks
449
+ * Tags are limited to the following characters: `a-z`, `A-Z`, `0-9`, `-`, `.`, `spaces`, and `_`, and must be a minimum of 1 character.
450
+ * Other characters are silently stripped from the tag.
451
+ * @returns Plain text "ok" response
452
+ * @example
453
+ * ```typescript
454
+ * await mailpit.renameTag("Old Tag Name", "New Tag Name");
455
+ * ```
456
+ */
457
+ renameTag(tag, newTagName) {
458
+ return __awaiter(this, void 0, void 0, function* () {
459
+ const encodedTag = encodeURIComponent(tag);
460
+ return yield this.handleRequest(() => this.axiosInstance.put(`/api/v1/tags/${encodedTag}`, {
461
+ Name: newTagName,
462
+ }));
463
+ });
464
+ }
465
+ /**
466
+ * Deletes a tag from all messages.
467
+ * @param tag - The name of the tag to delete.
468
+ * @remarks This does NOT delete any messages
469
+ * @returns Plain text "ok" response
470
+ * ```typescript
471
+ * await mailpit.deleteTag("Tag 1");
472
+ * ```
473
+ */
474
+ deleteTag(tag) {
475
+ return __awaiter(this, void 0, void 0, function* () {
476
+ const encodedTag = encodeURIComponent(tag);
477
+ return yield this.handleRequest(() => this.axiosInstance.delete(`/api/v1/tags/${encodedTag}`));
478
+ });
479
+ }
480
+ /**
481
+ * Retrieves the current Chaos triggers configuration (if enabled).
482
+ * @remarks This will return an error if Chaos is not enabled at runtime.
483
+ * @returns The Chaos triggers configuration
484
+ * @example
485
+ * ```typescript
486
+ * const triggers = await mailpit.getChaosTriggers();
487
+ * ```
488
+ */
489
+ getChaosTriggers() {
490
+ return __awaiter(this, void 0, void 0, function* () {
491
+ return yield this.handleRequest(() => this.axiosInstance.get("/api/v1/chaos"));
492
+ });
493
+ }
494
+ /**
495
+ * Sets and/or resets the Chaos triggers configuration (if enabled).
496
+ * @param triggers - The request containing the chaos triggers. Omitted triggers will reset to the default `0%` probabibility.
497
+ * @remarks This will return an error if Chaos is not enabled at runtime.
498
+ * @returns The updated Chaos triggers configuration
499
+ * @example
500
+ * ```typescript
501
+ * // Reset all triggers to `0%` probability
502
+ * const triggers = await mailpit.setChaosTriggers();
503
+ * // Set `Sender` and reset `Authentication` and `Recipient` triggers
504
+ * const triggers = await mailpit.setChaosTriggers({ Sender: { ErrorCode: 451, Probability: 5 } });
505
+ * ```
506
+ */
507
+ setChaosTriggers() {
508
+ return __awaiter(this, arguments, void 0, function* (triggers = {}) {
509
+ return yield this.handleRequest(() => this.axiosInstance.put("/api/v1/chaos", triggers));
510
+ });
511
+ }
512
+ /**
513
+ * Renders the HTML part of a specific message which can be used for UI integration testing.
514
+ * @remarks
515
+ * Attached inline images are modified to link to the API provided they exist.
516
+ * If the message does not contain an HTML part then a 404 error is returned.
517
+ *
518
+ *
519
+ * @param id - The message database ID. Defaults to `latest` to return the latest message.
520
+ * @param embed - Whether this route is to be embedded in an iframe. Defaults to `undefined`. Set to `1` to embed.
521
+ * The `embed` parameter will add `target="_blank"` and `rel="noreferrer noopener"` to all links.
522
+ * In addition, a small script will be added to the end of the document to post (postMessage()) the height of the document back to the parent window for optional iframe height resizing.
523
+ * Note that this will also transform the message into a full HTML document (if it isn't already), so this option is useful for viewing but not programmatic testing.
524
+ * @returns Rendered HTML
525
+ * @example
526
+ * ```typescript
527
+ * const html = await mailpit.renderMessageHTML();
528
+ * ```
529
+ */
530
+ renderMessageHTML() {
531
+ return __awaiter(this, arguments, void 0, function* (id = "latest", embed) {
532
+ return yield this.handleRequest(() => this.axiosInstance.get(`/view/${id}.html`, { params: { embed } }));
533
+ });
534
+ }
535
+ /**
536
+ * Renders just the message's text part which can be used for UI integration testing.
537
+ * @param id - The message database ID. Defaults to `latest` to return the latest message.
538
+ * @returns Plain text
539
+ * @example
540
+ * ```typescript
541
+ * const html = await mailpit.renderMessageText();
542
+ * ```
543
+ */
544
+ renderMessageText() {
545
+ return __awaiter(this, arguments, void 0, function* (id = "latest") {
546
+ return yield this.handleRequest(() => this.axiosInstance.get(`/view/${id}.txt`));
547
+ });
548
+ }
549
+ }
550
+ exports.MailpitClient = MailpitClient;