2022-11-04 09:52:27 +00:00
|
|
|
when (NimMajor, NimMinor) < (1, 4):
|
|
|
|
{.push raises: [Defect].}
|
|
|
|
else:
|
|
|
|
{.push raises: [].}
|
2022-07-25 11:01:37 +00:00
|
|
|
|
|
|
|
import
|
2022-09-28 11:36:05 +00:00
|
|
|
../../utils/time,
|
2022-11-04 09:52:08 +00:00
|
|
|
../waku_message,
|
2022-09-28 11:36:05 +00:00
|
|
|
./pagination
|
2022-07-25 11:01:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
HistoryContentFilter* = object
|
|
|
|
contentTopic*: ContentTopic
|
|
|
|
|
|
|
|
HistoryQuery* = object
|
|
|
|
contentFilters*: seq[HistoryContentFilter]
|
|
|
|
pubsubTopic*: string
|
|
|
|
pagingInfo*: PagingInfo # used for pagination
|
|
|
|
startTime*: Timestamp # used for time-window query
|
|
|
|
endTime*: Timestamp # used for time-window query
|
|
|
|
|
|
|
|
HistoryResponseError* {.pure.} = enum
|
|
|
|
## HistoryResponseError contains error message to inform the querying node about the state of its request
|
|
|
|
NONE = uint32(0)
|
|
|
|
INVALID_CURSOR = uint32(1)
|
2022-09-20 09:39:52 +00:00
|
|
|
SERVICE_UNAVAILABLE = uint32(503)
|
2022-07-25 11:01:37 +00:00
|
|
|
|
|
|
|
HistoryResponse* = object
|
|
|
|
messages*: seq[WakuMessage]
|
|
|
|
pagingInfo*: PagingInfo # used for pagination
|
|
|
|
error*: HistoryResponseError
|
|
|
|
|
|
|
|
HistoryRPC* = object
|
|
|
|
requestId*: string
|
|
|
|
query*: HistoryQuery
|
|
|
|
response*: HistoryResponse
|