@smithy/eventstream-serde-universal 3.0.3 → 3.0.5
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/package.json +3 -3
- package/dist-cjs/fixtures/MockEventMessageSource.fixture.js +0 -1
- package/dist-cjs/fixtures/event.fixture.js +0 -1
- package/dist-es/fixtures/MockEventMessageSource.fixture.js +0 -30
- package/dist-es/fixtures/event.fixture.js +0 -4
- package/dist-types/fixtures/MockEventMessageSource.fixture.d.ts +0 -22
- package/dist-types/fixtures/event.fixture.d.ts +0 -17
- package/dist-types/ts3.4/fixtures/MockEventMessageSource.fixture.d.ts +0 -21
- package/dist-types/ts3.4/fixtures/event.fixture.d.ts +0 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/eventstream-serde-universal",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
|
6
6
|
"build:cjs": "node ../../scripts/inline eventstream-serde-universal",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@smithy/eventstream-codec": "^3.1.
|
|
26
|
-
"@smithy/types": "^3.
|
|
25
|
+
"@smithy/eventstream-codec": "^3.1.2",
|
|
26
|
+
"@smithy/types": "^3.3.0",
|
|
27
27
|
"tslib": "^2.6.2"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require("../index.js");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require("../index.js");
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Readable } from "stream";
|
|
2
|
-
export class MockEventMessageSource extends Readable {
|
|
3
|
-
constructor(options) {
|
|
4
|
-
super(options);
|
|
5
|
-
this.readCount = 0;
|
|
6
|
-
this.data = Buffer.concat(options.messages);
|
|
7
|
-
this.emitSize = options.emitSize;
|
|
8
|
-
this.throwError = options.throwError;
|
|
9
|
-
}
|
|
10
|
-
_read() {
|
|
11
|
-
const self = this;
|
|
12
|
-
if (this.readCount === this.data.length) {
|
|
13
|
-
if (this.throwError) {
|
|
14
|
-
process.nextTick(function () {
|
|
15
|
-
self.emit("error", new Error("Throwing an error!"));
|
|
16
|
-
});
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
this.push(null);
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
const bytesLeft = this.data.length - this.readCount;
|
|
25
|
-
const numBytesToSend = Math.min(bytesLeft, this.emitSize);
|
|
26
|
-
const chunk = this.data.slice(this.readCount, this.readCount + numBytesToSend);
|
|
27
|
-
this.readCount += numBytesToSend;
|
|
28
|
-
this.push(chunk);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export const recordEventMessage = Buffer.from("AAAA0AAAAFX31gVLDTptZXNzYWdlLXR5cGUHAAVldmVudAs6ZXZlbnQtdHlwZQcAB1JlY29yZHMNOmNvbnRlbnQtdHlwZQcAGGFwcGxpY2F0aW9uL29jdGV0LXN0cmVhbTEsRm9vLFdoZW4gbGlmZSBnaXZlcyB5b3UgZm9vLi4uCjIsQmFyLG1ha2UgQmFyIQozLEZpenosU29tZXRpbWVzIHBhaXJlZCB3aXRoLi4uCjQsQnV6eix0aGUgaW5mYW1vdXMgQnV6eiEKzxKeSw==", "base64");
|
|
2
|
-
export const statsEventMessage = Buffer.from("AAAA0QAAAEM+YpmqDTptZXNzYWdlLXR5cGUHAAVldmVudAs6ZXZlbnQtdHlwZQcABVN0YXRzDTpjb250ZW50LXR5cGUHAAh0ZXh0L3htbDxTdGF0cyB4bWxucz0iIj48Qnl0ZXNTY2FubmVkPjEyNjwvQnl0ZXNTY2FubmVkPjxCeXRlc1Byb2Nlc3NlZD4xMjY8L0J5dGVzUHJvY2Vzc2VkPjxCeXRlc1JldHVybmVkPjEwNzwvQnl0ZXNSZXR1cm5lZD48L1N0YXRzPiJ0pLk=", "base64");
|
|
3
|
-
export const endEventMessage = Buffer.from("AAAAOAAAACjBxoTUDTptZXNzYWdlLXR5cGUHAAVldmVudAs6ZXZlbnQtdHlwZQcAA0VuZM+X05I=", "base64");
|
|
4
|
-
export const exception = Buffer.from("AAAAtgAAAF8BcW64DTpjb250ZW50LXR5cGUHABhhcHBsaWNhdGlvbi9vY3RldC1zdHJlYW0NOm1lc3NhZ2UtdHlwZQcACWV4Y2VwdGlvbg86ZXhjZXB0aW9uLXR5cGUHAAlFeGNlcHRpb25UaGlzIGlzIGEgbW9kZWxlZCBleGNlcHRpb24gZXZlbnQgdGhhdCB3b3VsZCBiZSB0aHJvd24gaW4gZGVzZXJpYWxpemVyLj6Gc60=", "base64");
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
import { Readable, ReadableOptions } from "stream";
|
|
4
|
-
/**
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export interface MockEventMessageSourceOptions extends ReadableOptions {
|
|
8
|
-
messages: Array<Buffer>;
|
|
9
|
-
emitSize: number;
|
|
10
|
-
throwError?: Error;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
export declare class MockEventMessageSource extends Readable {
|
|
16
|
-
private readonly data;
|
|
17
|
-
private readonly emitSize;
|
|
18
|
-
private readonly throwError?;
|
|
19
|
-
private readCount;
|
|
20
|
-
constructor(options: MockEventMessageSourceOptions);
|
|
21
|
-
_read(): void;
|
|
22
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare const recordEventMessage: Buffer;
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export declare const statsEventMessage: Buffer;
|
|
10
|
-
/**
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
export declare const endEventMessage: Buffer;
|
|
14
|
-
/**
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
|
-
export declare const exception: Buffer;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Readable, ReadableOptions } from "stream";
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export interface MockEventMessageSourceOptions extends ReadableOptions {
|
|
7
|
-
messages: Array<Buffer>;
|
|
8
|
-
emitSize: number;
|
|
9
|
-
throwError?: Error;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
export declare class MockEventMessageSource extends Readable {
|
|
15
|
-
private readonly data;
|
|
16
|
-
private readonly emitSize;
|
|
17
|
-
private readonly throwError?;
|
|
18
|
-
private readCount;
|
|
19
|
-
constructor(options: MockEventMessageSourceOptions);
|
|
20
|
-
_read(): void;
|
|
21
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare const recordEventMessage: Buffer;
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export declare const statsEventMessage: Buffer;
|
|
10
|
-
/**
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
export declare const endEventMessage: Buffer;
|
|
14
|
-
/**
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
|
-
export declare const exception: Buffer;
|