mailpit-api 1.3.1 → 1.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.
@@ -1,19 +1,19 @@
1
1
  /** Represents a name and email address for a request. */
2
- export interface MailpitEmailAddressRequest {
2
+ interface MailpitEmailAddressRequest {
3
3
  /** Email address */
4
4
  Email: string;
5
5
  /** Optional name associated with the email address */
6
6
  Name?: string;
7
7
  }
8
8
  /** Represents a name and email address from a response. */
9
- export interface MailpitEmailAddressResponse {
9
+ interface MailpitEmailAddressResponse {
10
10
  /** Email address */
11
11
  Address: string;
12
12
  /** Name associated with the email address */
13
13
  Name: string;
14
14
  }
15
15
  /** Represents an attachment for a request. */
16
- export interface MailpitAttachmentRequest {
16
+ interface MailpitAttachmentRequest {
17
17
  /** Base64-encoded string for the file content */
18
18
  Content: string;
19
19
  /** Optional Content-ID (cid) for attachment. If this field is set then the file is attached inline. */
@@ -24,7 +24,7 @@ export interface MailpitAttachmentRequest {
24
24
  Filename: string;
25
25
  }
26
26
  /** Represents an attachment from a response. */
27
- export interface MailpitAttachmentResponse {
27
+ interface MailpitAttachmentResponse {
28
28
  /** Content ID */
29
29
  ContentID: string;
30
30
  /** Content type */
@@ -37,29 +37,29 @@ export interface MailpitAttachmentResponse {
37
37
  Size: number;
38
38
  }
39
39
  /** Represents information about a Chaos trigger */
40
- export interface MailpitChaosTrigger {
40
+ interface MailpitChaosTrigger {
41
41
  /** SMTP error code to return. The value must range from 400 to 599. */
42
42
  ErrorCode: number;
43
43
  /** Probability (chance) of triggering the error. The value must range from 0 to 100. */
44
44
  Probability: number;
45
45
  }
46
46
  /** Common request parameters for APIs with a search query */
47
- export interface MailpitSearchRequest extends MailpitTimeZoneRequest {
47
+ interface MailpitSearchRequest extends MailpitTimeZoneRequest {
48
48
  /** {@link https://mailpit.axllent.org/docs/usage/search-filters/ | Search query} */
49
49
  query: string;
50
50
  }
51
51
  /** Common request parameters for APIs with a search query and time zone option */
52
- export interface MailpitTimeZoneRequest {
52
+ interface MailpitTimeZoneRequest {
53
53
  /** {@link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones | Timezone identifier} used only for `before:` & `after:` searches (eg: "Pacific/Auckland"). */
54
54
  tz?: string;
55
55
  }
56
56
  /** Common request parameters for APIs requiring a list of message database IDs */
57
- export interface MailpitDatabaseIDsRequest {
57
+ interface MailpitDatabaseIDsRequest {
58
58
  /** Array of message database IDs */
59
59
  IDs?: string[];
60
60
  }
61
61
  /** Response for the {@link MailpitClient.getInfo | getInfo()} API containing information about the Mailpit instance. */
62
- export interface MailpitInfoResponse {
62
+ interface MailpitInfoResponse {
63
63
  /** Database path */
64
64
  Database: string;
65
65
  /** Datacase size in bytes */
@@ -96,7 +96,7 @@ export interface MailpitInfoResponse {
96
96
  Version: string;
97
97
  }
98
98
  /** Response for the {@link MailpitClient.getConfiguration| getConfiguraton()} API containing configuration for the Mailpit web UI. */
99
- export interface MailpitConfigurationResponse {
99
+ interface MailpitConfigurationResponse {
100
100
  /** Whether Chaos support is enabled at runtime */
101
101
  ChaosEnabled: boolean;
102
102
  /** Whether messages with duplicate IDs are ignored */
@@ -121,7 +121,7 @@ export interface MailpitConfigurationResponse {
121
121
  SpamAssassin: boolean;
122
122
  }
123
123
  /** Response for the {@link MailpitClient.getMessageSummary| getMessageSummary()} API containing the summary of a message */
124
- export interface MailpitMessageSummaryResponse {
124
+ interface MailpitMessageSummaryResponse {
125
125
  /** Message Attachmets */
126
126
  Attachments: MailpitAttachmentResponse[];
127
127
  /** BCC addresses */
@@ -167,7 +167,7 @@ export interface MailpitMessageSummaryResponse {
167
167
  To: MailpitEmailAddressResponse[];
168
168
  }
169
169
  /** Response for the {@link MailpitClient.listMessages| listMessages()} API containing the summary of multiple messages. */
170
- export interface MailpitMessagesSummaryResponse {
170
+ interface MailpitMessagesSummaryResponse {
171
171
  /** Messages */
172
172
  messages: {
173
173
  /** The number of attachments */
@@ -213,12 +213,12 @@ export interface MailpitMessagesSummaryResponse {
213
213
  unread: number;
214
214
  }
215
215
  /** Response for the {@link MailpitClient.getMessageHeaders | getMessageHeaders()} API containing message headers */
216
- export interface MailpitMessageHeadersResponse {
216
+ interface MailpitMessageHeadersResponse {
217
217
  /** Message headers */
218
218
  [key: string]: [string];
219
219
  }
220
220
  /** Request parameters for the {@link MailpitClient.sendMessage | sendMessage()} API. */
221
- export interface MailpitSendRequest {
221
+ interface MailpitSendRequest {
222
222
  /** Attachments */
223
223
  Attachments?: MailpitAttachmentRequest[];
224
224
  /** Bcc recipients email addresses only */
@@ -246,12 +246,12 @@ export interface MailpitSendRequest {
246
246
  To: MailpitEmailAddressRequest[];
247
247
  }
248
248
  /** Response for the {@link MailpitClient.sendMessage | sendMessage()} API containing confirmation identifier. */
249
- export interface MailpitSendMessageConfirmationResponse {
249
+ interface MailpitSendMessageConfirmationResponse {
250
250
  /** Confirmation message ID */
251
251
  ID: string;
252
252
  }
253
253
  /** Response from the {@link MailpitClient.htmlCheck | htmlCheck()} API containing HTML check results. */
254
- export interface MailpitHTMLCheckResponse {
254
+ interface MailpitHTMLCheckResponse {
255
255
  /** All platforms tested, mainly for the web UI */
256
256
  Platforms: {
257
257
  [key: string]: [string];
@@ -319,7 +319,7 @@ export interface MailpitHTMLCheckResponse {
319
319
  }[];
320
320
  }
321
321
  /** Response from the {@link MailpitClient.linkCheck | linkCheck()} API containing link check results. */
322
- export interface MailpitLinkCheckResponse {
322
+ interface MailpitLinkCheckResponse {
323
323
  /** Total number of errors */
324
324
  Errors: number;
325
325
  /** Tested links */
@@ -333,7 +333,7 @@ export interface MailpitLinkCheckResponse {
333
333
  }[];
334
334
  }
335
335
  /** Response from the {@link MailpitClient.spamAssassinCheck | spamAssassinCheck()} API containing containing SpamAssassin check results. */
336
- export interface MailpitSpamAssassinResponse {
336
+ interface MailpitSpamAssassinResponse {
337
337
  /** If populated will return an error string */
338
338
  Errors: number;
339
339
  /** Whether the message is spam or not */
@@ -351,7 +351,7 @@ export interface MailpitSpamAssassinResponse {
351
351
  Score: number;
352
352
  }
353
353
  /** Request parameters for the {@link MailpitClient.setReadStatus | setReadStatus()} API. */
354
- export interface MailpitReadStatusRequest extends MailpitDatabaseIDsRequest {
354
+ interface MailpitReadStatusRequest extends MailpitDatabaseIDsRequest {
355
355
  /**
356
356
  * Read status
357
357
  * @defaultValue false
@@ -361,21 +361,21 @@ export interface MailpitReadStatusRequest extends MailpitDatabaseIDsRequest {
361
361
  Search?: string;
362
362
  }
363
363
  /** Request parameters for the {@link MailpitClient.searchMessages | searchMessages()} API. */
364
- export interface MailpitSearchMessagesRequest extends MailpitSearchRequest {
364
+ interface MailpitSearchMessagesRequest extends MailpitSearchRequest {
365
365
  /** Pagination offset */
366
366
  start?: number;
367
367
  /** Limit results */
368
368
  limit?: number;
369
369
  }
370
370
  /** Request parameters for the {@link MailpitClient.setTags | setTags()} API. */
371
- export interface MailpitSetTagsRequest {
371
+ interface MailpitSetTagsRequest {
372
372
  /** Array of message database IDs */
373
373
  IDs: string[];
374
374
  /** Array of tag names to set */
375
375
  Tags?: string[];
376
376
  }
377
377
  /** Request parameters for the {@link MailpitClient.setChaosTriggers | setChaosTriggers()} API. */
378
- export interface MailpitChaosTriggersRequest {
378
+ interface MailpitChaosTriggersRequest {
379
379
  /** Optional Authentication trigger for Chaos */
380
380
  Authentication?: MailpitChaosTrigger;
381
381
  /** Optional Recipient trigger for Chaos */
@@ -384,7 +384,7 @@ export interface MailpitChaosTriggersRequest {
384
384
  Sender?: MailpitChaosTrigger;
385
385
  }
386
386
  /** Response for the {@link MailpitClient.setChaosTriggers | setChaosTriggers()} and {@link MailpitClient.getChaosTriggers | getChaosTriggers()} APIs containing the current chaos triggers. */
387
- export interface MailpitChaosTriggersResponse {
387
+ interface MailpitChaosTriggersResponse {
388
388
  /** Authentication trigger for Chaos */
389
389
  Authentication: MailpitChaosTrigger;
390
390
  /** Recipient trigger for Chaos */
@@ -393,7 +393,7 @@ export interface MailpitChaosTriggersResponse {
393
393
  Sender: MailpitChaosTrigger;
394
394
  }
395
395
  /** Response for the {@link MailpitClient.getMessageAttachment |getMessageAttachment()} and {@link MailpitClient.getAttachmentThumbnail | getAttachmentThumbnail()} APIs containing attachment data */
396
- export interface MailpitAttachmentDataResponse {
396
+ interface MailpitAttachmentDataResponse {
397
397
  /** The attachment binary data */
398
398
  data: ArrayBuffer;
399
399
  /** The attachment MIME type */
@@ -408,7 +408,7 @@ export interface MailpitAttachmentDataResponse {
408
408
  * console.log(await mailpit.getInfo());
409
409
  * ```
410
410
  */
411
- export declare class MailpitClient {
411
+ declare class MailpitClient {
412
412
  private axiosInstance;
413
413
  /**
414
414
  * Creates an instance of {@link MailpitClient}.
@@ -770,3 +770,5 @@ export declare class MailpitClient {
770
770
  */
771
771
  renderMessageText(id?: string): Promise<string>;
772
772
  }
773
+
774
+ export { type MailpitAttachmentDataResponse, type MailpitAttachmentRequest, type MailpitAttachmentResponse, type MailpitChaosTrigger, type MailpitChaosTriggersRequest, type MailpitChaosTriggersResponse, MailpitClient, type MailpitConfigurationResponse, type MailpitDatabaseIDsRequest, type MailpitEmailAddressRequest, type MailpitEmailAddressResponse, type MailpitHTMLCheckResponse, type MailpitInfoResponse, type MailpitLinkCheckResponse, type MailpitMessageHeadersResponse, type MailpitMessageSummaryResponse, type MailpitMessagesSummaryResponse, type MailpitReadStatusRequest, type MailpitSearchMessagesRequest, type MailpitSearchRequest, type MailpitSendMessageConfirmationResponse, type MailpitSendRequest, type MailpitSetTagsRequest, type MailpitSpamAssassinResponse, type MailpitTimeZoneRequest };
@@ -1,19 +1,19 @@
1
1
  /** Represents a name and email address for a request. */
2
- export interface MailpitEmailAddressRequest {
2
+ interface MailpitEmailAddressRequest {
3
3
  /** Email address */
4
4
  Email: string;
5
5
  /** Optional name associated with the email address */
6
6
  Name?: string;
7
7
  }
8
8
  /** Represents a name and email address from a response. */
9
- export interface MailpitEmailAddressResponse {
9
+ interface MailpitEmailAddressResponse {
10
10
  /** Email address */
11
11
  Address: string;
12
12
  /** Name associated with the email address */
13
13
  Name: string;
14
14
  }
15
15
  /** Represents an attachment for a request. */
16
- export interface MailpitAttachmentRequest {
16
+ interface MailpitAttachmentRequest {
17
17
  /** Base64-encoded string for the file content */
18
18
  Content: string;
19
19
  /** Optional Content-ID (cid) for attachment. If this field is set then the file is attached inline. */
@@ -24,7 +24,7 @@ export interface MailpitAttachmentRequest {
24
24
  Filename: string;
25
25
  }
26
26
  /** Represents an attachment from a response. */
27
- export interface MailpitAttachmentResponse {
27
+ interface MailpitAttachmentResponse {
28
28
  /** Content ID */
29
29
  ContentID: string;
30
30
  /** Content type */
@@ -37,29 +37,29 @@ export interface MailpitAttachmentResponse {
37
37
  Size: number;
38
38
  }
39
39
  /** Represents information about a Chaos trigger */
40
- export interface MailpitChaosTrigger {
40
+ interface MailpitChaosTrigger {
41
41
  /** SMTP error code to return. The value must range from 400 to 599. */
42
42
  ErrorCode: number;
43
43
  /** Probability (chance) of triggering the error. The value must range from 0 to 100. */
44
44
  Probability: number;
45
45
  }
46
46
  /** Common request parameters for APIs with a search query */
47
- export interface MailpitSearchRequest extends MailpitTimeZoneRequest {
47
+ interface MailpitSearchRequest extends MailpitTimeZoneRequest {
48
48
  /** {@link https://mailpit.axllent.org/docs/usage/search-filters/ | Search query} */
49
49
  query: string;
50
50
  }
51
51
  /** Common request parameters for APIs with a search query and time zone option */
52
- export interface MailpitTimeZoneRequest {
52
+ interface MailpitTimeZoneRequest {
53
53
  /** {@link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones | Timezone identifier} used only for `before:` & `after:` searches (eg: "Pacific/Auckland"). */
54
54
  tz?: string;
55
55
  }
56
56
  /** Common request parameters for APIs requiring a list of message database IDs */
57
- export interface MailpitDatabaseIDsRequest {
57
+ interface MailpitDatabaseIDsRequest {
58
58
  /** Array of message database IDs */
59
59
  IDs?: string[];
60
60
  }
61
61
  /** Response for the {@link MailpitClient.getInfo | getInfo()} API containing information about the Mailpit instance. */
62
- export interface MailpitInfoResponse {
62
+ interface MailpitInfoResponse {
63
63
  /** Database path */
64
64
  Database: string;
65
65
  /** Datacase size in bytes */
@@ -96,7 +96,7 @@ export interface MailpitInfoResponse {
96
96
  Version: string;
97
97
  }
98
98
  /** Response for the {@link MailpitClient.getConfiguration| getConfiguraton()} API containing configuration for the Mailpit web UI. */
99
- export interface MailpitConfigurationResponse {
99
+ interface MailpitConfigurationResponse {
100
100
  /** Whether Chaos support is enabled at runtime */
101
101
  ChaosEnabled: boolean;
102
102
  /** Whether messages with duplicate IDs are ignored */
@@ -121,7 +121,7 @@ export interface MailpitConfigurationResponse {
121
121
  SpamAssassin: boolean;
122
122
  }
123
123
  /** Response for the {@link MailpitClient.getMessageSummary| getMessageSummary()} API containing the summary of a message */
124
- export interface MailpitMessageSummaryResponse {
124
+ interface MailpitMessageSummaryResponse {
125
125
  /** Message Attachmets */
126
126
  Attachments: MailpitAttachmentResponse[];
127
127
  /** BCC addresses */
@@ -167,7 +167,7 @@ export interface MailpitMessageSummaryResponse {
167
167
  To: MailpitEmailAddressResponse[];
168
168
  }
169
169
  /** Response for the {@link MailpitClient.listMessages| listMessages()} API containing the summary of multiple messages. */
170
- export interface MailpitMessagesSummaryResponse {
170
+ interface MailpitMessagesSummaryResponse {
171
171
  /** Messages */
172
172
  messages: {
173
173
  /** The number of attachments */
@@ -213,12 +213,12 @@ export interface MailpitMessagesSummaryResponse {
213
213
  unread: number;
214
214
  }
215
215
  /** Response for the {@link MailpitClient.getMessageHeaders | getMessageHeaders()} API containing message headers */
216
- export interface MailpitMessageHeadersResponse {
216
+ interface MailpitMessageHeadersResponse {
217
217
  /** Message headers */
218
218
  [key: string]: [string];
219
219
  }
220
220
  /** Request parameters for the {@link MailpitClient.sendMessage | sendMessage()} API. */
221
- export interface MailpitSendRequest {
221
+ interface MailpitSendRequest {
222
222
  /** Attachments */
223
223
  Attachments?: MailpitAttachmentRequest[];
224
224
  /** Bcc recipients email addresses only */
@@ -246,12 +246,12 @@ export interface MailpitSendRequest {
246
246
  To: MailpitEmailAddressRequest[];
247
247
  }
248
248
  /** Response for the {@link MailpitClient.sendMessage | sendMessage()} API containing confirmation identifier. */
249
- export interface MailpitSendMessageConfirmationResponse {
249
+ interface MailpitSendMessageConfirmationResponse {
250
250
  /** Confirmation message ID */
251
251
  ID: string;
252
252
  }
253
253
  /** Response from the {@link MailpitClient.htmlCheck | htmlCheck()} API containing HTML check results. */
254
- export interface MailpitHTMLCheckResponse {
254
+ interface MailpitHTMLCheckResponse {
255
255
  /** All platforms tested, mainly for the web UI */
256
256
  Platforms: {
257
257
  [key: string]: [string];
@@ -319,7 +319,7 @@ export interface MailpitHTMLCheckResponse {
319
319
  }[];
320
320
  }
321
321
  /** Response from the {@link MailpitClient.linkCheck | linkCheck()} API containing link check results. */
322
- export interface MailpitLinkCheckResponse {
322
+ interface MailpitLinkCheckResponse {
323
323
  /** Total number of errors */
324
324
  Errors: number;
325
325
  /** Tested links */
@@ -333,7 +333,7 @@ export interface MailpitLinkCheckResponse {
333
333
  }[];
334
334
  }
335
335
  /** Response from the {@link MailpitClient.spamAssassinCheck | spamAssassinCheck()} API containing containing SpamAssassin check results. */
336
- export interface MailpitSpamAssassinResponse {
336
+ interface MailpitSpamAssassinResponse {
337
337
  /** If populated will return an error string */
338
338
  Errors: number;
339
339
  /** Whether the message is spam or not */
@@ -351,7 +351,7 @@ export interface MailpitSpamAssassinResponse {
351
351
  Score: number;
352
352
  }
353
353
  /** Request parameters for the {@link MailpitClient.setReadStatus | setReadStatus()} API. */
354
- export interface MailpitReadStatusRequest extends MailpitDatabaseIDsRequest {
354
+ interface MailpitReadStatusRequest extends MailpitDatabaseIDsRequest {
355
355
  /**
356
356
  * Read status
357
357
  * @defaultValue false
@@ -361,21 +361,21 @@ export interface MailpitReadStatusRequest extends MailpitDatabaseIDsRequest {
361
361
  Search?: string;
362
362
  }
363
363
  /** Request parameters for the {@link MailpitClient.searchMessages | searchMessages()} API. */
364
- export interface MailpitSearchMessagesRequest extends MailpitSearchRequest {
364
+ interface MailpitSearchMessagesRequest extends MailpitSearchRequest {
365
365
  /** Pagination offset */
366
366
  start?: number;
367
367
  /** Limit results */
368
368
  limit?: number;
369
369
  }
370
370
  /** Request parameters for the {@link MailpitClient.setTags | setTags()} API. */
371
- export interface MailpitSetTagsRequest {
371
+ interface MailpitSetTagsRequest {
372
372
  /** Array of message database IDs */
373
373
  IDs: string[];
374
374
  /** Array of tag names to set */
375
375
  Tags?: string[];
376
376
  }
377
377
  /** Request parameters for the {@link MailpitClient.setChaosTriggers | setChaosTriggers()} API. */
378
- export interface MailpitChaosTriggersRequest {
378
+ interface MailpitChaosTriggersRequest {
379
379
  /** Optional Authentication trigger for Chaos */
380
380
  Authentication?: MailpitChaosTrigger;
381
381
  /** Optional Recipient trigger for Chaos */
@@ -384,7 +384,7 @@ export interface MailpitChaosTriggersRequest {
384
384
  Sender?: MailpitChaosTrigger;
385
385
  }
386
386
  /** Response for the {@link MailpitClient.setChaosTriggers | setChaosTriggers()} and {@link MailpitClient.getChaosTriggers | getChaosTriggers()} APIs containing the current chaos triggers. */
387
- export interface MailpitChaosTriggersResponse {
387
+ interface MailpitChaosTriggersResponse {
388
388
  /** Authentication trigger for Chaos */
389
389
  Authentication: MailpitChaosTrigger;
390
390
  /** Recipient trigger for Chaos */
@@ -393,7 +393,7 @@ export interface MailpitChaosTriggersResponse {
393
393
  Sender: MailpitChaosTrigger;
394
394
  }
395
395
  /** Response for the {@link MailpitClient.getMessageAttachment |getMessageAttachment()} and {@link MailpitClient.getAttachmentThumbnail | getAttachmentThumbnail()} APIs containing attachment data */
396
- export interface MailpitAttachmentDataResponse {
396
+ interface MailpitAttachmentDataResponse {
397
397
  /** The attachment binary data */
398
398
  data: ArrayBuffer;
399
399
  /** The attachment MIME type */
@@ -408,7 +408,7 @@ export interface MailpitAttachmentDataResponse {
408
408
  * console.log(await mailpit.getInfo());
409
409
  * ```
410
410
  */
411
- export declare class MailpitClient {
411
+ declare class MailpitClient {
412
412
  private axiosInstance;
413
413
  /**
414
414
  * Creates an instance of {@link MailpitClient}.
@@ -770,3 +770,5 @@ export declare class MailpitClient {
770
770
  */
771
771
  renderMessageText(id?: string): Promise<string>;
772
772
  }
773
+
774
+ export { type MailpitAttachmentDataResponse, type MailpitAttachmentRequest, type MailpitAttachmentResponse, type MailpitChaosTrigger, type MailpitChaosTriggersRequest, type MailpitChaosTriggersResponse, MailpitClient, type MailpitConfigurationResponse, type MailpitDatabaseIDsRequest, type MailpitEmailAddressRequest, type MailpitEmailAddressResponse, type MailpitHTMLCheckResponse, type MailpitInfoResponse, type MailpitLinkCheckResponse, type MailpitMessageHeadersResponse, type MailpitMessageSummaryResponse, type MailpitMessagesSummaryResponse, type MailpitReadStatusRequest, type MailpitSearchMessagesRequest, type MailpitSearchRequest, type MailpitSendMessageConfirmationResponse, type MailpitSendRequest, type MailpitSetTagsRequest, type MailpitSpamAssassinResponse, type MailpitTimeZoneRequest };