@persistica/flux-agent 0.0.1 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/index.js +1103 -0
- package/package.json +21 -22
- package/src/index.d.ts +1 -1
- package/src/lib/channel/channel.type.d.ts +10 -0
- package/src/lib/connector/auth/register-client.auth.d.ts +18 -0
- package/src/lib/connector/flux-client-data.class.d.ts +11 -0
- package/src/lib/connector/low-level-com/web-rtc/ice-connection.d.ts +34 -0
- package/src/lib/connector/rpc/NOT-USED-network-authority.class.d.ts +4 -0
- package/src/lib/connector/state-machines/connect-to-remote-client.d.ts +6 -0
- package/src/lib/flux-agent.class.d.ts +43 -0
- package/src/lib/flux-interface.class.d.ts +12 -0
- package/src/lib/flux-remote-client.class.d.ts +10 -0
- package/src/lib/route-transport-coordinator.d.ts +8 -0
- package/src/lib/utils/obscuring/decrypt.utils.d.ts +13 -0
- package/src/lib/utils/obscuring/encyprt.utils.d.ts +12 -0
- package/src/lib/utils/obscuring/shared.utils.d.ts +9 -0
- package/index.cjs +0 -35
- package/src/lib/persistica-flux-agent-2.d.ts +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Flux Agent
|
|
2
|
+
|
|
3
|
+
```TypeScript
|
|
4
|
+
import { FluxAgent, FluxAgentNetworkConnection } from '@persistica/flux-agent';
|
|
5
|
+
|
|
6
|
+
const NETWORK_ID = 'network-id-to-connect-to';
|
|
7
|
+
|
|
8
|
+
const fluxAgent = new FluxAgent(NETWORK_ID);
|
|
9
|
+
|
|
10
|
+
// * Connect to network
|
|
11
|
+
const fluxNetworkConnection: FluxAgentNetworkConnection = await fluxAgent
|
|
12
|
+
.connect(
|
|
13
|
+
'CODE_TO_ACCESS_NETWORK',
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
console.log(`✅ Agent connected to network ID: '${NETWORK_ID}'`);
|
|
17
|
+
|
|
18
|
+
// * Join network channel
|
|
19
|
+
const fluxConnectedAgentNetworkChannel: FluxNetworkChannel = await fluxNetworkConnection
|
|
20
|
+
.joinChannel('connected-agents');
|
|
21
|
+
|
|
22
|
+
```
|