|
| 1 | +import type { JSONObject } from '@matrixai/rpc'; |
1 | 2 | import type { |
2 | | - JSONObject, |
3 | | - JSONRPCRequest, |
4 | | - JSONRPCResponse, |
5 | | - MiddlewareFactory, |
6 | | -} from '@matrixai/rpc'; |
7 | | -import type { DeepPartial, FileSystem, ObjectEmpty, POJO } from './types.js'; |
| 3 | + DeepPartial, |
| 4 | + FileSystem, |
| 5 | + ObjectEmpty, |
| 6 | + POJO, |
| 7 | + PolykeyAgentOptions, |
| 8 | +} from './types.js'; |
8 | 9 | import type { PolykeyWorkerManager } from './workers/types.js'; |
9 | 10 | import type { TLSConfig } from './network/types.js'; |
10 | 11 | import type { NodeAddress, NodeId, SeedNodes } from './nodes/types.js'; |
11 | | -import type { PasswordOpsLimit, PasswordMemLimit } from './keys/types.js'; |
12 | | -import type { |
13 | | - ClientRPCRequestParams, |
14 | | - ClientRPCResponseResult, |
15 | | -} from './client/types.js'; |
16 | 12 | import path from 'node:path'; |
17 | 13 | import process from 'process'; |
18 | 14 | import Logger from '@matrixai/logger'; |
@@ -50,65 +46,6 @@ import * as clientMiddleware from './client/middleware.js'; |
50 | 46 | import clientServerManifest from './client/handlers/index.js'; |
51 | 47 | import agentServerManifest from './nodes/agent/handlers/index.js'; |
52 | 48 |
|
53 | | -/** |
54 | | - * Optional configuration for `PolykeyAgent`. |
55 | | - */ |
56 | | -type PolykeyAgentOptions = { |
57 | | - nodePath: string; |
58 | | - clientServiceHost: string; |
59 | | - clientServicePort: number; |
60 | | - agentServiceHost: string; |
61 | | - agentServicePort: number; |
62 | | - network: string; |
63 | | - seedNodes: SeedNodes; |
64 | | - workers: number; |
65 | | - ipv6Only: boolean; |
66 | | - keys: { |
67 | | - passwordOpsLimit: PasswordOpsLimit; |
68 | | - passwordMemLimit: PasswordMemLimit; |
69 | | - strictMemoryLock: boolean; |
70 | | - certDuration: number; |
71 | | - certRenewLeadTime: number; |
72 | | - recoveryCode: string; |
73 | | - } & ( |
74 | | - | ObjectEmpty |
75 | | - | { recoveryCode: string } |
76 | | - | { privateKey: Buffer } |
77 | | - | { privateKeyPath: string } |
78 | | - ); |
79 | | - client: { |
80 | | - keepAliveTimeoutTime: number; |
81 | | - keepAliveIntervalTime: number; |
82 | | - rpcCallTimeoutTime: number; |
83 | | - rpcParserBufferSize: number; |
84 | | - rpcMiddlewareFactory?: MiddlewareFactory< |
85 | | - JSONRPCRequest<ClientRPCRequestParams>, |
86 | | - JSONRPCRequest<ClientRPCRequestParams>, |
87 | | - JSONRPCResponse<ClientRPCResponseResult>, |
88 | | - JSONRPCResponse<ClientRPCResponseResult> |
89 | | - >; |
90 | | - }; |
91 | | - nodes: { |
92 | | - connectionIdleTimeoutTimeMin: number; |
93 | | - connectionIdleTimeoutTimeScale: number; |
94 | | - connectionFindConcurrencyLimit: number; |
95 | | - connectionConnectTimeoutTime: number; |
96 | | - connectionKeepAliveTimeoutTime: number; |
97 | | - connectionKeepAliveIntervalTime: number; |
98 | | - connectionHolePunchIntervalTime: number; |
99 | | - connectionInitialMaxStreamsBidi: number; |
100 | | - connectionInitialMaxStreamsUni: number; |
101 | | - rpcCallTimeoutTime: number; |
102 | | - rpcParserBufferSize: number; |
103 | | - dnsServers: Array<string> | undefined; |
104 | | - }; |
105 | | - mdns: { |
106 | | - groups: Array<string>; |
107 | | - port: number; |
108 | | - }; |
109 | | - versionMetadata: POJO; |
110 | | -}; |
111 | | - |
112 | 49 | interface PolykeyAgent extends createDestroyStartStop.CreateDestroyStartStop {} |
113 | 50 | @createDestroyStartStop.CreateDestroyStartStop( |
114 | 51 | new errors.ErrorPolykeyAgentRunning(), |
|
0 commit comments