@aws-sdk/eventstream-handler-node 3.972.21 → 3.972.22
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-cjs/index.js +7 -9
- package/package.json +5 -5
package/dist-cjs/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
const { EventStreamCodec } = require("@smithy/core/event-streams");
|
|
2
|
+
const { Transform, Readable, PassThrough, pipeline } = require("node:stream");
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
var node_stream = require('node:stream');
|
|
5
|
-
|
|
6
|
-
class EventSigningTransformStream extends node_stream.Transform {
|
|
4
|
+
class EventSigningTransformStream extends Transform {
|
|
7
5
|
priorSignature;
|
|
8
6
|
messageSigner;
|
|
9
7
|
eventStreamCodec;
|
|
@@ -69,18 +67,18 @@ class EventStreamPayloadHandler {
|
|
|
69
67
|
credentials;
|
|
70
68
|
constructor(options) {
|
|
71
69
|
this.messageSigner = options.messageSigner;
|
|
72
|
-
this.eventStreamCodec = new
|
|
70
|
+
this.eventStreamCodec = new EventStreamCodec(options.utf8Encoder, options.utf8Decoder);
|
|
73
71
|
this.systemClockOffsetProvider = async () => options.systemClockOffset ?? 0;
|
|
74
72
|
this.credentials = options.credentials;
|
|
75
73
|
}
|
|
76
74
|
async handle(next, args, context = {}) {
|
|
77
75
|
const request = args.request;
|
|
78
76
|
const { body: payload, query } = request;
|
|
79
|
-
if (!(payload instanceof
|
|
77
|
+
if (!(payload instanceof Readable)) {
|
|
80
78
|
throw new Error("Eventstream payload must be a Readable stream.");
|
|
81
79
|
}
|
|
82
80
|
const payloadStream = payload;
|
|
83
|
-
request.body = new
|
|
81
|
+
request.body = new PassThrough({
|
|
84
82
|
objectMode: true,
|
|
85
83
|
});
|
|
86
84
|
const match = request.headers?.authorization?.match(/Signature=([\w]+)$/);
|
|
@@ -98,7 +96,7 @@ class EventStreamPayloadHandler {
|
|
|
98
96
|
let resolvePipeline;
|
|
99
97
|
const pipelineError = new Promise((resolve, reject) => {
|
|
100
98
|
resolvePipeline = () => resolve(undefined);
|
|
101
|
-
|
|
99
|
+
pipeline(payloadStream, signingStream, request.body, (err) => {
|
|
102
100
|
if (err) {
|
|
103
101
|
reject(new Error(`Pipeline error in @aws-sdk/eventstream-handler-node: ${err.message}`, { cause: err }));
|
|
104
102
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/eventstream-handler-node",
|
|
3
|
-
"version": "3.972.
|
|
3
|
+
"version": "3.972.22",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
|
|
6
6
|
"build:cjs": "node ../../scripts/compilation/inline",
|
|
7
|
-
"build:es": "tsc -p tsconfig.es.json",
|
|
7
|
+
"build:es": "premove dist-es && tsc -p tsconfig.es.json",
|
|
8
8
|
"build:include:deps": "yarn g:turbo run build -F=\"$npm_package_name\"",
|
|
9
|
-
"build:types": "tsc -p tsconfig.types.json",
|
|
9
|
+
"build:types": "premove dist-types && tsc -p tsconfig.types.json",
|
|
10
10
|
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
|
|
11
|
-
"clean": "premove dist-cjs dist-es dist-types
|
|
11
|
+
"clean": "premove dist-cjs dist-es dist-types",
|
|
12
12
|
"test": "yarn g:vitest run",
|
|
13
13
|
"test:watch": "yarn g:vitest watch"
|
|
14
14
|
},
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@aws-sdk/types": "^3.973.
|
|
25
|
+
"@aws-sdk/types": "^3.973.13",
|
|
26
26
|
"@smithy/core": "^3.24.6",
|
|
27
27
|
"@smithy/types": "^4.14.3",
|
|
28
28
|
"tslib": "^2.6.2"
|