@smithy/eventstream-serde-node 1.0.1 → 1.0.2
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.
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Decoder, Encoder, EventStreamMarshaller as IEventStreamMarshaller, Message } from "@smithy/types";
|
|
3
|
+
import { Readable } from "stream";
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export interface EventStreamMarshaller extends IEventStreamMarshaller {
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export interface EventStreamMarshallerOptions {
|
|
13
|
+
utf8Encoder: Encoder;
|
|
14
|
+
utf8Decoder: Decoder;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare class EventStreamMarshaller {
|
|
20
|
+
private readonly universalMarshaller;
|
|
21
|
+
constructor({ utf8Encoder, utf8Decoder }: EventStreamMarshallerOptions);
|
|
22
|
+
deserialize<T>(body: Readable, deserializer: (input: Record<string, Message>) => Promise<T>): AsyncIterable<T>;
|
|
23
|
+
serialize<T>(input: AsyncIterable<T>, serializer: (event: T) => Message): Readable;
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Readable } from "stream";
|
|
3
|
+
/**
|
|
4
|
+
* Convert object stream piped in into an async iterable. This
|
|
5
|
+
* daptor should be deprecated when Node stream iterator is stable.
|
|
6
|
+
* Caveat: this adaptor won't have backpressure to inwards stream
|
|
7
|
+
*
|
|
8
|
+
* Reference: https://nodejs.org/docs/latest-v11.x/api/stream.html#stream_readable_symbol_asynciterator
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function readabletoIterable<T>(readStream: Readable): AsyncIterable<T>;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/eventstream-serde-node",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"scripts": {
|
|
5
|
-
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
5
|
+
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
|
6
6
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
7
7
|
"build:es": "tsc -p tsconfig.es.json",
|
|
8
8
|
"build:types": "tsc -p tsconfig.types.json",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@smithy/eventstream-serde-universal": "^1.0.
|
|
26
|
-
"@smithy/types": "^1.1.
|
|
25
|
+
"@smithy/eventstream-serde-universal": "^1.0.2",
|
|
26
|
+
"@smithy/types": "^1.1.1",
|
|
27
27
|
"tslib": "^2.5.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|