@dxos/network-manager 0.1.0
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/LICENSE +21 -0
- package/dist/src/connection-log.d.ts +23 -0
- package/dist/src/connection-log.d.ts.map +1 -0
- package/dist/src/connection-log.js +98 -0
- package/dist/src/connection-log.js.map +1 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +28 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/network-manager.d.ts +80 -0
- package/dist/src/network-manager.d.ts.map +1 -0
- package/dist/src/network-manager.js +123 -0
- package/dist/src/network-manager.js.map +1 -0
- package/dist/src/network-manager.test.d.ts +2 -0
- package/dist/src/network-manager.test.d.ts.map +1 -0
- package/dist/src/network-manager.test.js +621 -0
- package/dist/src/network-manager.test.js.map +1 -0
- package/dist/src/presence.test.d.ts +2 -0
- package/dist/src/presence.test.d.ts.map +1 -0
- package/dist/src/presence.test.js +60 -0
- package/dist/src/presence.test.js.map +1 -0
- package/dist/src/protocol-factory.d.ts +30 -0
- package/dist/src/protocol-factory.d.ts.map +1 -0
- package/dist/src/protocol-factory.js +64 -0
- package/dist/src/protocol-factory.js.map +1 -0
- package/dist/src/signal/index.d.ts +4 -0
- package/dist/src/signal/index.d.ts.map +1 -0
- package/dist/src/signal/index.js +23 -0
- package/dist/src/signal/index.js.map +1 -0
- package/dist/src/signal/integration.test.d.ts +2 -0
- package/dist/src/signal/integration.test.d.ts.map +1 -0
- package/dist/src/signal/integration.test.js +105 -0
- package/dist/src/signal/integration.test.js.map +1 -0
- package/dist/src/signal/message-router.d.ts +39 -0
- package/dist/src/signal/message-router.d.ts.map +1 -0
- package/dist/src/signal/message-router.js +135 -0
- package/dist/src/signal/message-router.js.map +1 -0
- package/dist/src/signal/message-router.test.d.ts +2 -0
- package/dist/src/signal/message-router.test.d.ts.map +1 -0
- package/dist/src/signal/message-router.test.js +211 -0
- package/dist/src/signal/message-router.test.js.map +1 -0
- package/dist/src/signal/signal-connection.d.ts +21 -0
- package/dist/src/signal/signal-connection.d.ts.map +1 -0
- package/dist/src/signal/signal-connection.js +6 -0
- package/dist/src/signal/signal-connection.js.map +1 -0
- package/dist/src/signal/signal-messaging.d.ts +34 -0
- package/dist/src/signal/signal-messaging.d.ts.map +1 -0
- package/dist/src/signal/signal-messaging.js +6 -0
- package/dist/src/signal/signal-messaging.js.map +1 -0
- package/dist/src/swarm/connection.d.ts +69 -0
- package/dist/src/swarm/connection.d.ts.map +1 -0
- package/dist/src/swarm/connection.js +187 -0
- package/dist/src/swarm/connection.js.map +1 -0
- package/dist/src/swarm/index.d.ts +4 -0
- package/dist/src/swarm/index.d.ts.map +1 -0
- package/dist/src/swarm/index.js +23 -0
- package/dist/src/swarm/index.js.map +1 -0
- package/dist/src/swarm/swarm-mapper.d.ts +30 -0
- package/dist/src/swarm/swarm-mapper.d.ts.map +1 -0
- package/dist/src/swarm/swarm-mapper.js +90 -0
- package/dist/src/swarm/swarm-mapper.js.map +1 -0
- package/dist/src/swarm/swarm.d.ts +64 -0
- package/dist/src/swarm/swarm.d.ts.map +1 -0
- package/dist/src/swarm/swarm.js +276 -0
- package/dist/src/swarm/swarm.js.map +1 -0
- package/dist/src/swarm/swarm.test.d.ts +2 -0
- package/dist/src/swarm/swarm.test.d.ts.map +1 -0
- package/dist/src/swarm/swarm.test.js +145 -0
- package/dist/src/swarm/swarm.test.js.map +1 -0
- package/dist/src/testing/index.d.ts +2 -0
- package/dist/src/testing/index.d.ts.map +1 -0
- package/dist/src/testing/index.js +21 -0
- package/dist/src/testing/index.js.map +1 -0
- package/dist/src/testing/test-protocol.d.ts +59 -0
- package/dist/src/testing/test-protocol.d.ts.map +1 -0
- package/dist/src/testing/test-protocol.js +140 -0
- package/dist/src/testing/test-protocol.js.map +1 -0
- package/dist/src/topology/fully-connected-topology.d.ts +11 -0
- package/dist/src/topology/fully-connected-topology.d.ts.map +1 -0
- package/dist/src/topology/fully-connected-topology.js +34 -0
- package/dist/src/topology/fully-connected-topology.js.map +1 -0
- package/dist/src/topology/index.d.ts +5 -0
- package/dist/src/topology/index.d.ts.map +1 -0
- package/dist/src/topology/index.js +24 -0
- package/dist/src/topology/index.js.map +1 -0
- package/dist/src/topology/mmst-topology.d.ts +31 -0
- package/dist/src/topology/mmst-topology.d.ts.map +1 -0
- package/dist/src/topology/mmst-topology.js +73 -0
- package/dist/src/topology/mmst-topology.js.map +1 -0
- package/dist/src/topology/star-topology.d.ts +13 -0
- package/dist/src/topology/star-topology.d.ts.map +1 -0
- package/dist/src/topology/star-topology.js +60 -0
- package/dist/src/topology/star-topology.js.map +1 -0
- package/dist/src/topology/topology.d.ts +56 -0
- package/dist/src/topology/topology.d.ts.map +1 -0
- package/dist/src/topology/topology.js +6 -0
- package/dist/src/topology/topology.js.map +1 -0
- package/dist/src/transport/index.d.ts +6 -0
- package/dist/src/transport/index.d.ts.map +1 -0
- package/dist/src/transport/index.js +25 -0
- package/dist/src/transport/index.js.map +1 -0
- package/dist/src/transport/memory-transport.d.ts +32 -0
- package/dist/src/transport/memory-transport.d.ts.map +1 -0
- package/dist/src/transport/memory-transport.js +98 -0
- package/dist/src/transport/memory-transport.js.map +1 -0
- package/dist/src/transport/memory-transport.test.d.ts +2 -0
- package/dist/src/transport/memory-transport.test.d.ts.map +1 -0
- package/dist/src/transport/memory-transport.test.js +84 -0
- package/dist/src/transport/memory-transport.test.js.map +1 -0
- package/dist/src/transport/transport.d.ts +38 -0
- package/dist/src/transport/transport.d.ts.map +1 -0
- package/dist/src/transport/transport.js +6 -0
- package/dist/src/transport/transport.js.map +1 -0
- package/dist/src/transport/webrtc-transport-proxy.d.ts +48 -0
- package/dist/src/transport/webrtc-transport-proxy.d.ts.map +1 -0
- package/dist/src/transport/webrtc-transport-proxy.js +139 -0
- package/dist/src/transport/webrtc-transport-proxy.js.map +1 -0
- package/dist/src/transport/webrtc-transport-proxy.test.d.ts +2 -0
- package/dist/src/transport/webrtc-transport-proxy.test.d.ts.map +1 -0
- package/dist/src/transport/webrtc-transport-proxy.test.js +245 -0
- package/dist/src/transport/webrtc-transport-proxy.test.js.map +1 -0
- package/dist/src/transport/webrtc-transport-service.d.ts +15 -0
- package/dist/src/transport/webrtc-transport-service.d.ts.map +1 -0
- package/dist/src/transport/webrtc-transport-service.js +97 -0
- package/dist/src/transport/webrtc-transport-service.js.map +1 -0
- package/dist/src/transport/webrtc-transport.d.ts +34 -0
- package/dist/src/transport/webrtc-transport.d.ts.map +1 -0
- package/dist/src/transport/webrtc-transport.js +100 -0
- package/dist/src/transport/webrtc-transport.js.map +1 -0
- package/dist/src/transport/webrtc-transport.test.d.ts +2 -0
- package/dist/src/transport/webrtc-transport.test.d.ts.map +1 -0
- package/dist/src/transport/webrtc-transport.test.js +80 -0
- package/dist/src/transport/webrtc-transport.test.js.map +1 -0
- package/dist/src/transport/webrtc.d.ts +6 -0
- package/dist/src/transport/webrtc.d.ts.map +1 -0
- package/dist/src/transport/webrtc.js +17 -0
- package/dist/src/transport/webrtc.js.map +1 -0
- package/dist/src/transport/wrtc-simple-peer.test.d.ts +2 -0
- package/dist/src/transport/wrtc-simple-peer.test.d.ts.map +1 -0
- package/dist/src/transport/wrtc-simple-peer.test.js +24 -0
- package/dist/src/transport/wrtc-simple-peer.test.js.map +1 -0
- package/dist/src/types.d.ts +6 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +6 -0
- package/dist/src/types.js.map +1 -0
- package/package.json +58 -0
- package/src/connection-log.ts +102 -0
- package/src/globals.d.ts +7 -0
- package/src/index.ts +12 -0
- package/src/network-manager.test.ts +764 -0
- package/src/network-manager.ts +204 -0
- package/src/presence.test.ts +78 -0
- package/src/protocol-factory.ts +83 -0
- package/src/signal/index.ts +7 -0
- package/src/signal/integration.test.ts +129 -0
- package/src/signal/message-router.test.ts +274 -0
- package/src/signal/message-router.ts +200 -0
- package/src/signal/signal-connection.ts +20 -0
- package/src/signal/signal-messaging.ts +38 -0
- package/src/swarm/connection.ts +206 -0
- package/src/swarm/index.ts +7 -0
- package/src/swarm/swarm-mapper.ts +120 -0
- package/src/swarm/swarm.test.ts +192 -0
- package/src/swarm/swarm.ts +328 -0
- package/src/testing/index.ts +5 -0
- package/src/testing/test-protocol.ts +160 -0
- package/src/topology/fully-connected-topology.ts +38 -0
- package/src/topology/index.ts +8 -0
- package/src/topology/mmst-topology.ts +105 -0
- package/src/topology/star-topology.ts +67 -0
- package/src/topology/topology.ts +69 -0
- package/src/transport/index.ts +9 -0
- package/src/transport/memory-transport.test.ts +110 -0
- package/src/transport/memory-transport.ts +128 -0
- package/src/transport/transport.ts +47 -0
- package/src/transport/webrtc-transport-proxy.test.ts +290 -0
- package/src/transport/webrtc-transport-proxy.ts +167 -0
- package/src/transport/webrtc-transport-service.ts +115 -0
- package/src/transport/webrtc-transport.test.ts +112 -0
- package/src/transport/webrtc-transport.ts +122 -0
- package/src/transport/webrtc.ts +15 -0
- package/src/transport/wrtc-simple-peer.test.ts +24 -0
- package/src/types.ts +10 -0
- package/src/typings.d.ts +7 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presence.test.d.ts","sourceRoot":"","sources":["../../src/presence.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2021 DXOS.org
|
|
4
|
+
//
|
|
5
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const expect_1 = __importDefault(require("expect"));
|
|
10
|
+
const wait_for_expect_1 = __importDefault(require("wait-for-expect"));
|
|
11
|
+
const keys_1 = require("@dxos/keys");
|
|
12
|
+
const messaging_1 = require("@dxos/messaging");
|
|
13
|
+
const protocol_plugin_presence_1 = require("@dxos/protocol-plugin-presence");
|
|
14
|
+
const testutils_1 = require("@dxos/testutils");
|
|
15
|
+
const network_manager_1 = require("./network-manager");
|
|
16
|
+
const protocol_factory_1 = require("./protocol-factory");
|
|
17
|
+
const topology_1 = require("./topology");
|
|
18
|
+
const transport_1 = require("./transport");
|
|
19
|
+
const signalContext = new messaging_1.MemorySignalManagerContext();
|
|
20
|
+
const createPeer = async (topic) => {
|
|
21
|
+
const peerId = keys_1.PublicKey.random();
|
|
22
|
+
const networkManager = new network_manager_1.NetworkManager({
|
|
23
|
+
signalManager: new messaging_1.MemorySignalManager(signalContext),
|
|
24
|
+
transportFactory: transport_1.MemoryTransportFactory
|
|
25
|
+
});
|
|
26
|
+
(0, testutils_1.afterTest)(() => networkManager.destroy());
|
|
27
|
+
const presencePlugin = new protocol_plugin_presence_1.PresencePlugin(peerId.asBuffer());
|
|
28
|
+
(0, testutils_1.afterTest)(() => presencePlugin.stop());
|
|
29
|
+
await networkManager.openSwarmConnection({
|
|
30
|
+
peerId,
|
|
31
|
+
protocol: (0, protocol_factory_1.createProtocolFactory)(topic, peerId, [presencePlugin]),
|
|
32
|
+
topic,
|
|
33
|
+
topology: new topology_1.FullyConnectedTopology()
|
|
34
|
+
});
|
|
35
|
+
return { peerId, presence: presencePlugin, networkManager };
|
|
36
|
+
};
|
|
37
|
+
describe('Presence', function () {
|
|
38
|
+
it('sees connected peers', async function () {
|
|
39
|
+
const topic = keys_1.PublicKey.random();
|
|
40
|
+
const peer1 = await createPeer(topic);
|
|
41
|
+
const peer2 = await createPeer(topic);
|
|
42
|
+
await (0, wait_for_expect_1.default)(() => {
|
|
43
|
+
(0, expect_1.default)(peer1.presence.peers.map((key) => key.toString('hex')).sort()).toEqual([peer1, peer2].map((key) => key.peerId.toHex()).sort());
|
|
44
|
+
(0, expect_1.default)(peer2.presence.peers.map((key) => key.toString('hex')).sort()).toEqual([peer1, peer2].map((key) => key.peerId.toHex()).sort());
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
it('removes disconnected peers', async function () {
|
|
48
|
+
const topic = keys_1.PublicKey.random();
|
|
49
|
+
const peer1 = await createPeer(topic);
|
|
50
|
+
const peer2 = await createPeer(topic);
|
|
51
|
+
await (0, wait_for_expect_1.default)(() => {
|
|
52
|
+
(0, expect_1.default)(peer1.presence.peers.map((key) => key.toString('hex')).sort()).toEqual([peer1, peer2].map((key) => key.peerId.toHex()).sort());
|
|
53
|
+
});
|
|
54
|
+
await peer2.networkManager.closeSwarmConnection(topic);
|
|
55
|
+
await (0, wait_for_expect_1.default)(() => {
|
|
56
|
+
(0, expect_1.default)(peer1.presence.peers.map((key) => key.toString('hex')).sort()).toEqual([peer1].map((x) => x.peerId.toHex()).sort());
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=presence.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presence.test.js","sourceRoot":"","sources":["../../src/presence.test.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;AAEF,oDAA4B;AAC5B,sEAA4C;AAE5C,qCAAuC;AACvC,+CAAkF;AAClF,6EAAgE;AAChE,+CAA4C;AAE5C,uDAAmD;AACnD,yDAA2D;AAC3D,yCAAoD;AACpD,2CAAqD;AAErD,MAAM,aAAa,GAAG,IAAI,sCAA0B,EAAE,CAAC;AAEvD,MAAM,UAAU,GAAG,KAAK,EAAE,KAAgB,EAAE,EAAE;IAC5C,MAAM,MAAM,GAAG,gBAAS,CAAC,MAAM,EAAE,CAAC;IAElC,MAAM,cAAc,GAAG,IAAI,gCAAc,CAAC;QACxC,aAAa,EAAE,IAAI,+BAAmB,CAAC,aAAa,CAAC;QACrD,gBAAgB,EAAE,kCAAsB;KACzC,CAAC,CAAC;IACH,IAAA,qBAAS,EAAC,GAAG,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC;IAE1C,MAAM,cAAc,GAAG,IAAI,yCAAc,CAAC,MAAM,CAAC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,CAAC,IAAI,EAAE,CAC5C,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { PublicKey } from '@dxos/keys';
|
|
3
|
+
import { Extension } from '@dxos/mesh-protocol';
|
|
4
|
+
import { ProtocolProvider } from './network-manager';
|
|
5
|
+
interface ProtocolFactoryOptions {
|
|
6
|
+
plugins: any[];
|
|
7
|
+
getTopics: () => Buffer[];
|
|
8
|
+
session: Record<string, any>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Returns a function that takes a channel parameter, returns a Protocol object
|
|
12
|
+
* with its context set to channel, plugins from plugins parameter and session
|
|
13
|
+
* set to session parameter.
|
|
14
|
+
*
|
|
15
|
+
* @param plugins array of Protocol plugin objects to add to created Protocol objects
|
|
16
|
+
* @param getTopics retrieve a list of known topic keys to encrypt by public key.
|
|
17
|
+
* @deprecated Use `createProtocolFactory`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const protocolFactory: ({ session, plugins, getTopics }: ProtocolFactoryOptions) => ProtocolProvider;
|
|
20
|
+
export interface Plugin {
|
|
21
|
+
createExtension: () => Extension;
|
|
22
|
+
}
|
|
23
|
+
export declare const createProtocolFactory: (topic: PublicKey, peerId: PublicKey, plugins: Plugin[]) => ProtocolProvider;
|
|
24
|
+
/**
|
|
25
|
+
* Creates a ProtocolProvider for simple transport connections with only one protocol plugin.
|
|
26
|
+
* @deprecated Use `createProtocolFactory`.
|
|
27
|
+
*/
|
|
28
|
+
export declare const transportProtocolProvider: (rendezvousKey: Buffer, peerId: Buffer, protocolPlugin: any) => ProtocolProvider;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=protocol-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol-factory.d.ts","sourceRoot":"","sources":["../../src/protocol-factory.ts"],"names":[],"mappings":";AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAY,MAAM,qBAAqB,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,UAAU,sBAAsB;IAC9B,OAAO,EAAE,GAAG,EAAE,CAAC;IACf,SAAS,EAAE,MAAM,MAAM,EAAE,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,oCAIzB,sBAAsB,KAAG,gBAwB3B,CAAC;AAEF,MAAM,WAAW,MAAM;IACrB,eAAe,EAAE,MAAM,SAAS,CAAC;CAClC;AAED,eAAO,MAAM,qBAAqB,UAAW,SAAS,UAAU,SAAS,WAAW,MAAM,EAAE,qBAKxF,CAAC;AAEL;;;GAGG;AACH,eAAO,MAAM,yBAAyB,kBACrB,MAAM,UACb,MAAM,kBACE,GAAG,KAClB,gBAKC,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2020 DXOS.org
|
|
4
|
+
//
|
|
5
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.transportProtocolProvider = exports.createProtocolFactory = exports.protocolFactory = void 0;
|
|
10
|
+
const node_assert_1 = __importDefault(require("node:assert"));
|
|
11
|
+
const crypto_1 = require("@dxos/crypto");
|
|
12
|
+
const keys_1 = require("@dxos/keys");
|
|
13
|
+
const log_1 = require("@dxos/log");
|
|
14
|
+
const mesh_protocol_1 = require("@dxos/mesh-protocol");
|
|
15
|
+
/**
|
|
16
|
+
* Returns a function that takes a channel parameter, returns a Protocol object
|
|
17
|
+
* with its context set to channel, plugins from plugins parameter and session
|
|
18
|
+
* set to session parameter.
|
|
19
|
+
*
|
|
20
|
+
* @param plugins array of Protocol plugin objects to add to created Protocol objects
|
|
21
|
+
* @param getTopics retrieve a list of known topic keys to encrypt by public key.
|
|
22
|
+
* @deprecated Use `createProtocolFactory`.
|
|
23
|
+
*/
|
|
24
|
+
const protocolFactory = ({ session = {}, plugins = [], getTopics }) => {
|
|
25
|
+
(0, node_assert_1.default)(getTopics);
|
|
26
|
+
// eslint-disable-next-line no-unused-vars
|
|
27
|
+
return ({ channel, initiator }) => {
|
|
28
|
+
const protocol = new mesh_protocol_1.Protocol({
|
|
29
|
+
streamOptions: { live: true },
|
|
30
|
+
discoveryToPublicKey: (dk) => {
|
|
31
|
+
const publicKey = getTopics().find((topic) => (0, crypto_1.discoveryKey)(topic).equals(dk));
|
|
32
|
+
if (publicKey) {
|
|
33
|
+
protocol.setContext({ topic: keys_1.PublicKey.stringify(publicKey) });
|
|
34
|
+
}
|
|
35
|
+
(0, node_assert_1.default)(publicKey, 'PublicKey not found in discovery.');
|
|
36
|
+
return publicKey;
|
|
37
|
+
},
|
|
38
|
+
initiator,
|
|
39
|
+
userSession: session,
|
|
40
|
+
discoveryKey: channel
|
|
41
|
+
});
|
|
42
|
+
protocol.setExtensions(plugins.map((plugin) => plugin.createExtension())).init();
|
|
43
|
+
(0, log_1.log)('Created protocol', {}, { file: "packages/core/mesh/network-manager/src/protocol-factory.ts", line: 54 });
|
|
44
|
+
return protocol;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
exports.protocolFactory = protocolFactory;
|
|
48
|
+
const createProtocolFactory = (topic, peerId, plugins) => (0, exports.protocolFactory)({
|
|
49
|
+
getTopics: () => [topic.asBuffer()],
|
|
50
|
+
session: { peerId: keys_1.PublicKey.stringify(peerId.asBuffer()) },
|
|
51
|
+
plugins
|
|
52
|
+
});
|
|
53
|
+
exports.createProtocolFactory = createProtocolFactory;
|
|
54
|
+
/**
|
|
55
|
+
* Creates a ProtocolProvider for simple transport connections with only one protocol plugin.
|
|
56
|
+
* @deprecated Use `createProtocolFactory`.
|
|
57
|
+
*/
|
|
58
|
+
const transportProtocolProvider = (rendezvousKey, peerId, protocolPlugin) => (0, exports.protocolFactory)({
|
|
59
|
+
getTopics: () => [rendezvousKey],
|
|
60
|
+
session: { peerId: keys_1.PublicKey.stringify(peerId) },
|
|
61
|
+
plugins: [protocolPlugin]
|
|
62
|
+
});
|
|
63
|
+
exports.transportProtocolProvider = transportProtocolProvider;
|
|
64
|
+
//# sourceMappingURL=protocol-factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol-factory.js","sourceRoot":"","sources":["../../src/protocol-factory.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,8DAAiC;AAEjC,yCAA4C;AAC5C,qCAAuC;AACvC,mCAAgC;AAChC,uDAA0D;AAU1D;;;;;;;;GAQG;AACI,MAAM,eAAe,GAAG,CAAC,EAC9B,OAAO,GAAG,EAAE,EACZ,OAAO,GAAG,EAAE,EACZ,SAAS,EACc,EAAoB,EAAE;IAC7C,IAAA,qBAAM,EAAC,SAAS,CAAC,CAAC;IAClB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE;QAChC,MAAM,QAAQ,GAAG,IAAI,wBAAQ,CAAC;YAC5B,aAAa,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;YAC7B,oBAAoB,EAAE,CAAC,EAAE,EAAE,EAAE;gBAC3B,MAAM,SAAS,GAAG,SAAS,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,qBAAY,EAAC,KAAK,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC9E,IAAI,SAAS,EAAE;oBACb,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,gBAAS,CAAC,SAAS,CAAC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../src/signal/index.ts"],"names":[],"mappings":"AAIA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2020 DXOS.org
|
|
4
|
+
//
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
__exportStar(require("./signal-connection"), exports);
|
|
21
|
+
__exportStar(require("./signal-messaging"), exports);
|
|
22
|
+
__exportStar(require("./message-router"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/signal/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;AAEF,sDAAoC;AACpC,qDAAmC;AACnC,mDAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.test.d.ts","sourceRoot":"","sources":["../../../src/signal/integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2022 DXOS.org
|
|
4
|
+
//
|
|
5
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
// @dxos/mocha platform=nodejs
|
|
10
|
+
const earljs_1 = require("earljs");
|
|
11
|
+
const wait_for_expect_1 = __importDefault(require("wait-for-expect"));
|
|
12
|
+
const keys_1 = require("@dxos/keys");
|
|
13
|
+
const messaging_1 = require("@dxos/messaging");
|
|
14
|
+
const signal_1 = require("@dxos/signal");
|
|
15
|
+
const message_router_1 = require("./message-router");
|
|
16
|
+
describe('Signal Integration Test', function () {
|
|
17
|
+
let broker;
|
|
18
|
+
before(async function () {
|
|
19
|
+
broker = await (0, signal_1.createTestBroker)();
|
|
20
|
+
});
|
|
21
|
+
after(function () {
|
|
22
|
+
broker.stop();
|
|
23
|
+
});
|
|
24
|
+
const setupPeer = ({ topic = keys_1.PublicKey.random() } = {}) => {
|
|
25
|
+
const signalManager = new messaging_1.WebsocketSignalManager([broker.url()]);
|
|
26
|
+
signalManager.onMessage.on((message) => messageRouter.receiveMessage(message));
|
|
27
|
+
const receivedSignals = [];
|
|
28
|
+
const signalMock = async (msg) => {
|
|
29
|
+
receivedSignals.push(msg);
|
|
30
|
+
};
|
|
31
|
+
const messageRouter = new message_router_1.MessageRouter({
|
|
32
|
+
sendMessage: signalManager.sendMessage.bind(signalManager),
|
|
33
|
+
onSignal: signalMock,
|
|
34
|
+
onOffer: async () => ({ accept: true }),
|
|
35
|
+
topic
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
signalManager,
|
|
39
|
+
receivedSignals,
|
|
40
|
+
messageRouter
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
it('two peers connecting', async function () {
|
|
44
|
+
const peer1 = keys_1.PublicKey.random();
|
|
45
|
+
const peer2 = keys_1.PublicKey.random();
|
|
46
|
+
const topic = keys_1.PublicKey.random();
|
|
47
|
+
const peerNetworking1 = setupPeer({ topic });
|
|
48
|
+
const peerNetworking2 = setupPeer({ topic });
|
|
49
|
+
const promise1 = peerNetworking1.signalManager.swarmEvent.waitFor(({ swarmEvent }) => !!swarmEvent.peerAvailable && peer2.equals(swarmEvent.peerAvailable.peer));
|
|
50
|
+
const promise2 = peerNetworking1.signalManager.swarmEvent.waitFor(({ swarmEvent }) => !!swarmEvent.peerAvailable && peer1.equals(swarmEvent.peerAvailable.peer));
|
|
51
|
+
await peerNetworking1.signalManager.join({ topic, peerId: peer1 });
|
|
52
|
+
await peerNetworking2.signalManager.join({ topic, peerId: peer2 });
|
|
53
|
+
await promise1;
|
|
54
|
+
await promise2;
|
|
55
|
+
(0, earljs_1.expect)(await peerNetworking1.messageRouter.offer({
|
|
56
|
+
topic,
|
|
57
|
+
author: peer1,
|
|
58
|
+
recipient: peer2,
|
|
59
|
+
sessionId: keys_1.PublicKey.random(),
|
|
60
|
+
data: {
|
|
61
|
+
offer: {}
|
|
62
|
+
}
|
|
63
|
+
})).toBeAnObjectWith({ accept: true });
|
|
64
|
+
(0, earljs_1.expect)(await peerNetworking2.messageRouter.offer({
|
|
65
|
+
topic,
|
|
66
|
+
author: peer2,
|
|
67
|
+
recipient: peer1,
|
|
68
|
+
sessionId: keys_1.PublicKey.random(),
|
|
69
|
+
data: {
|
|
70
|
+
offer: {}
|
|
71
|
+
}
|
|
72
|
+
})).toBeAnObjectWith({ accept: true });
|
|
73
|
+
{
|
|
74
|
+
const message = {
|
|
75
|
+
topic,
|
|
76
|
+
author: peer1,
|
|
77
|
+
recipient: peer2,
|
|
78
|
+
sessionId: keys_1.PublicKey.random(),
|
|
79
|
+
data: {
|
|
80
|
+
signal: { json: JSON.stringify({ foo: 'bar' }) }
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
await peerNetworking1.messageRouter.signal(message);
|
|
84
|
+
await (0, wait_for_expect_1.default)(() => {
|
|
85
|
+
(0, earljs_1.expect)(peerNetworking2.receivedSignals[0]).toBeAnObjectWith(message);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
{
|
|
89
|
+
const message = {
|
|
90
|
+
topic,
|
|
91
|
+
author: peer2,
|
|
92
|
+
recipient: peer1,
|
|
93
|
+
sessionId: keys_1.PublicKey.random(),
|
|
94
|
+
data: {
|
|
95
|
+
signal: { json: JSON.stringify({ foo: 'bar' }) }
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
await peerNetworking2.messageRouter.signal(message);
|
|
99
|
+
await (0, wait_for_expect_1.default)(() => {
|
|
100
|
+
(0, earljs_1.expect)(peerNetworking1.receivedSignals[0]).toBeAnObjectWith(message);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
//# sourceMappingURL=integration.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.test.js","sourceRoot":"","sources":["../../../src/signal/integration.test.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;AAEF,8BAA8B;AAE9B,mCAAgC;AAChC,sEAA4C;AAE5C,qCAAuC;AACvC,+CAAyD;AACzD,yCAA4D;AAE5D,qDAAiD;AAGjD,QAAQ,CAAC,yBAAyB,EAAE;IAClC,IAAI,MAAkB,CAAC;IAEvB,MAAM,CAAC,KAAK;QACV,MAAM,GAAG,MAAM,IAAA,yBAAgB,GAAE,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,KAAK,CAAC;QACJ,MAAM,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,CAAC,EAAE,KAAK,GAAG,gBAAS,CAAC,MAAM,EAAE,KAA4B,EAAE,EAAE,EAAE;QAC/E,MAAM,aAAa,GAAG,IAAI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oBACJ,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE;iBACjD;aACF,CAAC;YACF,MAAM,eAAe,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAEpD,MAAM,IAAA,yBAAa,EAAC,GAAG,EAAE;gBACvB,IAAA,eAAM,EAAC,eAAe,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;YACvE,CAAC,CAAC,CAAC;SACJ;QAED;YACE,MAAM,OAAO,GAAkB;gBAC7B,KAAK;gBACL,MAAM,EAAE,KAAK;gBACb,SAAS,EAAE,KAAK;gBAChB,SAAS,EAAE,gBAAS,CAAC,MAAM,EAAE;gBAC7B,IAAI,EAAE;oBACJ,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE;iBACjD;aACF,CAAC;YACF,MAAM,eAAe,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAEpD,MAAM,IAAA,yBAAa,EAAC,GAAG,EAAE;gBACvB,IAAA,eAAM,EAAC,eAAe,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;YACvE,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Any } from '@dxos/codec-protobuf';
|
|
2
|
+
import { PublicKey } from '@dxos/keys';
|
|
3
|
+
import { Answer } from '@dxos/protocols/proto/dxos/mesh/swarm';
|
|
4
|
+
import { OfferMessage, SignalMessage, SignalMessaging } from './signal-messaging';
|
|
5
|
+
interface MessageRouterOptions {
|
|
6
|
+
sendMessage: (params: {
|
|
7
|
+
author: PublicKey;
|
|
8
|
+
recipient: PublicKey;
|
|
9
|
+
payload: Any;
|
|
10
|
+
}) => Promise<void>;
|
|
11
|
+
onOffer: (message: OfferMessage) => Promise<Answer>;
|
|
12
|
+
onSignal: (message: SignalMessage) => Promise<void>;
|
|
13
|
+
topic: PublicKey;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Adds offer/answer and signal interfaces.
|
|
17
|
+
*/
|
|
18
|
+
export declare class MessageRouter implements SignalMessaging {
|
|
19
|
+
private readonly _onSignal;
|
|
20
|
+
private readonly _sendMessage;
|
|
21
|
+
private readonly _onOffer;
|
|
22
|
+
private readonly _topic;
|
|
23
|
+
private readonly _offerRecords;
|
|
24
|
+
constructor({ sendMessage, onSignal, onOffer, topic }: MessageRouterOptions);
|
|
25
|
+
receiveMessage({ author, recipient, payload }: {
|
|
26
|
+
author: PublicKey;
|
|
27
|
+
recipient: PublicKey;
|
|
28
|
+
payload: Any;
|
|
29
|
+
}): Promise<void>;
|
|
30
|
+
signal(message: SignalMessage): Promise<void>;
|
|
31
|
+
offer(message: OfferMessage): Promise<Answer>;
|
|
32
|
+
private _sendReliableMessage;
|
|
33
|
+
private _encodeAndSend;
|
|
34
|
+
private _resolveAnswers;
|
|
35
|
+
private _handleOffer;
|
|
36
|
+
private _handleSignal;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=message-router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-router.d.ts","sourceRoot":"","sources":["../../../src/signal/message-router.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAE,MAAM,EAAgB,MAAM,uCAAuC,CAAC;AAG7E,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAOlF,UAAU,oBAAoB;IAC5B,WAAW,EA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ault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.MessageRouter = void 0;
|
|
10
|
+
const assert_1 = __importDefault(require("assert"));
|
|
11
|
+
const keys_1 = require("@dxos/keys");
|
|
12
|
+
const log_1 = require("@dxos/log");
|
|
13
|
+
const protocols_1 = require("@dxos/protocols");
|
|
14
|
+
const util_1 = require("@dxos/util");
|
|
15
|
+
/**
|
|
16
|
+
* Adds offer/answer and signal interfaces.
|
|
17
|
+
*/
|
|
18
|
+
class MessageRouter {
|
|
19
|
+
constructor({ sendMessage, onSignal, onOffer, topic }) {
|
|
20
|
+
this._offerRecords = new util_1.ComplexMap((key) => key.toHex());
|
|
21
|
+
this._sendMessage = sendMessage;
|
|
22
|
+
this._onSignal = onSignal;
|
|
23
|
+
this._onOffer = onOffer;
|
|
24
|
+
this._topic = topic;
|
|
25
|
+
}
|
|
26
|
+
async receiveMessage({ author, recipient, payload }) {
|
|
27
|
+
var _a, _b, _c;
|
|
28
|
+
if (payload.type_url !== 'dxos.mesh.swarm.SwarmMessage') {
|
|
29
|
+
// Ignore not swarm messages.
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const message = protocols_1.schema.getCodecForType('dxos.mesh.swarm.SwarmMessage').decode(payload.value);
|
|
33
|
+
if (!this._topic.equals(message.topic)) {
|
|
34
|
+
// Ignore messages from wrong topics.
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
(0, log_1.log)('received', { from: author, to: recipient, msg: message }, { file: "packages/core/mesh/network-manager/src/signal/message-router.ts", line: 67 });
|
|
38
|
+
if ((_a = message.data) === null || _a === void 0 ? void 0 : _a.offer) {
|
|
39
|
+
await this._handleOffer({ author, recipient, message });
|
|
40
|
+
}
|
|
41
|
+
else if ((_b = message.data) === null || _b === void 0 ? void 0 : _b.answer) {
|
|
42
|
+
await this._resolveAnswers(message);
|
|
43
|
+
}
|
|
44
|
+
else if ((_c = message.data) === null || _c === void 0 ? void 0 : _c.signal) {
|
|
45
|
+
await this._handleSignal({ author, recipient, message });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async signal(message) {
|
|
49
|
+
var _a;
|
|
50
|
+
(0, assert_1.default)((_a = message.data) === null || _a === void 0 ? void 0 : _a.signal);
|
|
51
|
+
await this._sendReliableMessage({
|
|
52
|
+
author: message.author,
|
|
53
|
+
recipient: message.recipient,
|
|
54
|
+
message
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
async offer(message) {
|
|
58
|
+
const networkMessage = {
|
|
59
|
+
...message,
|
|
60
|
+
messageId: keys_1.PublicKey.random()
|
|
61
|
+
};
|
|
62
|
+
return new Promise((resolve, reject) => {
|
|
63
|
+
this._offerRecords.set(networkMessage.messageId, { resolve, reject });
|
|
64
|
+
return this._sendReliableMessage({
|
|
65
|
+
author: message.author,
|
|
66
|
+
recipient: message.recipient,
|
|
67
|
+
message: networkMessage
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
async _sendReliableMessage({ author, recipient, message }) {
|
|
72
|
+
var _a;
|
|
73
|
+
const networkMessage = {
|
|
74
|
+
...message,
|
|
75
|
+
// Setting unique message_id if it not specified yet.
|
|
76
|
+
messageId: (_a = message.messageId) !== null && _a !== void 0 ? _a : keys_1.PublicKey.random()
|
|
77
|
+
};
|
|
78
|
+
(0, log_1.log)('sending', { from: author, to: recipient, msg: networkMessage }, { file: "packages/core/mesh/network-manager/src/signal/message-router.ts", line: 117 });
|
|
79
|
+
await this._encodeAndSend({ author, recipient, message: networkMessage });
|
|
80
|
+
}
|
|
81
|
+
async _encodeAndSend({ author, recipient, message }) {
|
|
82
|
+
await this._sendMessage({
|
|
83
|
+
author,
|
|
84
|
+
recipient,
|
|
85
|
+
payload: {
|
|
86
|
+
type_url: 'dxos.mesh.swarm.SwarmMessage',
|
|
87
|
+
value: protocols_1.schema.getCodecForType('dxos.mesh.swarm.SwarmMessage').encode(message)
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
async _resolveAnswers(message) {
|
|
92
|
+
var _a, _b, _c;
|
|
93
|
+
(0, assert_1.default)((_b = (_a = message.data) === null || _a === void 0 ? void 0 : _a.answer) === null || _b === void 0 ? void 0 : _b.offerMessageId, 'No offerMessageId');
|
|
94
|
+
const offerRecord = this._offerRecords.get(message.data.answer.offerMessageId);
|
|
95
|
+
if (offerRecord) {
|
|
96
|
+
this._offerRecords.delete(message.data.answer.offerMessageId);
|
|
97
|
+
(0, assert_1.default)((_c = message.data) === null || _c === void 0 ? void 0 : _c.answer, 'No answer');
|
|
98
|
+
(0, log_1.log)('resolving', { answer: message.data.answer }, { file: "packages/core/mesh/network-manager/src/signal/message-router.ts", line: 146 });
|
|
99
|
+
offerRecord.resolve(message.data.answer);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
async _handleOffer({ author, recipient, message }) {
|
|
103
|
+
(0, assert_1.default)(message.data.offer, 'No offer');
|
|
104
|
+
const offerMessage = {
|
|
105
|
+
author,
|
|
106
|
+
recipient,
|
|
107
|
+
...message,
|
|
108
|
+
data: { offer: message.data.offer }
|
|
109
|
+
};
|
|
110
|
+
const answer = await this._onOffer(offerMessage);
|
|
111
|
+
answer.offerMessageId = message.messageId;
|
|
112
|
+
await this._sendReliableMessage({
|
|
113
|
+
author: recipient,
|
|
114
|
+
recipient: author,
|
|
115
|
+
message: {
|
|
116
|
+
topic: message.topic,
|
|
117
|
+
sessionId: message.sessionId,
|
|
118
|
+
data: { answer }
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
async _handleSignal({ author, recipient, message }) {
|
|
123
|
+
(0, assert_1.default)(message.messageId);
|
|
124
|
+
(0, assert_1.default)(message.data.signal, 'No Signal');
|
|
125
|
+
const signalMessage = {
|
|
126
|
+
author,
|
|
127
|
+
recipient,
|
|
128
|
+
...message,
|
|
129
|
+
data: { signal: message.data.signal }
|
|
130
|
+
};
|
|
131
|
+
await this._onSignal(signalMessage);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.MessageRouter = MessageRouter;
|
|
135
|
+
//# sourceMappingURL=message-router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-router.js","sourceRoot":"","sources":["../../../src/signal/message-router.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,oDAA4B;AAG5B,qCAAuC;AACvC,mCAAgC;AAChC,+CAAyC;AAEzC,qCAAsD;AAgBtD;;GAEG;AACH,MAAa,aAAa;IASxB,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAwB;QAF1D,kBAAa,GAAuC,IAAI,iBAAU,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;QAGxG,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,EACnB,MAAM,EACN,SAAS,EACT,OAAO,EAKR;;QACC,IAAI,OAAO,CAAC,QAAQ,KAAK,8BAA8B,EAAE;YACvD,6BAA6B;YAC7B,OAAO;SACR;QACD,MAAM,OAAO,GAAiB,kBAAM,CAAC,eAAe,CAAC,8BAA8B,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAE3G,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACtC,qCAAqC;YACrC,OAAO;SACR;QAED,IAAA,SAAG,EAAC,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE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EAAE;SACtC,CAAC;QAEF,MAAM,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IACtC,CAAC;CACF;AAzKD,sCAyKC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-router.test.d.ts","sourceRoot":"","sources":["../../../src/signal/message-router.test.ts"],"names":[],"mappings":""}
|