@nmtjs/protocol 0.15.3 → 0.16.0-beta.1
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/client/format.d.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import type { ProtocolBlob } from '../common/blob.ts';
|
|
2
2
|
import type { DecodeRPCContext } from '../common/types.ts';
|
|
3
|
-
import type { ProtocolClientBlobStream,
|
|
3
|
+
import type { ProtocolClientBlobStream, ProtocolServerBlobConsumer } from './stream.ts';
|
|
4
4
|
export interface EncodeRPCContext<T = any> {
|
|
5
5
|
addStream: (blob: ProtocolBlob) => T;
|
|
6
6
|
}
|
|
7
7
|
export type ProtocolRPCEncode = ArrayBufferView;
|
|
8
8
|
export interface BaseClientDecoder {
|
|
9
9
|
decode(buffer: ArrayBufferView): unknown;
|
|
10
|
-
decodeRPC(buffer: ArrayBufferView, context: DecodeRPCContext<
|
|
11
|
-
signal?: AbortSignal;
|
|
12
|
-
}) => ProtocolServerBlobStream>): unknown;
|
|
10
|
+
decodeRPC(buffer: ArrayBufferView, context: DecodeRPCContext<ProtocolServerBlobConsumer>): unknown;
|
|
13
11
|
}
|
|
14
12
|
export interface BaseClientEncoder {
|
|
15
13
|
encode(data: unknown): ArrayBufferView;
|
|
@@ -20,7 +18,5 @@ export declare abstract class BaseClientFormat implements BaseClientDecoder, Bas
|
|
|
20
18
|
abstract encode(data: unknown): ArrayBufferView;
|
|
21
19
|
abstract encodeRPC(data: unknown, context: EncodeRPCContext): ProtocolRPCEncode;
|
|
22
20
|
abstract decode(buffer: ArrayBufferView): unknown;
|
|
23
|
-
abstract decodeRPC(buffer: ArrayBufferView, context: DecodeRPCContext<
|
|
24
|
-
signal?: AbortSignal;
|
|
25
|
-
}) => ProtocolServerBlobStream>): unknown;
|
|
21
|
+
abstract decodeRPC(buffer: ArrayBufferView, context: DecodeRPCContext<ProtocolServerBlobConsumer>): unknown;
|
|
26
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/client/format.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/client/format.ts"],"names":[],"mappings":"AA6BA,MAAM,OAAgB,gBAAgB;CAerC"}
|
|
@@ -2,14 +2,12 @@ import type { ProtocolBlob, ProtocolBlobMetadata } from '../common/blob.ts';
|
|
|
2
2
|
import type { ClientMessageType, ProtocolVersion, ServerMessageType } from '../common/enums.ts';
|
|
3
3
|
import type { BaseProtocolError, EncodeRPCStreams } from '../common/types.ts';
|
|
4
4
|
import type { BaseClientDecoder, BaseClientEncoder } from './format.ts';
|
|
5
|
-
import type { ProtocolClientBlobStream,
|
|
5
|
+
import type { ProtocolClientBlobStream, ProtocolServerBlobConsumer } from './stream.ts';
|
|
6
6
|
export type MessageContext = {
|
|
7
7
|
decoder: BaseClientDecoder;
|
|
8
8
|
encoder: BaseClientEncoder;
|
|
9
9
|
addClientStream: (blob: ProtocolBlob) => ProtocolClientBlobStream;
|
|
10
|
-
addServerStream: (streamId: number, metadata: ProtocolBlobMetadata) =>
|
|
11
|
-
signal?: AbortSignal;
|
|
12
|
-
}) => ProtocolServerBlobStream;
|
|
10
|
+
addServerStream: (streamId: number, metadata: ProtocolBlobMetadata) => ProtocolServerBlobConsumer;
|
|
13
11
|
transport: {
|
|
14
12
|
send: (buffer: ArrayBufferView) => void;
|
|
15
13
|
};
|
package/dist/client/stream.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -21,18 +21,18 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"hookable": "6.1.0",
|
|
24
|
-
"@nmtjs/
|
|
25
|
-
"@nmtjs/common": "0.
|
|
26
|
-
"@nmtjs/
|
|
24
|
+
"@nmtjs/type": "0.16.0-beta.1",
|
|
25
|
+
"@nmtjs/common": "0.16.0-beta.1",
|
|
26
|
+
"@nmtjs/contract": "0.16.0-beta.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@nmtjs/core": "0.
|
|
29
|
+
"@nmtjs/core": "0.16.0-beta.1"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@nmtjs/common": "0.
|
|
33
|
-
"@nmtjs/
|
|
34
|
-
"@nmtjs/core": "0.
|
|
35
|
-
"@nmtjs/
|
|
32
|
+
"@nmtjs/common": "0.16.0-beta.1",
|
|
33
|
+
"@nmtjs/contract": "0.16.0-beta.1",
|
|
34
|
+
"@nmtjs/core": "0.16.0-beta.1",
|
|
35
|
+
"@nmtjs/type": "0.16.0-beta.1"
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
38
|
"dist",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"LICENSE.md",
|
|
41
41
|
"README.md"
|
|
42
42
|
],
|
|
43
|
-
"version": "0.
|
|
43
|
+
"version": "0.16.0-beta.1",
|
|
44
44
|
"scripts": {
|
|
45
45
|
"clean-build": "rm -rf ./dist"
|
|
46
46
|
}
|
package/src/client/format.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ProtocolBlob } from '../common/blob.ts'
|
|
|
2
2
|
import type { DecodeRPCContext } from '../common/types.ts'
|
|
3
3
|
import type {
|
|
4
4
|
ProtocolClientBlobStream,
|
|
5
|
-
|
|
5
|
+
ProtocolServerBlobConsumer,
|
|
6
6
|
} from './stream.ts'
|
|
7
7
|
|
|
8
8
|
export interface EncodeRPCContext<T = any> {
|
|
@@ -15,9 +15,7 @@ export interface BaseClientDecoder {
|
|
|
15
15
|
decode(buffer: ArrayBufferView): unknown
|
|
16
16
|
decodeRPC(
|
|
17
17
|
buffer: ArrayBufferView,
|
|
18
|
-
context: DecodeRPCContext<
|
|
19
|
-
(options?: { signal?: AbortSignal }) => ProtocolServerBlobStream
|
|
20
|
-
>,
|
|
18
|
+
context: DecodeRPCContext<ProtocolServerBlobConsumer>,
|
|
21
19
|
): unknown
|
|
22
20
|
}
|
|
23
21
|
|
|
@@ -42,8 +40,6 @@ export abstract class BaseClientFormat
|
|
|
42
40
|
abstract decode(buffer: ArrayBufferView): unknown
|
|
43
41
|
abstract decodeRPC(
|
|
44
42
|
buffer: ArrayBufferView,
|
|
45
|
-
context: DecodeRPCContext<
|
|
46
|
-
(options?: { signal?: AbortSignal }) => ProtocolServerBlobStream
|
|
47
|
-
>,
|
|
43
|
+
context: DecodeRPCContext<ProtocolServerBlobConsumer>,
|
|
48
44
|
): unknown
|
|
49
45
|
}
|
package/src/client/protocol.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { BaseProtocolError, EncodeRPCStreams } from '../common/types.ts'
|
|
|
8
8
|
import type { BaseClientDecoder, BaseClientEncoder } from './format.ts'
|
|
9
9
|
import type {
|
|
10
10
|
ProtocolClientBlobStream,
|
|
11
|
-
|
|
11
|
+
ProtocolServerBlobConsumer,
|
|
12
12
|
} from './stream.ts'
|
|
13
13
|
import { concat } from '../common/binary.ts'
|
|
14
14
|
|
|
@@ -19,7 +19,7 @@ export type MessageContext = {
|
|
|
19
19
|
addServerStream: (
|
|
20
20
|
streamId: number,
|
|
21
21
|
metadata: ProtocolBlobMetadata,
|
|
22
|
-
) =>
|
|
22
|
+
) => ProtocolServerBlobConsumer
|
|
23
23
|
transport: { send: (buffer: ArrayBufferView) => void }
|
|
24
24
|
streamId: () => number
|
|
25
25
|
}
|
package/src/client/stream.ts
CHANGED