diff --git a/docs/assets/navigation.js b/docs/assets/navigation.js index 0dcbfc9..e22540f 100644 --- a/docs/assets/navigation.js +++ b/docs/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA52UUW+CMBDHv0v3ilMQ3eTNuNe5JXvYgzFLhSM0lkLasrks++5roMNSBJE32vvz+1/urrf7QRJOEgWIsAhOyEE5lok6pllUUBDT8vo+kSlVsaM6ocBzUJgQGnFgKNjVgE3Gyq8exN1ZU6F8d+XPZ/6vU1OeMKQZe8klyZjoZdnKLmIh4B0OKYikF9eQ9Wf3JrEsjORCioWoaaamWTjXe3QqsfpJimhCxERxgTNMkekCMS6o7HbQ8XH0LcivjB+74Do8jt3qW5Otw+PYr5jjFNS9gSdqnHiMw9rhLLJmdrEcVvqyeRtKgBmTLL9zq72VwvKYrR7chTfI5xkkJ6G4bKGD4+m6h5cqZvq0ZOMd9UhWxVlHajcIw/QTc4IP1B7ghrrpPb/JdqvyF7kag6uWtfIGu71hKHg47VsoKv5xjg/amx0b7//lWMSGuvWQjExb69h4KxZTS1sv5soSjQsWlmnYvK4CLH1Vy/0frrliAnMGAAA=" \ No newline at end of file +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA6WWXU/CMBSG/0u9BflG4Y5AjBeKJpp4YYgp2yFb2Lql7RRj/O8etrKt28pHvWOcl+dd3tOew/sPkbCTZEp85sKOtEhMpYePYeQmAYhO+vW1J8MAa1t8ItN+izieH7gcGJm+54B5xNJPRxBXhSZDDXuT4aA7/G3llAWFMGJPsfQjJo6yqkoTMRHwBusQhHcUp8lMrJnr8tfvGAoSsCQ8cA5VPa5bjCugQqBYCrftizaygDMakDI5kd49UBe4gZ3XbeiYOwNnn9SLpDIRzR5VlY3TAjY0CeQS5FfEt7P5Q7NVTWbjdQf4ltzQDFW04R7eCiN/BOlFbrNDTWaVV3qKq11Jf5ifz7JG9+j1L+qK2UHV7egqCBNcle3YtUmgs1XZjv1MOQ0Bvy/hfRxQfEOd3KEQVabgaHxBg+eBD6w0GyWOCb29maLi0Z3c9Eb9s3zwCHLfEc0WqmhPVz1sSqzsU5PZO87iOAumcPqk3KfrYm7nEt1lcJ6BOvMZYT+6QQizV5P6P7ZLDEjEeM5OWubKC+xWJUPBnc6xHYj1j6J+1qo3LOnD1awQNXXtpupbSv8HUbqMFaaS1q7kib2/SVi632o8UwDjIWa5+gM7x2HuJgkAAA==" \ No newline at end of file diff --git a/docs/classes/index.DaemonStatus.html b/docs/classes/index.DaemonStatus.html index 67304dc..96df965 100644 --- a/docs/classes/index.DaemonStatus.html +++ b/docs/classes/index.DaemonStatus.html @@ -29,8 +29,8 @@ fromJsonString

Constructors

Properties

buildDate: string = ""

BuildDate is the build date of the daemon.

Generated

from field: string buildDate = 6;

-
connections: {
    [key: string]: DaemonConnStatus;
} = {}

Connections are a map of known connections to the daemon and their statuses.

-

Type declaration

  • [key: string]: DaemonConnStatus

Generated

from field: map<string, v1.DaemonConnStatus> connections = 9;

+
connections: {
    [key: string]: ConnectionStatus;
} = {}

Connections are a map of known connections to the daemon and their statuses.

+

Type declaration

Generated

from field: map<string, v1.DaemonConnStatus> connections = 9;

description: string = ""

Description is a description of the daemon.

Generated

from field: string description = 3;

gitCommit: string = ""

GitCommit is the git commit of the daemon.

diff --git a/docs/classes/index.Defaults.html b/docs/classes/index.Defaults.html index 40e3abd..2841af2 100644 --- a/docs/classes/index.Defaults.html +++ b/docs/classes/index.Defaults.html @@ -9,5 +9,5 @@ meshDomain networkACL

Methods

Constructors

Properties

authMethod: NetworkAuthMethod = NetworkAuthMethod.NO_AUTH
daemonAddress: string = 'http://127.0.0.1:58080'
dnsListenTCP: string = '[::]:53'
dnsListenUDP: string = '[::]:53'
ipv4Network: string = '172.16.0.0/12'
listenAddress: string = '[::]:8443'
meshDomain: string = 'webmesh.internal'
networkACL: MeshConnBootstrap_DefaultNetworkACL = DefaultNetworkACL.ACCEPT

Methods

Constructors

Properties

authMethod: NetworkAuthMethod = NetworkAuthMethod.NO_AUTH
daemonAddress: string = 'http://127.0.0.1:58080'
dnsListenTCP: string = '[::]:53'
dnsListenUDP: string = '[::]:53'
ipv4Network: string = '172.16.0.0/12'
listenAddress: string = '[::]:8443'
meshDomain: string = 'webmesh.internal'
networkACL: DefaultNetworkACL = DefaultNetworkACL.ACCEPT

Methods

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/index.Network.html b/docs/classes/index.Network.html index 92a6db7..6faae38 100644 --- a/docs/classes/index.Network.html +++ b/docs/classes/index.Network.html @@ -30,8 +30,8 @@

Returns string

Methods

Methods

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/src_useWebmesh.Context.html b/docs/interfaces/src_useWebmesh.Context.html index 72bd2a0..5390afc 100644 --- a/docs/interfaces/src_useWebmesh.Context.html +++ b/docs/interfaces/src_useWebmesh.Context.html @@ -1,5 +1,5 @@ Context | Webmesh Vue

Context is the context for a Webmesh component.

-

Hierarchy

  • Context

Properties

Hierarchy

  • Context

Properties

Methods

connect @@ -11,21 +11,21 @@ listNetworks putNetwork

Properties

client: Ref<DaemonClient>

client is a reference to the current daemon client.

-
error: Ref<null | Error>

error is a reference to the current error.

-
networks: Ref<Network[]>

networks is a reference to the current list of networks.

-

Methods

  • connect creates a new connection to a network. It is semantically equivalent to +

error: Ref<null | Error>

error is a reference to the current error.

+
networks: Ref<Network[]>

networks is a reference to the current list of networks.

+

Methods

  • connect creates a new connection to a network. It is semantically equivalent to calling PutNetwork followed by Connect on the returned network. If no parameters are given, the connection with the given ID is connected.

    -

    Parameters

    Returns Promise<Network>

  • deviceMetrics returns a reference to the current device metrics for the network +

    Parameters

    Returns Promise<Network>

  • deviceMetrics returns a reference to the current device metrics for the network with the given ID. If pollInterval is provided, the metrics will be polled at the given interval, otherwise it defaults to a 5 second interval. The polling will stop when the component is unmounted.

    -

    Parameters

    • id: string
    • Optional pollInterval: number

    Returns Ref<null | InterfaceMetrics>

  • disconnect disconnects the network with the given ID.

    -

    Parameters

    • id: string

    Returns Promise<void>

  • DropNetwork disconnects and deletes all data for the connection with the given ID.

    -

    Parameters

    • id: string

    Returns Promise<void>

  • getNetwork returns the network connection with the given ID. +

    Parameters

    • id: string
    • Optional pollInterval: number

    Returns Ref<null | InterfaceMetrics>

  • disconnect disconnects the network with the given ID.

    +

    Parameters

    • id: string

    Returns Promise<void>

  • DropNetwork disconnects and deletes all data for the connection with the given ID.

    +

    Parameters

    • id: string

    Returns Promise<void>

  • getNetwork returns the network connection with the given ID. It is a convenience method for finding and refreshing the status of a network.

    -

    Parameters

    • id: string

    Returns Promise<Network>

  • putNetwork creates a new network connection.

    -

    Parameters

    • opts: Required<{
          id?: string;
          meta?: Required<undefined | ({ fields: Required<{ [x: string]: Required<{ kind: Required<{ value: NullValue; case: "nullValue"; } | { value: number; case: "numberValue"; } | { value: string; case: "stringValue"; } | { value: boolean; case: "boolValue"; } | { ...; } | { ...; } | { ...; }>; }>; [x: number]: Required<...>; }>; })>;
          params?: Required<undefined | ({ authMethod: NetworkAuthMethod; authCredentials: Required<{ [x: string]: string; }>; addrType: ConnectionParameters_AddrType; ... 13 more ...; getType: Required<...>; })>;
      }>

    Returns Promise<Network>

Generated using TypeDoc

\ No newline at end of file +

Parameters

Returns Promise<Network>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/index.html b/docs/modules/index.html index 37243ee..df0823b 100644 --- a/docs/modules/index.html +++ b/docs/modules/index.html @@ -1,6 +1,12 @@ -index | Webmesh Vue

Module index

References

Context +index | Webmesh Vue

Module index

References

Re-exports Context
Re-exports DaemonOptions
Re-exports useWebmesh

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/src_useWebmesh.html b/docs/modules/src_useWebmesh.html index a96b42f..bb21a51 100644 --- a/docs/modules/src_useWebmesh.html +++ b/docs/modules/src_useWebmesh.html @@ -1,4 +1,4 @@ -src/useWebmesh | Webmesh Vue

Module src/useWebmesh

Index

Classes

DaemonOptions +src/useWebmesh | Webmesh Vue

Module src/useWebmesh

Index

Classes

Interfaces

Functions

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/index.DaemonClient.html b/docs/types/index.DaemonClient.html index 66d7fb2..4737488 100644 --- a/docs/types/index.DaemonClient.html +++ b/docs/types/index.DaemonClient.html @@ -1,2 +1,2 @@ -DaemonClient | Webmesh Vue

Type alias DaemonClient

DaemonClient: PromiseClient<typeof AppDaemon>

DaemonClient is a type alias for the PromiseClient of the AppDaemon service.

+DaemonClient | Webmesh Vue

Type alias DaemonClient

DaemonClient: PromiseClient<typeof AppDaemon>

DaemonClient is a type alias for the PromiseClient of the AppDaemon service.

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/variables/index.AppDaemon.html b/docs/variables/index.AppDaemon.html new file mode 100644 index 0000000..d7fdbf8 --- /dev/null +++ b/docs/variables/index.AppDaemon.html @@ -0,0 +1,23 @@ +AppDaemon | Webmesh Vue

Variable AppDaemonConst

AppDaemon: {
    methods: {
        connect: {
            I: typeof ConnectRequest;
            O: typeof ConnectResponse;
            kind: Unary;
            name: "Connect";
        };
        disconnect: {
            I: typeof DisconnectRequest;
            O: typeof DisconnectResponse;
            kind: Unary;
            name: "Disconnect";
        };
        dropConnection: {
            I: typeof DropConnectionRequest;
            O: typeof DropConnectionResponse;
            kind: Unary;
            name: "DropConnection";
        };
        getConnection: {
            I: typeof GetConnectionRequest;
            O: typeof GetConnectionResponse;
            kind: Unary;
            name: "GetConnection";
        };
        listConnections: {
            I: typeof ListConnectionsRequest;
            O: typeof ListConnectionsResponse;
            kind: Unary;
            name: "ListConnections";
        };
        metrics: {
            I: typeof MetricsRequest;
            O: typeof MetricsResponse;
            kind: Unary;
            name: "Metrics";
        };
        putConnection: {
            I: typeof PutConnectionRequest;
            O: typeof PutConnectionResponse;
            kind: Unary;
            name: "PutConnection";
        };
        query: {
            I: typeof AppQueryRequest;
            O: typeof QueryResponse;
            kind: Unary;
            name: "Query";
        };
        status: {
            I: typeof StatusRequest;
            O: typeof DaemonStatus;
            kind: Unary;
            name: "Status";
        };
    };
    typeName: "v1.AppDaemon";
} = ...

AppDaemon is exposed by nodes running in the daemon mode. +This mode allows the node to run in an idle state and be controlled by an application. +The application can send commands to the node to execute tasks and receive responses.

+

Type declaration

  • Readonly methods: {
        connect: {
            I: typeof ConnectRequest;
            O: typeof ConnectResponse;
            kind: Unary;
            name: "Connect";
        };
        disconnect: {
            I: typeof DisconnectRequest;
            O: typeof DisconnectResponse;
            kind: Unary;
            name: "Disconnect";
        };
        dropConnection: {
            I: typeof DropConnectionRequest;
            O: typeof DropConnectionResponse;
            kind: Unary;
            name: "DropConnection";
        };
        getConnection: {
            I: typeof GetConnectionRequest;
            O: typeof GetConnectionResponse;
            kind: Unary;
            name: "GetConnection";
        };
        listConnections: {
            I: typeof ListConnectionsRequest;
            O: typeof ListConnectionsResponse;
            kind: Unary;
            name: "ListConnections";
        };
        metrics: {
            I: typeof MetricsRequest;
            O: typeof MetricsResponse;
            kind: Unary;
            name: "Metrics";
        };
        putConnection: {
            I: typeof PutConnectionRequest;
            O: typeof PutConnectionResponse;
            kind: Unary;
            name: "PutConnection";
        };
        query: {
            I: typeof AppQueryRequest;
            O: typeof QueryResponse;
            kind: Unary;
            name: "Query";
        };
        status: {
            I: typeof StatusRequest;
            O: typeof DaemonStatus;
            kind: Unary;
            name: "Status";
        };
    }
    • Readonly connect: {
          I: typeof ConnectRequest;
          O: typeof ConnectResponse;
          kind: Unary;
          name: "Connect";
      }

      Connect is used to establish a connection between the node and a mesh.

      +

      Generated

      from rpc v1.AppDaemon.Connect

      +
      • Readonly I: typeof ConnectRequest
      • Readonly O: typeof ConnectResponse
      • Readonly kind: Unary
      • Readonly name: "Connect"
    • Readonly disconnect: {
          I: typeof DisconnectRequest;
          O: typeof DisconnectResponse;
          kind: Unary;
          name: "Disconnect";
      }

      Disconnect is used to disconnect the node from a mesh.

      +

      Generated

      from rpc v1.AppDaemon.Disconnect

      +
      • Readonly I: typeof DisconnectRequest
      • Readonly O: typeof DisconnectResponse
      • Readonly kind: Unary
      • Readonly name: "Disconnect"
    • Readonly dropConnection: {
          I: typeof DropConnectionRequest;
          O: typeof DropConnectionResponse;
          kind: Unary;
          name: "DropConnection";
      }

      DropConnection deletes all data stored for a given mesh connection.

      +

      Generated

      from rpc v1.AppDaemon.DropConnection

      +
      • Readonly I: typeof DropConnectionRequest
      • Readonly O: typeof DropConnectionResponse
      • Readonly kind: Unary
      • Readonly name: "DropConnection"
    • Readonly getConnection: {
          I: typeof GetConnectionRequest;
          O: typeof GetConnectionResponse;
          kind: Unary;
          name: "GetConnection";
      }

      GetConnection retrieves the parameters and current status of a connection in the daemon.

      +

      Generated

      from rpc v1.AppDaemon.GetConnection

      +
      • Readonly I: typeof GetConnectionRequest
      • Readonly O: typeof GetConnectionResponse
      • Readonly kind: Unary
      • Readonly name: "GetConnection"
    • Readonly listConnections: {
          I: typeof ListConnectionsRequest;
          O: typeof ListConnectionsResponse;
          kind: Unary;
          name: "ListConnections";
      }

      ListConnections retrieves the parameters and current status of all connections in the daemon.

      +

      Generated

      from rpc v1.AppDaemon.ListConnections

      +
      • Readonly I: typeof ListConnectionsRequest
      • Readonly O: typeof ListConnectionsResponse
      • Readonly kind: Unary
      • Readonly name: "ListConnections"
    • Readonly metrics: {
          I: typeof MetricsRequest;
          O: typeof MetricsResponse;
          kind: Unary;
          name: "Metrics";
      }

      Metrics is used to retrieve interface metrics for one or more mesh connections.

      +

      Generated

      from rpc v1.AppDaemon.Metrics

      +
      • Readonly I: typeof MetricsRequest
      • Readonly O: typeof MetricsResponse
      • Readonly kind: Unary
      • Readonly name: "Metrics"
    • Readonly putConnection: {
          I: typeof PutConnectionRequest;
          O: typeof PutConnectionResponse;
          kind: Unary;
          name: "PutConnection";
      }

      PutConnection stores the parameters for a connection in the daemon.

      +

      Generated

      from rpc v1.AppDaemon.PutConnection

      +
      • Readonly I: typeof PutConnectionRequest
      • Readonly O: typeof PutConnectionResponse
      • Readonly kind: Unary
      • Readonly name: "PutConnection"
    • Readonly query: {
          I: typeof AppQueryRequest;
          O: typeof QueryResponse;
          kind: Unary;
          name: "Query";
      }

      Query is used to query a mesh connection for information.

      +

      Generated

      from rpc v1.AppDaemon.Query

      +
      • Readonly I: typeof AppQueryRequest
      • Readonly O: typeof QueryResponse
      • Readonly kind: Unary
      • Readonly name: "Query"
    • Readonly status: {
          I: typeof StatusRequest;
          O: typeof DaemonStatus;
          kind: Unary;
          name: "Status";
      }

      Status is used to retrieve the status of the daemon. This includes a map of known connections and their statuses.

      +

      Generated

      from rpc v1.AppDaemon.Status

      +
      • Readonly I: typeof StatusRequest
      • Readonly O: typeof DaemonStatus
      • Readonly kind: Unary
      • Readonly name: "Status"
  • Readonly typeName: "v1.AppDaemon"

Generated

from service v1.AppDaemon

+

Generated using TypeDoc

\ No newline at end of file diff --git a/index.ts b/index.ts index 90c69cf..83dc680 100644 --- a/index.ts +++ b/index.ts @@ -1,4 +1,14 @@ -import { DaemonStatus } from '@webmeshproject/api/v1/app_pb'; +import { Feature } from '@webmeshproject/api/v1/node_pb'; +import { AppDaemon } from '@webmeshproject/api/v1/app_connect'; +import { + NetworkAuthMethod, + ConnectionParameters_AddrType as AddrType, + ConnectionParameters_AuthHeader as AuthHeader, + MeshConnBootstrap_DefaultNetworkACL as DefaultNetworkACL, + DaemonConnStatus as ConnectionStatus, + DaemonStatus, +} from '@webmeshproject/api/v1/app_pb'; + import { Defaults, Network, @@ -12,11 +22,22 @@ import { DefaultNamespace, DefaultDaemonAddress, } from '@webmeshproject/api/utils/daemon'; + import { DaemonOptions, Context, useWebmesh } from './src/useWebmesh'; -export type { Parameters, Context, DaemonClient, Metrics, NetworkParameters }; +export type { + AddrType, + AuthHeader, + ConnectionStatus, + DefaultNetworkACL, + Feature, + NetworkAuthMethod, +}; + +export type { Context, DaemonClient, Metrics, NetworkParameters, Parameters }; export { + AppDaemon, DefaultNamespace, DefaultDaemonAddress, DaemonOptions, diff --git a/package.json b/package.json index ccee192..18e9558 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "@webmeshproject/vue", - "version": "0.0.15", + "version": "0.0.16", "description": "Vue composables for working with a webmesh daemon", "main": "index.ts", "type": "module", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "format": "prettier --write \"**/*.{js,ts,md,json}\" --ignore-path .gitignore", + "format": "prettier --write \"**/*.{js,ts,json}\" --ignore-path .gitignore", "docs": "typedoc --name 'Webmesh Vue'" }, "repository": {