@libp2p/mplex 11.0.1-c628c44c5 → 11.0.2-7f7ec82ae

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.
@@ -32,12 +32,15 @@
32
32
  */
33
33
  import { type MplexComponents } from './mplex.js';
34
34
  import type { StreamMuxerFactory } from '@libp2p/interface';
35
+ export type { MplexComponents };
35
36
  export interface MplexInit {
36
37
  /**
37
38
  * The maximum size of message that can be sent in one go in bytes.
38
39
  * Messages larger than this will be split into multiple smaller
39
40
  * messages. If we receive a message larger than this an error will
40
- * be thrown and the connection closed. (default: 1MB)
41
+ * be thrown and the connection closed.
42
+ *
43
+ * @default 1048576
41
44
  */
42
45
  maxMsgSize?: number;
43
46
  /**
@@ -45,31 +48,40 @@ export interface MplexInit {
45
48
  * Before messages are deserialized, the raw bytes are buffered to ensure
46
49
  * we have the complete message to deserialized. If the queue gets longer
47
50
  * than this value an error will be thrown and the connection closed.
48
- * (default: 4MB)
51
+ *
52
+ * @default 4194304
49
53
  */
50
54
  maxUnprocessedMessageQueueSize?: number;
51
55
  /**
52
56
  * The maximum number of multiplexed streams that can be open at any
53
57
  * one time. A request to open more than this will have a stream
54
58
  * reset message sent immediately as a response for the newly opened
55
- * stream id (default: 1024)
59
+ * stream id
60
+ *
61
+ * @default 1024
56
62
  */
57
63
  maxInboundStreams?: number;
58
64
  /**
59
65
  * The maximum number of multiplexed streams that can be open at any
60
- * one time. An attempt to open more than this will throw (default: 1024)
66
+ * one time. An attempt to open more than this will throw
67
+ *
68
+ * @default 1024
61
69
  */
62
70
  maxOutboundStreams?: number;
63
71
  /**
64
72
  * Incoming stream messages are buffered until processed by the stream
65
73
  * handler. If the buffer reaches this size in bytes the stream will
66
- * be reset (default: 4MB)
74
+ * be reset
75
+ *
76
+ * @default 4194304
67
77
  */
68
78
  maxStreamBufferSize?: number;
69
79
  /**
70
80
  * When `maxInboundStreams` is hit, if the remote continues try to open
71
81
  * more than this many new multiplexed streams per second the connection
72
- * will be closed (default: 5)
82
+ * will be closed
83
+ *
84
+ * @default 5
73
85
  */
74
86
  disconnectThreshold?: number;
75
87
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,YAAY,CAAA;AACnE,OAAO,KAAK,EAAe,kBAAkB,EAAmB,MAAM,mBAAmB,CAAA;AAEzF,MAAM,WAAW,SAAS;IACxB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;;;;;OAMG;IACH,8BAA8B,CAAC,EAAE,MAAM,CAAA;IAEvC;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAE5B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B;AA0BD;;GAEG;AACH,wBAAgB,KAAK,CAAE,IAAI,GAAE,SAAc,GAAG,CAAC,UAAU,EAAE,eAAe,KAAK,kBAAkB,CAEhG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,YAAY,CAAA;AACnE,OAAO,KAAK,EAAe,kBAAkB,EAAmB,MAAM,mBAAmB,CAAA;AAEzF,YAAY,EAAE,eAAe,EAAE,CAAA;AAE/B,MAAM,WAAW,SAAS;IACxB;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;;;;;;OAOG;IACH,8BAA8B,CAAC,EAAE,MAAM,CAAA;IAEvC;;;;;;;OAOG;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{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAwB,MAAM,YAAY,CAAA;AA+DnE,MAAM,KAAK;IACF,QAAQ,GAAG,cAAc,CAAA;IACf,KAAK,CAAW;IAChB,UAAU,CAAiB;IAE5C,YAAa,UAA2B,EAAE,OAAkB,EAAE;QAC5D,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;IACnB,CAAC;IAEQ,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,eAAe,CAAA;IAEtC,CAAC,mBAAmB,CAAC,GAAa;QACzC,6BAA6B;KAC9B,CAAA;IAED,iBAAiB,CAAE,OAAwB,EAAE;QAC3C,OAAO,IAAI,gBAAgB,CAAC,IAAI,CAAC,UAAU,EAAE;YAC3C,GAAG,IAAI;YACP,GAAG,IAAI,CAAC,KAAK;SACd,CAAC,CAAA;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,KAAK,CAAE,OAAkB,EAAE;IACzC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;AACpD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/mplex",
3
- "version": "11.0.1-c628c44c5",
3
+ "version": "11.0.2-7f7ec82ae",
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",
@@ -62,8 +62,8 @@
62
62
  "test:electron-main": "aegir test -t electron-main"
63
63
  },
64
64
  "dependencies": {
65
- "@libp2p/interface": "2.0.1-c628c44c5",
66
- "@libp2p/utils": "6.0.1-c628c44c5",
65
+ "@libp2p/interface": "2.1.0-7f7ec82ae",
66
+ "@libp2p/utils": "6.0.2-7f7ec82ae",
67
67
  "it-pipe": "^3.0.1",
68
68
  "it-pushable": "^3.2.3",
69
69
  "it-stream-types": "^2.0.1",
@@ -72,8 +72,8 @@
72
72
  "uint8arrays": "^5.1.0"
73
73
  },
74
74
  "devDependencies": {
75
- "@libp2p/interface-compliance-tests": "6.0.1-c628c44c5",
76
- "@libp2p/logger": "5.0.1-c628c44c5",
75
+ "@libp2p/interface-compliance-tests": "6.1.0-7f7ec82ae",
76
+ "@libp2p/logger": "5.0.2-7f7ec82ae",
77
77
  "aegir": "^44.0.1",
78
78
  "benchmark": "^2.1.4",
79
79
  "cborg": "^4.2.0",
package/src/index.ts CHANGED
@@ -35,12 +35,16 @@ import { serviceCapabilities } from '@libp2p/interface'
35
35
  import { MplexStreamMuxer, type MplexComponents } from './mplex.js'
36
36
  import type { StreamMuxer, StreamMuxerFactory, StreamMuxerInit } from '@libp2p/interface'
37
37
 
38
+ export type { MplexComponents }
39
+
38
40
  export interface MplexInit {
39
41
  /**
40
42
  * The maximum size of message that can be sent in one go in bytes.
41
43
  * Messages larger than this will be split into multiple smaller
42
44
  * messages. If we receive a message larger than this an error will
43
- * be thrown and the connection closed. (default: 1MB)
45
+ * be thrown and the connection closed.
46
+ *
47
+ * @default 1048576
44
48
  */
45
49
  maxMsgSize?: number
46
50
 
@@ -49,7 +53,8 @@ export interface MplexInit {
49
53
  * Before messages are deserialized, the raw bytes are buffered to ensure
50
54
  * we have the complete message to deserialized. If the queue gets longer
51
55
  * than this value an error will be thrown and the connection closed.
52
- * (default: 4MB)
56
+ *
57
+ * @default 4194304
53
58
  */
54
59
  maxUnprocessedMessageQueueSize?: number
55
60
 
@@ -57,27 +62,35 @@ export interface MplexInit {
57
62
  * The maximum number of multiplexed streams that can be open at any
58
63
  * one time. A request to open more than this will have a stream
59
64
  * reset message sent immediately as a response for the newly opened
60
- * stream id (default: 1024)
65
+ * stream id
66
+ *
67
+ * @default 1024
61
68
  */
62
69
  maxInboundStreams?: number
63
70
 
64
71
  /**
65
72
  * The maximum number of multiplexed streams that can be open at any
66
- * one time. An attempt to open more than this will throw (default: 1024)
73
+ * one time. An attempt to open more than this will throw
74
+ *
75
+ * @default 1024
67
76
  */
68
77
  maxOutboundStreams?: number
69
78
 
70
79
  /**
71
80
  * Incoming stream messages are buffered until processed by the stream
72
81
  * handler. If the buffer reaches this size in bytes the stream will
73
- * be reset (default: 4MB)
82
+ * be reset
83
+ *
84
+ * @default 4194304
74
85
  */
75
86
  maxStreamBufferSize?: number
76
87
 
77
88
  /**
78
89
  * When `maxInboundStreams` is hit, if the remote continues try to open
79
90
  * more than this many new multiplexed streams per second the connection
80
- * will be closed (default: 5)
91
+ * will be closed
92
+ *
93
+ * @default 5
81
94
  */
82
95
  disconnectThreshold?: number
83
96
  }