Skip to content

Commit

Permalink
docs(remote-client): add inline documentation for exports
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceanis committed Jun 8, 2022
1 parent 24b8ef4 commit a194559
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/remote-client/src/client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
import 'cross-fetch/polyfill'
import { IAgentPlugin, IPluginMethodMap, IAgentPluginSchema } from '@veramo/core'

/**
* This plugin can be used to access the methods of a remote Veramo agent as if they were implemented locally.
*
* The remote agent should be provided by {@link @veramo/remote-server#AgentRouter | AgentRouter}, or a similar
* implementation of this API.
*
* The schema of the remote agent is usually provided by {@link @veramo/remote-server#ApiSchemaRouter |
* ApiSchemaRouter}.
*
* @public
*/
export class AgentRestClient implements IAgentPlugin {
readonly methods: IPluginMethodMap = {}
readonly schema?: IAgentPluginSchema
Expand Down
12 changes: 12 additions & 0 deletions packages/remote-client/src/openApi.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
import { OpenAPIV3 } from 'openapi-types'
import { IAgent } from '@veramo/core'

/**
* This method can be used to generate an OpenAPIv3 schema to describe how the methods of a Veramo agent can be called
* remotely.
*
* @param agent - The agent whose schema needs to be interpreted.
* @param basePath - The base URL
* @param exposedMethods - The list of method names available through this schema
* @param name - The name of the agent
* @param version - The version of the agent
*
* @public
*/
export const getOpenApiSchema = (
agent: IAgent,
basePath: string,
Expand Down

0 comments on commit a194559

Please sign in to comment.