@dxos/react-client 2.27.5-dev.d94eb3d5 → 2.27.6-dev.74e914a7
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/.rush/temp/package-deps_build:test.json +3 -3
- package/.rush/temp/package-deps_prerelease.json +3 -3
- package/.rush/temp/shrinkwrap-deps.json +1 -1
- package/dist/src/hooks/bot-factory/useBotFactoryClient.d.ts +2 -1
- package/dist/src/hooks/bot-factory/useBotFactoryClient.d.ts.map +1 -1
- package/dist/src/hooks/bot-factory/useBotFactoryClient.js +8 -5
- package/dist/src/hooks/bot-factory/useBotFactoryClient.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -13
- package/src/hooks/bot-factory/useBotFactoryClient.ts +9 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-client",
|
|
3
|
-
"version": "2.27.
|
|
3
|
+
"version": "2.27.6-dev.74e914a7",
|
|
4
4
|
"description": "React client API",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "AGPL-3.0",
|
|
@@ -8,23 +8,24 @@
|
|
|
8
8
|
"main": "dist/src/index.js",
|
|
9
9
|
"types": "dist/src/index.d.ts",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@dxos/async": "2.27.
|
|
12
|
-
"@dxos/bot-factory-client": "2.27.
|
|
13
|
-
"@dxos/client": "2.27.
|
|
14
|
-
"@dxos/config": "2.27.
|
|
15
|
-
"@dxos/credentials": "2.27.
|
|
16
|
-
"@dxos/crypto": "2.27.
|
|
17
|
-
"@dxos/debug": "2.27.
|
|
18
|
-
"@dxos/echo-db": "2.27.
|
|
19
|
-
"@dxos/util": "2.27.
|
|
11
|
+
"@dxos/async": "2.27.6-dev.74e914a7",
|
|
12
|
+
"@dxos/bot-factory-client": "2.27.6-dev.74e914a7",
|
|
13
|
+
"@dxos/client": "2.27.6-dev.74e914a7",
|
|
14
|
+
"@dxos/config": "2.27.6-dev.74e914a7",
|
|
15
|
+
"@dxos/credentials": "2.27.6-dev.74e914a7",
|
|
16
|
+
"@dxos/crypto": "2.27.6-dev.74e914a7",
|
|
17
|
+
"@dxos/debug": "2.27.6-dev.74e914a7",
|
|
18
|
+
"@dxos/echo-db": "2.27.6-dev.74e914a7",
|
|
19
|
+
"@dxos/util": "2.27.6-dev.74e914a7",
|
|
20
20
|
"assert": "^2.0.0",
|
|
21
21
|
"debug": "^4.3.3",
|
|
22
22
|
"react-display-name": "^0.2.5",
|
|
23
|
-
"use-subscription": "^1.4.1"
|
|
23
|
+
"use-subscription": "^1.4.1",
|
|
24
|
+
"@dxos/network-manager": "2.27.6-dev.74e914a7"
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|
|
26
|
-
"@dxos/esbuild-plugins": "2.27.
|
|
27
|
-
"@dxos/toolchain-node-library": "2.27.
|
|
27
|
+
"@dxos/esbuild-plugins": "2.27.6-dev.74e914a7",
|
|
28
|
+
"@dxos/toolchain-node-library": "2.27.5",
|
|
28
29
|
"@mui/material": "^5.4.2",
|
|
29
30
|
"@testing-library/react": "^11.0.4",
|
|
30
31
|
"@testing-library/react-hooks": "5.1.2",
|
|
@@ -5,19 +5,21 @@
|
|
|
5
5
|
import { useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { BotFactoryClient } from '@dxos/bot-factory-client';
|
|
8
|
+
import { Config } from '@dxos/config';
|
|
8
9
|
import { PublicKey } from '@dxos/crypto';
|
|
9
10
|
import { raise } from '@dxos/debug';
|
|
11
|
+
import { NetworkManager } from '@dxos/network-manager';
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export const useBotFactoryClient = (): BotFactoryClient | undefined => {
|
|
13
|
+
export const useBotFactoryClient = (config: Config): BotFactoryClient | undefined => {
|
|
14
14
|
const [botFactoryClient, setBotFactoryClient] = useState<BotFactoryClient>();
|
|
15
15
|
|
|
16
|
-
const client = useClient();
|
|
17
|
-
const config = useConfig();
|
|
18
|
-
|
|
19
16
|
useEffect(() => {
|
|
20
|
-
const
|
|
17
|
+
const networkManager = new NetworkManager({
|
|
18
|
+
signal: config.get('runtime.services.signal.server') ? [config.get('runtime.services.signal.server')!] : undefined,
|
|
19
|
+
ice: config.get('runtime.services.ice'),
|
|
20
|
+
log: true
|
|
21
|
+
});
|
|
22
|
+
const botFactoryClient = new BotFactoryClient(networkManager);
|
|
21
23
|
const topic = config.get('runtime.services.bot.topic') ??
|
|
22
24
|
raise(new Error('Bot factory topic is not provided'));
|
|
23
25
|
setImmediate(async () => {
|