-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93bcab7
commit 045be37
Showing
31 changed files
with
829 additions
and
1,171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import type { AgentRPCRequestParams, AgentRPCResponseResult } from '../types'; | ||
import type { EchoMessage } from './types'; | ||
import type { | ||
AgentClaimMessage, | ||
ClaimIdMessage, | ||
GitPackMessage, | ||
HolePunchRelayMessage, | ||
NodeAddressMessage, | ||
NodeIdMessage, | ||
SignedNotificationEncoded, | ||
VaultInfo, | ||
VaultsGitInfoGetMessage, | ||
VaultsGitPackGetMessage, | ||
VaultsScanMessage, | ||
} from './types'; | ||
import { DuplexCaller, ServerCaller, UnaryCaller } from '../../rpc/callers'; | ||
|
||
const echo = new UnaryCaller< | ||
AgentRPCRequestParams<EchoMessage>, | ||
AgentRPCResponseResult<EchoMessage> | ||
>(); | ||
|
||
const nodeChainDataGet = new ServerCaller< | ||
AgentRPCRequestParams<ClaimIdMessage>, | ||
AgentRPCResponseResult<AgentClaimMessage> | ||
>(); | ||
|
||
// Const nodesClaimsGet = new UnaryCaller< | ||
// AgentRPCRequestParams, | ||
// AgentRPCResponseResult | ||
// >(); | ||
|
||
const nodesClosestLocalNodesGet = new ServerCaller< | ||
AgentRPCRequestParams<NodeIdMessage>, | ||
AgentRPCResponseResult<NodeAddressMessage> | ||
>(); | ||
|
||
// TODO: still to be completed | ||
const nodesCrossSignClaim = new DuplexCaller< | ||
AgentRPCRequestParams<EchoMessage>, | ||
AgentRPCResponseResult<EchoMessage> | ||
>(); | ||
|
||
// TODO: still to be completed | ||
const nodesHolePunchMessageSend = new UnaryCaller< | ||
AgentRPCRequestParams<HolePunchRelayMessage>, | ||
AgentRPCResponseResult | ||
>(); | ||
|
||
const notificationsSend = new UnaryCaller< | ||
AgentRPCRequestParams<SignedNotificationEncoded>, | ||
AgentRPCResponseResult | ||
>(); | ||
|
||
const vaultsGitInfoGet = new ServerCaller< | ||
AgentRPCRequestParams<VaultsGitInfoGetMessage>, | ||
AgentRPCResponseResult<VaultInfo | GitPackMessage> | ||
>(); | ||
|
||
const vaultsGitPackGet = new ServerCaller< | ||
AgentRPCRequestParams<VaultsGitPackGetMessage>, | ||
AgentRPCResponseResult<GitPackMessage> | ||
>(); | ||
|
||
const vaultsScan = new ServerCaller< | ||
AgentRPCRequestParams, | ||
AgentRPCResponseResult<VaultsScanMessage> | ||
>(); | ||
|
||
// No type used here, it will override type inference | ||
const clientManifest = { | ||
echo, | ||
nodeChainDataGet, | ||
// NodeClaimsGet, | ||
nodesClosestLocalNodesGet, | ||
nodesCrossSignClaim, | ||
nodesHolePunchMessageSend, | ||
notificationsSend, | ||
vaultsGitInfoGet, | ||
vaultsGitPackGet, | ||
vaultsScan, | ||
}; | ||
|
||
export { | ||
clientManifest, | ||
echo, | ||
nodeChainDataGet, | ||
// NodeClaimsGet, | ||
nodesClosestLocalNodesGet, | ||
nodesCrossSignClaim, | ||
nodesHolePunchMessageSend, | ||
notificationsSend, | ||
vaultsGitInfoGet, | ||
vaultsGitPackGet, | ||
vaultsScan, | ||
}; |
Oops, something went wrong.