2019-09-04 06:25:33 +00:00
|
|
|
Mailservers Service
|
|
|
|
================
|
|
|
|
|
|
|
|
Mailservers service provides read/write API for `Mailserver` object
|
|
|
|
which stores details about user's mailservers.
|
|
|
|
|
|
|
|
To enable this service, include `mailservers` in APIModules:
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"MailserversConfig": {
|
|
|
|
"Enabled": true
|
|
|
|
},
|
|
|
|
"APIModules": "mailservers"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
API
|
|
|
|
---
|
|
|
|
|
|
|
|
Enabling service will expose three additional methods:
|
|
|
|
|
|
|
|
#### mailservers_addMailserver
|
|
|
|
|
|
|
|
Stores `Mailserver` in the database.
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
2019-09-04 18:23:17 +00:00
|
|
|
"id": "1",
|
|
|
|
"name": "my mailserver",
|
|
|
|
"address": "enode://...",
|
|
|
|
"password": "some-pass",
|
2020-02-20 13:05:05 +00:00
|
|
|
"fleet": "prod"
|
2019-09-04 06:25:33 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### mailservers_getMailservers
|
|
|
|
|
|
|
|
Reads all saved mailservers.
|
|
|
|
|
|
|
|
#### mailservers_deleteMailserver
|
|
|
|
|
|
|
|
Deletes a mailserver specified by an ID.
|
2019-09-04 10:04:17 +00:00
|
|
|
|
|
|
|
## Mailserver requests gap service
|
|
|
|
|
|
|
|
Mailserver request gaps service provides read/write API for `MailserverRequestGap` object
|
|
|
|
which stores details about the gaps between mailserver requests.
|
|
|
|
|
|
|
|
API
|
|
|
|
---
|
|
|
|
|
|
|
|
The service exposes four methods
|
|
|
|
|
|
|
|
#### mailserverrequestgaps_addMailserverRequestGaps
|
|
|
|
|
|
|
|
Stores `MailserverRequestGap` in the database.
|
|
|
|
All fields are specified below:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"id": "1",
|
|
|
|
"chatId": "chat-id",
|
|
|
|
"from": 1,
|
|
|
|
"to": 2
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### mailservers_getMailserverRequestGaps
|
|
|
|
|
|
|
|
Reads all saved mailserver request gaps by chatID.
|
|
|
|
|
|
|
|
#### mailservers_deleteMailserverRequestGaps
|
|
|
|
|
|
|
|
Deletes all MailserverRequestGaps specified by IDs.
|
|
|
|
|
|
|
|
#### mailservers_deleteMailserverRequestGapsByChatID
|
|
|
|
|
|
|
|
Deletes all MailserverRequestGaps specified by chatID.
|
2019-09-04 18:23:17 +00:00
|
|
|
|
|
|
|
#### mailservers_addMailserverTopic
|
|
|
|
|
|
|
|
Stores `MailserverTopic` in the database.
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"topic": "topic-as-string",
|
|
|
|
"chat-ids": ["a", "list", "of", "chatIDs"],
|
|
|
|
"last-request": 1
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### mailservers_getMailserverTopics
|
|
|
|
|
|
|
|
Reads all saved mailserver topics.
|
|
|
|
|
|
|
|
#### mailservers_deleteMailserverTopic
|
|
|
|
|
|
|
|
Deletes a mailserver topic using `topic` as an identifier.
|
2019-09-06 13:02:31 +00:00
|
|
|
|
|
|
|
#### mailservers_addChatRequestRange
|
|
|
|
|
|
|
|
Stores `ChatRequestRange` in the database.
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"chat-id": "chat-id-001",
|
|
|
|
"lowest-request-from": 1567693421154,
|
|
|
|
"highest-request-to": 1567693576779
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### mailservers_getChatRequestRanges
|
|
|
|
|
|
|
|
Reads all saved chat request ranges.
|
|
|
|
|
|
|
|
#### mailservers_deleteChatRequestRange
|
|
|
|
|
|
|
|
Deletes a chat request range by `chat-id`.
|