2022-02-01 10:41:21 +01:00
|
|
|
import json
|
|
|
|
import core
|
2022-01-06 13:04:38 -04:00
|
|
|
import response_type
|
|
|
|
|
|
|
|
export response_type
|
|
|
|
|
|
|
|
proc saveMailserver*(id: string, name: string, enode: string, fleet: string):
|
|
|
|
RpcResponse[JsonNode] {.raises: [Exception].} =
|
|
|
|
let payload = %* [{
|
|
|
|
"id": id,
|
|
|
|
"name": name,
|
|
|
|
"address": enode,
|
|
|
|
"fleet": fleet
|
|
|
|
}]
|
2022-01-05 14:11:50 +01:00
|
|
|
result = core.callPrivateRPC("mailservers_addMailserver", payload)
|
2022-01-06 13:04:38 -04:00
|
|
|
|
|
|
|
proc getMailservers*(): RpcResponse[JsonNode] {.raises: [Exception].} =
|
2022-01-05 14:11:50 +01:00
|
|
|
result = core.callPrivateRPC("mailservers_getMailservers")
|