@dxos/broadcast
Advanced tools
Comparing version 2.33.9-dev.6b3d59af to 2.33.9-dev.6efa8ddf
@@ -10,4 +10,4 @@ "use strict"; | ||
exports.Broadcast = void 0; | ||
const assert_1 = __importDefault(require("assert")); | ||
const debug_1 = __importDefault(require("debug")); | ||
const node_assert_1 = __importDefault(require("node:assert")); | ||
const tiny_lru_1 = __importDefault(require("tiny-lru")); | ||
@@ -31,5 +31,5 @@ const async_1 = require("@dxos/async"); | ||
this.subscribeError = new async_1.Event(); | ||
(0, assert_1.default)(middleware); | ||
(0, assert_1.default)(middleware.send); | ||
(0, assert_1.default)(middleware.subscribe); | ||
(0, node_assert_1.default)(middleware); | ||
(0, node_assert_1.default)(middleware.send); | ||
(0, node_assert_1.default)(middleware.subscribe); | ||
const { id = (0, crypto_1.randomBytes)(32), maxAge = 10 * 1000, maxSize = 1000 } = options; | ||
@@ -49,4 +49,4 @@ this._id = id; | ||
const { seqno = (0, crypto_1.randomBytes)(32) } = options; | ||
(0, assert_1.default)(Buffer.isBuffer(data)); | ||
(0, assert_1.default)(Buffer.isBuffer(seqno)); | ||
(0, node_assert_1.default)(Buffer.isBuffer(data)); | ||
(0, node_assert_1.default)(Buffer.isBuffer(seqno)); | ||
return this._publish({ | ||
@@ -62,3 +62,3 @@ seqno, | ||
updatePeers(peers) { | ||
(0, assert_1.default)(peers.every(peer => Buffer.isBuffer(peer.id)), 'Peer ID is expected to be a buffer.'); | ||
(0, node_assert_1.default)(peers.every(peer => Buffer.isBuffer(peer.id)), 'Peer ID is expected to be a buffer.'); | ||
this._peers = peers; | ||
@@ -65,0 +65,0 @@ } |
@@ -0,7 +1,15 @@ | ||
/** | ||
* Defined in: | ||
* {@link file://./../../schema.proto} | ||
*/ | ||
export interface Packet { | ||
seqno?: Uint8Array; | ||
origin?: Uint8Array; | ||
seqno: Uint8Array; | ||
origin: Uint8Array; | ||
/** | ||
* Options: | ||
* - proto3_optional = true | ||
*/ | ||
from?: Uint8Array; | ||
data?: Uint8Array; | ||
data: Uint8Array; | ||
} | ||
//# sourceMappingURL=broadcast.d.ts.map |
@@ -5,4 +5,4 @@ "use strict"; | ||
const codec_protobuf_1 = require("@dxos/codec-protobuf"); | ||
exports.schemaJson = JSON.parse("{\"nested\":{\"dxos\":{\"nested\":{\"broadcast\":{\"nested\":{\"Packet\":{\"fields\":{\"seqno\":{\"type\":\"bytes\",\"id\":1,\"comment\":null},\"origin\":{\"type\":\"bytes\",\"id\":2,\"comment\":null},\"from\":{\"type\":\"bytes\",\"id\":3,\"comment\":null},\"data\":{\"type\":\"bytes\",\"id\":4,\"comment\":null}},\"comment\":null}}}}}}}"); | ||
exports.schemaJson = JSON.parse("{\"nested\":{\"dxos\":{\"nested\":{\"broadcast\":{\"nested\":{\"Packet\":{\"oneofs\":{\"_from\":{\"oneof\":[\"from\"]}},\"fields\":{\"seqno\":{\"type\":\"bytes\",\"id\":1,\"comment\":null},\"origin\":{\"type\":\"bytes\",\"id\":2,\"comment\":null},\"from\":{\"type\":\"bytes\",\"id\":3,\"options\":{\"proto3_optional\":true},\"comment\":null},\"data\":{\"type\":\"bytes\",\"id\":4,\"comment\":null}},\"comment\":null}}}}}}}"); | ||
exports.schema = codec_protobuf_1.Schema.fromJson(exports.schemaJson); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@dxos/broadcast", | ||
"version": "2.33.9-dev.6b3d59af", | ||
"version": "2.33.9-dev.6efa8ddf", | ||
"description": "Abstract module to send broadcast messages.", | ||
@@ -13,2 +13,5 @@ "repository": { | ||
"types": "dist/src/index.d.ts", | ||
"browser": { | ||
"node:assert": "assert" | ||
}, | ||
"files": [ | ||
@@ -19,5 +22,6 @@ "srd", | ||
"dependencies": { | ||
"@dxos/async": "2.33.9-dev.6b3d59af", | ||
"@dxos/codec-protobuf": "2.33.9-dev.6b3d59af", | ||
"@dxos/crypto": "2.33.9-dev.6b3d59af", | ||
"@dxos/async": "2.33.9-dev.6efa8ddf", | ||
"@dxos/codec-protobuf": "2.33.9-dev.6efa8ddf", | ||
"@dxos/crypto": "2.33.9-dev.6efa8ddf", | ||
"assert": "^2.0.0", | ||
"debug": "^4.3.3", | ||
@@ -28,6 +32,6 @@ "tiny-lru": "^7.0.6" | ||
"@dxos/eslint-plugin": "~1.0.34", | ||
"@dxos/network-generator": "2.33.9-dev.6b3d59af", | ||
"@dxos/network-generator": "2.33.9-dev.6efa8ddf", | ||
"@dxos/protocols-toolchain": "2.33.8", | ||
"@types/debug": "^4.1.7", | ||
"@types/jest": "^26.0.7", | ||
"@types/jest": "^28.1.6", | ||
"@types/node": "^16.11.27", | ||
@@ -34,0 +38,0 @@ "eslint": "^7.12.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
534
75690
6
+ Addedassert@^2.0.0
+ Added@dxos/async@2.33.9-dev.6efa8ddf(transitive)
+ Added@dxos/codec-protobuf@2.33.9-dev.6efa8ddf(transitive)
+ Added@dxos/crypto@2.33.9-dev.6efa8ddf(transitive)
+ Added@dxos/debug@2.33.9-dev.6efa8ddf(transitive)
+ Added@dxos/protocols@2.33.9-dev.6efa8ddf(transitive)
+ Addedevents@3.3.0(transitive)
- Removed@dxos/async@2.33.9-dev.6b3d59af(transitive)
- Removed@dxos/codec-protobuf@2.33.9-dev.6b3d59af(transitive)
- Removed@dxos/crypto@2.33.9-dev.6b3d59af(transitive)
- Removed@dxos/debug@2.33.9-dev.6b3d59af(transitive)
- Removed@dxos/protocols@2.33.9-dev.6b3d59af(transitive)