@libp2p/mplex 12.0.16 → 12.0.18-8ddbb9e81
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/dist/index.min.js +1 -1
- package/dist/index.min.js.map +3 -3
- package/dist/src/decode.d.ts +2 -2
- package/dist/src/decode.js +1 -1
- package/dist/src/encode.d.ts +1 -1
- package/dist/src/encode.js +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/mplex.d.ts +3 -3
- package/dist/src/mplex.js +3 -3
- package/dist/src/stream.js +2 -2
- package/package.json +7 -6
- package/src/decode.ts +2 -2
- package/src/encode.ts +2 -2
- package/src/index.ts +1 -1
- package/src/mplex.ts +6 -6
- package/src/stream.ts +2 -2
- package/dist/typedoc-urls.json +0 -6
package/dist/src/decode.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Uint8ArrayList } from 'uint8arraylist';
|
|
2
|
-
import { MessageTypeNames } from './message-types.
|
|
3
|
-
import type { Message } from './message-types.
|
|
2
|
+
import { MessageTypeNames } from './message-types.ts';
|
|
3
|
+
import type { Message } from './message-types.ts';
|
|
4
4
|
export declare const MAX_MSG_SIZE: number;
|
|
5
5
|
export declare const MAX_MSG_QUEUE_SIZE: number;
|
|
6
6
|
interface MessageHeader {
|
package/dist/src/decode.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InvalidMessageError } from '@libp2p/interface';
|
|
2
2
|
import { Uint8ArrayList } from 'uint8arraylist';
|
|
3
|
-
import { MessageTypeNames, MessageTypes } from
|
|
3
|
+
import { MessageTypeNames, MessageTypes } from "./message-types.js";
|
|
4
4
|
export const MAX_MSG_SIZE = 1 << 20; // 1MB
|
|
5
5
|
export const MAX_MSG_QUEUE_SIZE = 4 << 20; // 4MB
|
|
6
6
|
export class Decoder {
|
package/dist/src/encode.d.ts
CHANGED
package/dist/src/encode.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as varint from 'uint8-varint';
|
|
2
2
|
import { Uint8ArrayList } from 'uint8arraylist';
|
|
3
3
|
import { allocUnsafe } from 'uint8arrays/alloc';
|
|
4
|
-
import { MessageTypes } from
|
|
4
|
+
import { MessageTypes } from "./message-types.js";
|
|
5
5
|
const POOL_SIZE = 10 * 1024;
|
|
6
6
|
class Encoder {
|
|
7
7
|
_pool;
|
package/dist/src/index.js
CHANGED
package/dist/src/mplex.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractStreamMuxer } from '@libp2p/utils';
|
|
2
|
-
import type { MplexInit } from './index.
|
|
3
|
-
import type { Message } from './message-types.
|
|
4
|
-
import type { MplexStream } from './stream.
|
|
2
|
+
import type { MplexInit } from './index.ts';
|
|
3
|
+
import type { Message } from './message-types.ts';
|
|
4
|
+
import type { MplexStream } from './stream.ts';
|
|
5
5
|
import type { CreateStreamOptions, MultiaddrConnection, MessageStreamDirection } from '@libp2p/interface';
|
|
6
6
|
import type { Uint8ArrayList } from 'uint8arraylist';
|
|
7
7
|
export declare class MplexStreamMuxer extends AbstractStreamMuxer<MplexStream> {
|
package/dist/src/mplex.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { MuxerClosedError } from '@libp2p/interface';
|
|
2
2
|
import { RateLimiter, AbstractStreamMuxer } from '@libp2p/utils';
|
|
3
3
|
import { toString as uint8ArrayToString } from 'uint8arrays';
|
|
4
|
-
import { Decoder, MAX_MSG_QUEUE_SIZE, MAX_MSG_SIZE } from
|
|
5
|
-
import { MessageTypes, MessageTypeNames } from
|
|
6
|
-
import { createStream } from
|
|
4
|
+
import { Decoder, MAX_MSG_QUEUE_SIZE, MAX_MSG_SIZE } from "./decode.js";
|
|
5
|
+
import { MessageTypes, MessageTypeNames } from "./message-types.js";
|
|
6
|
+
import { createStream } from "./stream.js";
|
|
7
7
|
const DISCONNECT_THRESHOLD = 5;
|
|
8
8
|
function printMessage(msg) {
|
|
9
9
|
const output = {
|
package/dist/src/stream.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AbstractStream } from '@libp2p/utils';
|
|
2
2
|
import { Uint8ArrayList } from 'uint8arraylist';
|
|
3
3
|
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string';
|
|
4
|
-
import { MAX_MSG_SIZE } from
|
|
4
|
+
import { MAX_MSG_SIZE } from "./decode.js";
|
|
5
5
|
import { encode } from "./encode.js";
|
|
6
|
-
import { InitiatorMessageTypes, ReceiverMessageTypes } from
|
|
6
|
+
import { InitiatorMessageTypes, ReceiverMessageTypes } from "./message-types.js";
|
|
7
7
|
export class MplexStream extends AbstractStream {
|
|
8
8
|
streamId;
|
|
9
9
|
types;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/mplex",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.18-8ddbb9e81",
|
|
4
4
|
"description": "JavaScript implementation of https://github.com/libp2p/mplex",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/stream-multiplexer-mplex#readme",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"exports": {
|
|
37
37
|
".": {
|
|
38
38
|
"types": "./dist/src/index.d.ts",
|
|
39
|
-
"import": "./dist/src/index.js"
|
|
39
|
+
"import": "./dist/src/index.js",
|
|
40
|
+
"module-sync": "./dist/src/index.js"
|
|
40
41
|
}
|
|
41
42
|
},
|
|
42
43
|
"scripts": {
|
|
@@ -55,16 +56,16 @@
|
|
|
55
56
|
"test:electron-main": "aegir test -t electron-main"
|
|
56
57
|
},
|
|
57
58
|
"dependencies": {
|
|
58
|
-
"@libp2p/interface": "
|
|
59
|
-
"@libp2p/utils": "
|
|
59
|
+
"@libp2p/interface": "3.2.2-8ddbb9e81",
|
|
60
|
+
"@libp2p/utils": "7.0.17-8ddbb9e81",
|
|
60
61
|
"it-pushable": "^3.2.3",
|
|
61
62
|
"uint8-varint": "^2.0.4",
|
|
62
63
|
"uint8arraylist": "^2.4.8",
|
|
63
64
|
"uint8arrays": "^5.1.0"
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
|
-
"@libp2p/interface-compliance-tests": "
|
|
67
|
-
"@libp2p/logger": "
|
|
67
|
+
"@libp2p/interface-compliance-tests": "7.0.18-8ddbb9e81",
|
|
68
|
+
"@libp2p/logger": "6.2.6-8ddbb9e81",
|
|
68
69
|
"aegir": "^47.0.22",
|
|
69
70
|
"benchmark": "^2.1.4",
|
|
70
71
|
"iso-random-stream": "^2.0.2",
|
package/src/decode.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InvalidMessageError } from '@libp2p/interface'
|
|
2
2
|
import { Uint8ArrayList } from 'uint8arraylist'
|
|
3
|
-
import { MessageTypeNames, MessageTypes } from './message-types.
|
|
4
|
-
import type { Message } from './message-types.
|
|
3
|
+
import { MessageTypeNames, MessageTypes } from './message-types.ts'
|
|
4
|
+
import type { Message } from './message-types.ts'
|
|
5
5
|
|
|
6
6
|
export const MAX_MSG_SIZE = 1 << 20 // 1MB
|
|
7
7
|
export const MAX_MSG_QUEUE_SIZE = 4 << 20 // 4MB
|
package/src/encode.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as varint from 'uint8-varint'
|
|
2
2
|
import { Uint8ArrayList } from 'uint8arraylist'
|
|
3
3
|
import { allocUnsafe } from 'uint8arrays/alloc'
|
|
4
|
-
import { MessageTypes } from './message-types.
|
|
5
|
-
import type { Message } from './message-types.
|
|
4
|
+
import { MessageTypes } from './message-types.ts'
|
|
5
|
+
import type { Message } from './message-types.ts'
|
|
6
6
|
|
|
7
7
|
const POOL_SIZE = 10 * 1024
|
|
8
8
|
|
package/src/index.ts
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
34
|
import { serviceCapabilities } from '@libp2p/interface'
|
|
35
|
-
import { MplexStreamMuxer } from './mplex.
|
|
35
|
+
import { MplexStreamMuxer } from './mplex.ts'
|
|
36
36
|
import type { MultiaddrConnection, StreamMuxer, StreamMuxerFactory } from '@libp2p/interface'
|
|
37
37
|
|
|
38
38
|
export interface MplexInit {
|
package/src/mplex.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { MuxerClosedError } from '@libp2p/interface'
|
|
2
2
|
import { RateLimiter, AbstractStreamMuxer } from '@libp2p/utils'
|
|
3
3
|
import { toString as uint8ArrayToString } from 'uint8arrays'
|
|
4
|
-
import { Decoder, MAX_MSG_QUEUE_SIZE, MAX_MSG_SIZE } from './decode.
|
|
5
|
-
import { MessageTypes, MessageTypeNames } from './message-types.
|
|
6
|
-
import { createStream } from './stream.
|
|
7
|
-
import type { MplexInit } from './index.
|
|
8
|
-
import type { Message } from './message-types.
|
|
9
|
-
import type { MplexStream } from './stream.
|
|
4
|
+
import { Decoder, MAX_MSG_QUEUE_SIZE, MAX_MSG_SIZE } from './decode.ts'
|
|
5
|
+
import { MessageTypes, MessageTypeNames } from './message-types.ts'
|
|
6
|
+
import { createStream } from './stream.ts'
|
|
7
|
+
import type { MplexInit } from './index.ts'
|
|
8
|
+
import type { Message } from './message-types.ts'
|
|
9
|
+
import type { MplexStream } from './stream.ts'
|
|
10
10
|
import type { CreateStreamOptions, MultiaddrConnection, MessageStreamDirection } from '@libp2p/interface'
|
|
11
11
|
import type { Uint8ArrayList } from 'uint8arraylist'
|
|
12
12
|
|
package/src/stream.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AbstractStream } from '@libp2p/utils'
|
|
2
2
|
import { Uint8ArrayList } from 'uint8arraylist'
|
|
3
3
|
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
|
|
4
|
-
import { MAX_MSG_SIZE } from './decode.
|
|
4
|
+
import { MAX_MSG_SIZE } from './decode.ts'
|
|
5
5
|
import { encode } from './encode.ts'
|
|
6
|
-
import { InitiatorMessageTypes, ReceiverMessageTypes } from './message-types.
|
|
6
|
+
import { InitiatorMessageTypes, ReceiverMessageTypes } from './message-types.ts'
|
|
7
7
|
import type { MplexStreamMuxer } from './mplex.ts'
|
|
8
8
|
import type { Logger, MessageStreamDirection } from '@libp2p/interface'
|
|
9
9
|
import type { AbstractStreamInit, SendResult } from '@libp2p/utils'
|
package/dist/typedoc-urls.json
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"MplexInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_mplex.MplexInit.html",
|
|
3
|
-
".:MplexInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_mplex.MplexInit.html",
|
|
4
|
-
"mplex": "https://libp2p.github.io/js-libp2p/functions/_libp2p_mplex.mplex.html",
|
|
5
|
-
".:mplex": "https://libp2p.github.io/js-libp2p/functions/_libp2p_mplex.mplex.html"
|
|
6
|
-
}
|