import type { JSONRPCRequest, JSONRPCResponse, MiddlewareFactory } from '@matrixai/rpc'; import type { PromiseCancellable } from '@matrixai/async-cancellable'; import type { ContextTimedInput } from '@matrixai/contexts'; import type { DeepPartial, FileSystem } from './types.js'; import type { ClientRPCRequestParams, ClientRPCResponseResult, OverrideRPClientType } from './client/types.js'; import type { NodeId } from './ids/types.js'; import Logger from '@matrixai/logger'; import { createDestroyStartStop } from '@matrixai/async-init'; import { WebSocketClient } from '@matrixai/ws'; import { RPCClient } from '@matrixai/rpc'; import { Session } from './sessions/index.js'; import * as ids from './ids/index.js'; import clientClientManifest from './client/callers/index.js'; /** * Optional configuration for`PolykeyClient`. */ type PolykeyClientOptions = { nodePath: string; keepAliveTimeoutTime: number; keepAliveIntervalTime: number; rpcCallTimeoutTime: number; rpcParserBufferSize: number; rpcMiddlewareFactory?: MiddlewareFactory, JSONRPCRequest, JSONRPCResponse, JSONRPCResponse>; }; interface PolykeyClient extends createDestroyStartStop.CreateDestroyStartStop { } declare class PolykeyClient { /** * Creates a Polykey Client. * * @param opts * @param opts.nodeId * @param opts.host * @param opts.port * @param ctx */ static createPolykeyClient(opts: { nodeId: string | NodeId; host: string; port: number; options?: DeepPartial; fresh?: boolean; fs?: FileSystem; logger?: Logger; }, ctx?: Partial): PromiseCancellable; readonly nodePath: string; readonly session: Session; protected fs: FileSystem; protected logger: Logger; protected _nodeId: NodeId; protected _webSocketClient: WebSocketClient; protected _rpcClient: OverrideRPClientType>; protected handleEventWebSocketClientDestroyed: () => Promise; constructor({ nodePath, session, fs, logger, }: { nodePath: string; session: Session; fs: FileSystem; logger: Logger; }); get nodeId(): NodeId; get webSocketClient(): WebSocketClient; get rpcClient(): OverrideRPClientType; agentStatus: import("@matrixai/rpc/callers/UnaryCaller.js").default>; agentStop: import("@matrixai/rpc/callers/UnaryCaller.js").default; agentUnlock: import("@matrixai/rpc/callers/UnaryCaller.js").default; auditEventsGet: import("@matrixai/rpc/callers/ServerCaller.js").default, ClientRPCResponseResult>; auditMetricGet: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; authIdentityToken: import("@matrixai/rpc/callers/UnaryCaller.js").default>; gestaltsActionsGetByIdentity: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult<{ actionsList: ("join" | "notify" | "scan" | "claim")[]; }>>; gestaltsActionsGetByNode: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; gestaltsActionsSetByIdentity: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; gestaltsActionsSetByNode: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; gestaltsActionsUnsetByIdentity: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; gestaltsActionsUnsetByNode: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; gestaltsDiscoveryByIdentity: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; gestaltsDiscoveryByNode: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; gestaltsGestaltGetByIdentity: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; gestaltsGestaltGetByNode: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; gestaltsDiscoveryQueue: import("@matrixai/rpc/callers/ServerCaller.js").default>; gestaltsGestaltList: import("@matrixai/rpc/callers/ServerCaller.js").default>; gestaltsGestaltTrustByIdentity: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; gestaltsGestaltTrustByNode: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; identitiesAuthenticate: import("@matrixai/rpc/callers/ServerCaller.js").default, ClientRPCResponseResult>; identitiesAuthenticatedGet: import("@matrixai/rpc/callers/ServerCaller.js").default, ClientRPCResponseResult>; identitiesClaim: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; identitiesInfoConnectedGet: import("@matrixai/rpc/callers/ServerCaller.js").default, ClientRPCResponseResult>; identitiesInfoGet: import("@matrixai/rpc/callers/ServerCaller.js").default, ClientRPCResponseResult>; identitiesInvite: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; identitiesProvidersList: import("@matrixai/rpc/callers/UnaryCaller.js").default>; identitiesTokenDelete: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; identitiesTokenGet: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>>; identitiesTokenPut: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; keysCertsChainGet: import("@matrixai/rpc/callers/ServerCaller.js").default>; keysCertsGet: import("@matrixai/rpc/callers/UnaryCaller.js").default>; keysDecrypt: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; keysEncrypt: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; keysKeyPair: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; keysKeyPairRenew: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; keysKeyPairReset: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; keysPasswordChange: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; keysPublicKey: import("@matrixai/rpc/callers/UnaryCaller.js").default>; keysSign: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; keysVerify: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; nodesAdd: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; nodesClaim: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; nodesFind: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; nodesGetAll: import("@matrixai/rpc/callers/ServerCaller.js").default>; nodesListConnections: import("@matrixai/rpc/callers/ServerCaller.js").default>; nodesPing: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; notificationsInboxClear: import("@matrixai/rpc/callers/UnaryCaller.js").default; notificationsInboxRead: import("@matrixai/rpc/callers/ServerCaller.js").default, ClientRPCResponseResult>; notificationsInboxRemove: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; notificationsOutboxClear: import("@matrixai/rpc/callers/UnaryCaller.js").default; notificationsOutboxRead: import("@matrixai/rpc/callers/ServerCaller.js").default, ClientRPCResponseResult>; notificationsOutboxRemove: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; notificationsSend: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; vaultsClone: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; vaultsCreate: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; vaultsDelete: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; vaultsList: import("@matrixai/rpc/callers/ServerCaller.js").default>; vaultsLog: import("@matrixai/rpc/callers/ServerCaller.js").default, ClientRPCResponseResult>; vaultsPermissionGet: import("@matrixai/rpc/callers/ServerCaller.js").default, ClientRPCResponseResult>; vaultsPermissionSet: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; vaultsPermissionUnset: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; vaultsPull: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; vaultsRename: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; vaultsScan: import("@matrixai/rpc/callers/ServerCaller.js").default, ClientRPCResponseResult>; vaultsSecretsCat: import("@matrixai/rpc/callers/DuplexCaller.js").default, ClientRPCResponseResult>; vaultsSecretsEnv: import("@matrixai/rpc/callers/DuplexCaller.js").default, ClientRPCResponseResult>; vaultsSecretsList: import("@matrixai/rpc/callers/ServerCaller.js").default, ClientRPCResponseResult>; vaultsSecretsMkdir: import("@matrixai/rpc/callers/DuplexCaller.js").default, ClientRPCResponseResult>; vaultsSecretsNewDir: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; vaultsSecretsRename: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; vaultsSecretsRemove: import("@matrixai/rpc/callers/DuplexCaller.js").default, ClientRPCResponseResult>; vaultsSecretsStat: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; vaultsSecretsTouch: import("@matrixai/rpc/callers/DuplexCaller.js").default, ClientRPCResponseResult>; vaultsSecretsWriteFile: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; vaultsVersion: import("@matrixai/rpc/callers/UnaryCaller.js").default, ClientRPCResponseResult>; }>>; get host(): import("@matrixai/ws/types.js").Host; get port(): import("@matrixai/ws/types.js").Port; get localHost(): import("@matrixai/ws/types.js").Host | undefined; get localPort(): import("@matrixai/ws/types.js").Port | undefined; start(opts: { nodeId: string | NodeId; host: string; port: number; options?: DeepPartial<{ keepAliveTimeoutTime: number; keepAliveIntervalTime: number; rpcCallTimeoutTime: number; rpcParserBufferSize: number; }>; fresh?: boolean; }, ctx?: Partial): PromiseCancellable; /** * Stops Polykey Client * * Stopping can force destruction of the websocket client. * Prefer not forcing for a graceful stop. * Stopping the session does not destroy the session state. */ stop({ force }?: { force?: boolean; }): Promise; /** * Destroys Polykey Client * * This will destroy the session state. */ destroy(): Promise; } export default PolykeyClient; export type { PolykeyClientOptions };