File tree Expand file tree Collapse file tree 6 files changed +35
-21
lines changed
Expand file tree Collapse file tree 6 files changed +35
-21
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ import nodesFind from './nodesFind.js';
4646import nodesGetAll from './nodesGetAll.js' ;
4747import nodesListConnections from './nodesListConnections.js' ;
4848import nodesPing from './nodesPing.js' ;
49+ import nodesSyncGraph from './nodesSyncGraph.js' ;
4950import notificationsInboxClear from './notificationsInboxClear.js' ;
5051import notificationsInboxRead from './notificationsInboxRead.js' ;
5152import notificationsInboxRemove from './notificationsInboxRemove.js' ;
@@ -128,6 +129,7 @@ const clientManifest = {
128129 nodesGetAll,
129130 nodesListConnections,
130131 nodesPing,
132+ nodesSyncGraph,
131133 notificationsInboxClear,
132134 notificationsInboxRead,
133135 notificationsInboxRemove,
@@ -209,6 +211,7 @@ export {
209211 nodesGetAll ,
210212 nodesListConnections ,
211213 nodesPing ,
214+ nodesSyncGraph ,
212215 notificationsInboxClear ,
213216 notificationsInboxRead ,
214217 notificationsInboxRemove ,
Original file line number Diff line number Diff line change 1+ import type { HandlerTypes } from '@matrixai/rpc' ;
2+ import type NodesSyncGraph from '../handlers/NodesSyncGraph.js' ;
3+ import { UnaryCaller } from '@matrixai/rpc' ;
4+
5+ type CallerTypes = HandlerTypes < NodesSyncGraph > ;
6+
7+ const nodesSyncGraph = new UnaryCaller <
8+ CallerTypes [ 'input' ] ,
9+ CallerTypes [ 'output' ]
10+ > ( ) ;
11+
12+ export default nodesSyncGraph ;
Original file line number Diff line number Diff line change 11import type { ContextTimed } from '@matrixai/contexts' ;
22import type { JSONValue } from '@matrixai/rpc' ;
3- import type NodeManager from '../../NodeManager.js' ;
3+ import type NodeManager from '../../nodes/ NodeManager.js' ;
44import type {
5- AgentRPCRequestParams ,
6- AgentRPCResponseResult ,
5+ ClientRPCRequestParams ,
6+ ClientRPCResponseResult ,
77 NodesSyncGraphMessage ,
88} from '../types.js' ;
9- import type { AgentClientManifest } from '../callers/index.js' ;
9+ import type { AgentClientManifest } from '../../nodes/agent/ callers/index.js' ;
1010import { UnaryHandler } from '@matrixai/rpc' ;
1111
1212class NodesSyncGraph extends UnaryHandler <
1313 {
1414 nodeManager : NodeManager < AgentClientManifest > ;
1515 } ,
16- AgentRPCRequestParams < NodesSyncGraphMessage > ,
17- AgentRPCResponseResult
16+ ClientRPCRequestParams < NodesSyncGraphMessage > ,
17+ ClientRPCResponseResult
1818> {
1919 public handle = async (
20- input : AgentRPCRequestParams < NodesSyncGraphMessage > ,
20+ input : ClientRPCRequestParams < NodesSyncGraphMessage > ,
2121 _cancel : ( reason ?: any ) => void ,
2222 _meta : Record < string , JSONValue > | undefined ,
2323 ctx : ContextTimed ,
24- ) : Promise < AgentRPCResponseResult > => {
24+ ) : Promise < ClientRPCResponseResult > => {
2525 const {
2626 nodeManager,
2727 } : {
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ import NodesFind from './NodesFind.js';
6464import NodesGetAll from './NodesGetAll.js' ;
6565import NodesListConnections from './NodesListConnections.js' ;
6666import NodesPing from './NodesPing.js' ;
67+ import NodesSyncGraph from './NodesSyncGraph.js' ;
6768import NotificationsInboxClear from './NotificationsInboxClear.js' ;
6869import NotificationsInboxRead from './NotificationsInboxRead.js' ;
6970import NotificationsInboxRemove from './NotificationsInboxRemove.js' ;
@@ -169,6 +170,7 @@ const serverManifest = (container: {
169170 nodesGetAll : new NodesGetAll ( container ) ,
170171 nodesListConnections : new NodesListConnections ( container ) ,
171172 nodesPing : new NodesPing ( container ) ,
173+ nodesSyncGraph : new NodesSyncGraph ( container ) ,
172174 notificationsInboxClear : new NotificationsInboxClear ( container ) ,
173175 notificationsInboxRead : new NotificationsInboxRead ( container ) ,
174176 notificationsInboxRemove : new NotificationsInboxRemove ( container ) ,
@@ -252,6 +254,7 @@ export {
252254 NodesGetAll ,
253255 NodesListConnections ,
254256 NodesPing ,
257+ NodesSyncGraph ,
255258 NotificationsInboxClear ,
256259 NotificationsInboxRead ,
257260 NotificationsInboxRemove ,
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import type {
2727 NodeContact ,
2828 NodeAddress ,
2929 NodeContactAddressData ,
30+ NodeId ,
3031} from '../nodes/types.js' ;
3132import type { AuditEventsGetTypeOverride } from './callers/auditEventsGet.js' ;
3233
@@ -151,6 +152,12 @@ type NodeConnectionMessage = NodeAddressMessage & {
151152 authenticated : boolean ;
152153} ;
153154
155+ type NodesSyncGraphMessage = {
156+ network : string ;
157+ initialNodes : Array < [ NodeId , NodeAddress ] > ;
158+ connectionTimeout ?: number ;
159+ } ;
160+
154161// Gestalts messages
155162
156163type ActionsListMessage = {
@@ -428,6 +435,7 @@ export type {
428435 NodeAddressMessage ,
429436 NodesFindMessage ,
430437 NodeConnectionMessage ,
438+ NodesSyncGraphMessage ,
431439 ActionsListMessage ,
432440 SetIdentityActionMessage ,
433441 SetNodeActionMessage ,
Original file line number Diff line number Diff line change @@ -13,12 +13,7 @@ import type {
1313import type { VaultAction , VaultName } from '../../vaults/types.js' ;
1414import type { SignedNotification } from '../../notifications/types.js' ;
1515import type { Host , Hostname , Port } from '../../network/types.js' ;
16- import type {
17- NetworkId ,
18- NodeContact ,
19- NodeId ,
20- NodeAddress ,
21- } from '../../nodes/types.js' ;
16+ import type { NetworkId , NodeContact } from '../../nodes/types.js' ;
2217import type { AuditEvent } from '../../audit/types.js' ;
2318import type { SignedClaimEncoded } from '../../claims/types.js' ;
2419
@@ -130,12 +125,6 @@ type NodesAuthenticateConnectionMessageNone = {
130125 type : 'NodesAuthenticateConnectionMessageNone' ;
131126} ;
132127
133- type NodesSyncGraphMessage = {
134- network : string ;
135- initialNodes : Array < [ NodeId , NodeAddress ] > ;
136- connectionTimeout : number ;
137- } ;
138-
139128export type {
140129 AgentRPCRequestParams ,
141130 AgentRPCResponseResult ,
@@ -158,5 +147,4 @@ export type {
158147 NodesAuthenticateConnectionMessagePrivate ,
159148 NodesAuthenticateConnectionMessageBasicPublic ,
160149 NodesAuthenticateConnectionMessageNone ,
161- NodesSyncGraphMessage ,
162150} ;
You can’t perform that action at this time.
0 commit comments