@aws-sdk/middleware-eventstream 3.186.0 → 3.188.0
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/CHANGELOG.md +8 -0
- package/dist-es/configuration.js +10 -4
- package/dist-es/handling-middleware.js +6 -14
- package/dist-es/headers-middleware.js +14 -11
- package/dist-es/plugin.js +3 -3
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.188.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.187.0...v3.188.0) (2022-10-13)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-sdk/middleware-eventstream
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [3.186.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.185.0...v3.186.0) (2022-10-06)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @aws-sdk/middleware-eventstream
|
package/dist-es/configuration.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
1
|
export function resolveEventStreamConfig(input) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
const eventSigner = input.signer;
|
|
3
|
+
const eventStreamPayloadHandler = input.eventStreamPayloadHandlerProvider({
|
|
4
|
+
...input,
|
|
5
|
+
eventSigner,
|
|
6
|
+
});
|
|
7
|
+
return {
|
|
8
|
+
...input,
|
|
9
|
+
eventSigner,
|
|
10
|
+
eventStreamPayloadHandler,
|
|
11
|
+
};
|
|
6
12
|
}
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import { __awaiter, __generator } from "tslib";
|
|
2
1
|
import { HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
request = args.request;
|
|
9
|
-
if (!HttpRequest.isInstance(request))
|
|
10
|
-
return [2, next(args)];
|
|
11
|
-
return [2, options.eventStreamPayloadHandler.handle(next, args, context)];
|
|
12
|
-
});
|
|
13
|
-
}); };
|
|
14
|
-
};
|
|
2
|
+
export const eventStreamHandlingMiddleware = (options) => (next, context) => async (args) => {
|
|
3
|
+
const { request } = args;
|
|
4
|
+
if (!HttpRequest.isInstance(request))
|
|
5
|
+
return next(args);
|
|
6
|
+
return options.eventStreamPayloadHandler.handle(next, args, context);
|
|
15
7
|
};
|
|
16
|
-
export
|
|
8
|
+
export const eventStreamHandlingMiddlewareOptions = {
|
|
17
9
|
tags: ["EVENT_STREAM", "SIGNATURE", "HANDLE"],
|
|
18
10
|
name: "eventStreamHandlingMiddleware",
|
|
19
11
|
relation: "after",
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
1
|
import { HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
export const eventStreamHeaderMiddleware = (next) => async (args) => {
|
|
3
|
+
const { request } = args;
|
|
4
|
+
if (!HttpRequest.isInstance(request))
|
|
5
|
+
return next(args);
|
|
6
|
+
request.headers = {
|
|
7
|
+
...request.headers,
|
|
8
|
+
"Content-Type": "application/vnd.amazon.eventstream",
|
|
9
|
+
"x-amz-content-sha256": "STREAMING-AWS4-HMAC-SHA256-EVENTS",
|
|
10
|
+
};
|
|
11
|
+
return next({
|
|
12
|
+
...args,
|
|
13
|
+
request,
|
|
11
14
|
});
|
|
12
|
-
}
|
|
13
|
-
export
|
|
15
|
+
};
|
|
16
|
+
export const eventStreamHeaderMiddlewareOptions = {
|
|
14
17
|
step: "build",
|
|
15
18
|
tags: ["EVENT_STREAM", "HEADER", "CONTENT_TYPE", "CONTENT_SHA256"],
|
|
16
19
|
name: "eventStreamHeaderMiddleware",
|
package/dist-es/plugin.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { eventStreamHandlingMiddleware, eventStreamHandlingMiddlewareOptions } from "./handling-middleware";
|
|
2
2
|
import { eventStreamHeaderMiddleware, eventStreamHeaderMiddlewareOptions } from "./headers-middleware";
|
|
3
|
-
export
|
|
4
|
-
applyToStack:
|
|
3
|
+
export const getEventStreamPlugin = (options) => ({
|
|
4
|
+
applyToStack: (clientStack) => {
|
|
5
5
|
clientStack.addRelativeTo(eventStreamHandlingMiddleware(options), eventStreamHandlingMiddlewareOptions);
|
|
6
6
|
clientStack.add(eventStreamHeaderMiddleware, eventStreamHeaderMiddlewareOptions);
|
|
7
7
|
},
|
|
8
|
-
});
|
|
8
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/middleware-eventstream",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.188.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
6
6
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
},
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@aws-sdk/protocol-http": "3.
|
|
24
|
-
"@aws-sdk/types": "3.
|
|
23
|
+
"@aws-sdk/protocol-http": "3.188.0",
|
|
24
|
+
"@aws-sdk/types": "3.188.0",
|
|
25
25
|
"tslib": "^2.3.1"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|