2022-10-21 11:55:15 +02:00
|
|
|
package apiv1
|
|
|
|
|
2023-03-31 06:29:04 +02:00
|
|
|
import (
|
2023-09-25 07:08:04 +02:00
|
|
|
"github.com/axllent/mailpit/internal/htmlcheck"
|
|
|
|
"github.com/axllent/mailpit/internal/linkcheck"
|
2024-01-20 01:05:56 +02:00
|
|
|
"github.com/axllent/mailpit/internal/spamassassin"
|
2023-09-25 08:25:45 +02:00
|
|
|
"github.com/axllent/mailpit/internal/storage"
|
2023-03-31 06:29:04 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
// MessagesSummary is a summary of a list of messages
|
|
|
|
type MessagesSummary struct {
|
|
|
|
// Total number of messages in mailbox
|
2024-04-05 04:48:32 +02:00
|
|
|
Total float64 `json:"total"`
|
2023-03-31 06:29:04 +02:00
|
|
|
|
|
|
|
// Total number of unread messages in mailbox
|
2024-04-05 04:48:32 +02:00
|
|
|
Unread float64 `json:"unread"`
|
2023-03-31 06:29:04 +02:00
|
|
|
|
2023-07-12 07:21:51 +02:00
|
|
|
// Legacy - now undocumented in API specs but left for backwards compatibility.
|
|
|
|
// Removed from API documentation 2023-07-12
|
|
|
|
// swagger:ignore
|
2024-04-05 04:48:32 +02:00
|
|
|
Count float64 `json:"count"`
|
2023-03-31 06:29:04 +02:00
|
|
|
|
2023-07-12 07:21:51 +02:00
|
|
|
// Total number of messages matching current query
|
2024-04-05 04:48:32 +02:00
|
|
|
MessagesCount float64 `json:"messages_count"`
|
2023-07-12 07:21:51 +02:00
|
|
|
|
2023-03-31 06:29:04 +02:00
|
|
|
// Pagination offset
|
|
|
|
Start int `json:"start"`
|
|
|
|
|
|
|
|
// All current tags
|
|
|
|
Tags []string `json:"tags"`
|
|
|
|
|
|
|
|
// Messages summary
|
2023-10-15 08:24:06 +02:00
|
|
|
// in: body
|
2023-03-31 06:29:04 +02:00
|
|
|
Messages []storage.MessageSummary `json:"messages"`
|
|
|
|
}
|
2022-10-21 11:55:15 +02:00
|
|
|
|
|
|
|
// The following structs & aliases are provided for easy import
|
|
|
|
// and understanding of the JSON structure.
|
|
|
|
|
|
|
|
// MessageSummary - summary of a single message
|
|
|
|
type MessageSummary = storage.MessageSummary
|
|
|
|
|
|
|
|
// Message data
|
|
|
|
type Message = storage.Message
|
|
|
|
|
|
|
|
// Attachment summary
|
|
|
|
type Attachment = storage.Attachment
|
2023-07-30 07:04:06 +02:00
|
|
|
|
|
|
|
// HTMLCheckResponse summary
|
|
|
|
type HTMLCheckResponse = htmlcheck.Response
|
2023-08-16 06:59:31 +02:00
|
|
|
|
|
|
|
// LinkCheckResponse summary
|
|
|
|
type LinkCheckResponse = linkcheck.Response
|
2024-01-20 01:05:56 +02:00
|
|
|
|
|
|
|
// SpamAssassinResponse summary
|
|
|
|
type SpamAssassinResponse = spamassassin.Result
|